RadarData
RadarData provides data structures and utilities for working with synthetic aperture radar (SAR) data. The package handles radar phase history data, SAR imagery, position/navigation/timing (PNT) information, and coordinate transformations.
Overview
The main components of RadarData.jl are:
- VPH (Video Phase History): Core data structure for radar returns
- SARImage: Container for SAR image data with georeferencing
- PNT (Position, Navigation, Timing): Platform state information
- Coordinate Systems: Transformations between ECEF, ENU, LLA, and horizon coordinates
- Range Compression: Pulse compression utilities
- Image Metadata: Structures for SAR image formation (PFA knots, image planes)
- FFT Utilities: Convenience functions for FFT operations
Constants
RadarData.c0 — Constant
c0 = 299792458Speed of light in a vaccuum, expressed in meters per second
Video Phase History (VPH)
The core data type maintained by RadarData.jl is the video phase history, or VPH. This structure contains range-compressed radar returns along with associated metadata including platform positions, timing, and frequency information.
VPH Type
RadarData.VPH — Type
Video Phase History data structure.Each column represents a single pulse of returned data, which has been range-compressed. The columns may represent either frequency or fast-time data, according to the value of range_domain. Data may be either ComplexF32 or ComplexF64, but position and timing metadata will be retained at Float64 precision.
data::Array{Complex{T}, 2} where T<:AbstractFloat: Complex-valued data matrix, frequency (or fast-time / range) by slow-timefreq_list_hz::Vector{Float64}: Frequency list, in Hzref_range_m::Vector{Float64}: Two-way range to the center range bin for each pulseslow_time_s::Vector{Float64}: Per-pulse collection time, in seconds relative toref_time_sref_time_s::Float64: Reference time, in posix time (seconds since Unix Epoch)tx_pos_enu::Matrix{Float64}: Position of transmitter in East-North-Up (ENU), metersrx_pos_enu::Matrix{Float64}: Position of receiver (ENU, meters)srp_enu::Matrix{Float64}: Position of (possibly shifting) scene reference point (ENU, meters)srp_lla::StaticArraysCore.SVector{3, Float64}: Fixed scene reference position for ENU frame in latitude (deg), longitude (deg), altitude (m)kernel_sign::Float64: FFT sign convention for transformation from frequency to fast-time domain, default is -1c_eff_ms::Float64: Effective speed of light (m/s)range_domain::Bool: Whether the first dimension represents frequency or range (fast-time)
RadarData.VPH — Method
VPH(data, freq_list_hz, ref_range_m, slow_time_s, tx_pos_enu; kw_args)Convenience constructor for VPH type.
Keyword Arguments:
ref_time_s = 0rx_pos_enu = tx_pos_enusrp_enu = zeros(3,1)srp_lla = [39.729866; -84.077144; 0]kernel_sign = -1c_eff_ms = c0range_domain = false
RadarData.VPH — Method
VPH(n_freqs, n_pulses)Convenience constructor for generating a quick test VPH of a given size.
VPH Metadata Functions
These functions extract or compute metadata from VPH objects:
RadarData.pri — Method
Approximate pulse repetition interval of VPH.
Assumes constant pulse spacing.RadarData.get_freq_list — Function
get_freq_list(center_freq, bandwidth, num_freqs)RadarData.spatial_freqs — Method
spatial_freqs(vph)For frequency freqs in Hz, return the spatial frequency 2πf/c.
RadarData.bandwidth — Method
bandwidth(vph)Return the bandwidth spanned by VPH.freq_list_hz.
RadarData.center_freq — Method
center_freq(vph)
RadarData.range_res — Method
range_res(vph)Compute two-way range resolution in meters.
RadarData.velocity_res — Method
velocity_res(vph)Compute two-way velocity resolution in meters per pulse.
RadarData.range_axis — Method
range_axis(vph)Compute range axis (two-way meters) of range-Doppler image formed from VPH.
RadarData.fast_time_axis — Method
fast_time_axis(vph)Compute the range axis of the VPH, scaled to relative times of arrival, in seconds.
RadarData.velocity_axis — Method
velocity_axis(vph)Compute velocity axis (m/pulse) of range-Doppler image formed from VPH.
RadarData.time_axis — Method
time_axis(vph)Form an equispaced list of times, spanning duration of VPH collection.
RadarData.doppler_axis — Method
doppler_axis(vph)Compute Doppler frequency axis (Hz) for range-Doppler map.
RadarData.cross_range_extent — Method
cross_range_extent(vph)Compute unambiguous cross range extent (in meters) around scene reference point.
RadarData.bistatic_angles — Method
bistatic_angles(vph)Compute bistatic angle per-pulse.
RadarData.bisectors — Method
bisectors(vph)Return bistatic bisectors for VPH object.
RadarData.range_dir_enu — Method
range_dir_enu(vph)Return a unit vector pointing towards the down-range direction, in ENU coordinates.
RadarData.cross_range_dir_enu — Method
cross_range_dir_enu(vph)Return a unit vector pointing towards the cross-range direction (positive velocity), in ENU coordinates.
RadarData.bp_layover_projection — Method
bp_layover_projection(vph)Compute approximate layover projection for ENU coordinates in short aperture backprojection imagery. Only appropriate for approximately monostatic collections.
RadarData.azimuth_rad — Method
Compute azimuth look direction, in radians.
RadarData.elevation_rad — Method
Compute elevation look direction, in radians.
RadarData.horizon_coords — Method
Compute horizon coordinates (range, azimuth, elevation), in meters and radians.
Base.show — Function
show(io, vph)Custom display method for VPH.
show(io, image)Custom display method for SARImage.
Base.show(io::IO, pfa_knots::PFAKnots)Pretty-print PFAKnots structure with formatted field display.
VPH Domain Conversion
Convert between frequency domain and range (fast-time) domain:
RadarData.vph_to_rs! — Method
vph_to_rs!(vph)Convert vph to range and slow-time data.
RadarData.vph_to_rs — Method
vph_to_rs(vph)RadarData.rs_to_vph! — Method
rs_to_vph!(vph)Convert range and slow-time data back to frequency and slow-time data.
RadarData.rs_to_vph — Method
rs_to_vph(vph)Convert range and slow-time data back to frequency and slow-time data.
VPH Data Selection
Extract subsets and pad VPH data:
RadarData.freq_truncate! — Method
freq_truncate!(vph,keep_idxs)Truncate frequency support of VPH to range of indices.
RadarData.freq_truncate! — Method
freq_truncate!(vph, start_freq_hz, stop_freq_hz)Truncate frequency support of VPH to the range of frequencies specified by start_freq_hz and stop_freq_hz.
RadarData.time_truncate! — Method
time_truncate!(vph, keep_idxs)Truncate time support of VPH to range of pulses.
RadarData.time_truncate! — Method
time_truncate!(vph, start_time_s, stop_time_s)Truncate VPH in time, as indicated by start and stop times.
RadarData.extract_cpi — Method
extract_cpi(vph, cpi_idxs)Extract a sub-VPH from the given pulse indices. This is sometimes referred to as a Coherent Processing Interval (CPI).
RadarData.freq_pad! — Function
freq_pad!(vph, num_top, num_bottom = num_top)Zero-pad VPH in frequency domain, adding num_top frequency bins at the low end and num_bottom frequency bins at the high end.
RadarData.range_pad! — Function
range_pad!(vph, num_top, num_bottom = num_top)Zero-pad VPH in range (fast-time) domain, adding num_top range bins at the top and num_bottom range bins at the bottom.
SAR Image
SAR images with georeferencing and metadata.
SARImage Type
RadarData.SARImage — Type
SARImage
Structure for containing SAR image data with axes and labels.
data::Array{Complex{T}, 2} where T<:AbstractFloat: Image pixel data. Expected to be either ComplexF32 or ComplexF64row_axis::Vector{Float64}: Location of pixel grid centers, increasing down first dimension (row)col_axis::Vector{Float64}: Location of pixel grid centers, increasing across second dimension (column)row_label::String: Label for row axiscol_label::String: Label for column axissrp_lla::StaticArraysCore.SVector{3, Float64}: Scene reference point in LLA coordinatessrp_pixel::StaticArraysCore.SVector{2, Int64}: Pixel corresponding to scene reference pointrow_unit_vector::StaticArraysCore.SVector{3, Float64}: Unit vector pointing in direction of increasing first direction in ECEF coordinate framecol_unit_vector::StaticArraysCore.SVector{3, Float64}: Unit vector pointing in direction of increasing second direction in ECEF coordinate framealgorithm::String: Identifier for algorithm used to form the imagefull_size::StaticArraysCore.SVector{2, Int64}: Full image size, if this image is a sub-imagestart_idxs::StaticArraysCore.SVector{2, Int64}: Row and column index of the first pixel in the sub-image, relative to the full image
SARImage Functions
RadarData.resolution — Method
resolution(image)Return static vector with pixel spacing in meters of SARImage in row and column axes.
Missing docstring for srp_ecef(::SARImage). Check Documenter's build log for details.
RadarData.image_corners_ecef — Function
image_corners_ecef(image)Return corners of image in ECEF coordinates. Order of columns is first row, first column; first row, last column; last row, last column; last row, first column. Note, this does not account for Earth curvature.
RadarData.image_corners_lla — Function
image_corners_lla(image)Return corners of image in LLA coordinates. Order of columns is first row, first column; first row, last column; last row, last column; last row, first column. Note, this does not account for Earth curvature.
RadarData.enu_frame — Function
enu_frame(image)Return East-North-Up (ENU) coordinate frame centered on image SRP, expressed in relative ECEF coordinates.
RadarData.image_axes — Function
image_axes(image)Return image axes, expressed in relative ECEF coordinates. Column order is down range, increasing cross range, and up out of imaging plane.
Position, Navigation, and Timing (PNT)
PNT structures store platform state information including position, velocity, and attitude.
PNT Types
RadarData.PVAHeader — Type
Position, Velocity, Attitude message header. Corresponds to ASPN convention in aspn_schema/header.schema.json
RadarData.PVA — Type
Position, Velocity, Attitude message. Corresponds to ASPN convention in aspn_schema/measurement_position_velocity_attitude.schema.json.
RadarData.PNT — Type
Position, navigation, and timing data. Float64 was chosen to reduce precision errors in position and timing.ecef = Earth-Centered, Earth-Fixed coordinate. velenums = Velocity of platform in local East-North-Up coordinates. attitude = rotation of body frame relative to local NED coordinate frame. time_s = Time of measurement, in seconds. Typically maintained relative to reference time.
RadarData.PNTHistory — Type
PNT history maintains a buffer of previous `max_states` PNT states.current_end is an index indicating the last-stored state. When current_end exceeds max_states, current_end is reset to 1 and the buffer begins overwriting the oldest elements. Also includes ref_time_s; all contained states are assumed to have time_s relative to this time.
PNT Functions
RadarData.receive_pva! — Function
receive_pva!(history, pva)Receive a position, velocity, acceleration message. Overwrites the oldest state if PNTHistory has reached its maximum size.
RadarData.interp_states — Function
interp_states(history, time_s)Return best linearly interpolated estimate of state at the relative input time, in seconds. Assumes time_s is a single float or is sorted in increasing order. No extrapolation.
RadarData.interp_ecef — Function
interp_ecef(history, time_s)Interpolate ECEF field of position history for multiple times.
RadarData.range_to_point — Function
range_to_point(pnt,ecef)Compute one-way range (m) from PNT to ECEF coordinate.
RadarData.range_rate_to_point — Function
range_rate_to_point(pnt, ecef)Compute one-way range (m) and one-way change in range (m/s) from PNT to ECEF coordinate.
range_rate_to_point(pnt, enu, ecef_ref)Compute one-way range (m) and one-way change in range (m/s) from PNT to ENU coordinate.
Coordinate Transformations
Functions for working with coordinate systems. VPH objects are always expressed in a local coordinate system, assumed to be the East-North-Up (ENU) tangent plane to the WGS84 ellipsoid at vph.lla.
RadarData.cart_to_horizon — Function
cart_to_horizon(cart_pos)Convert Cartesian coordinates stored as a 3 x N array to horizontal coordinates, (range, azimuth, elevation). Azimuth is measured as the angle with the x-axis, elevation is measured from the xy-plane. Angles are in radians.
RadarData.cart_to_horizon_unwrap — Function
cart_to_horizon_unwrap(cart_pos)Convert Cartesian coordinates stored as a 3 x N array to horizontal coordinates, (range, azimuth, elevation). Azimuth is measured as the angle with the x-axis, elevation is measured from the xy-plane. Angles are in radians. Azimuth and elevation angles are unwrapped using DSP.unwrap.
RadarData.horizon_to_cart — Function
horizon_to_cart(horz_pos)Convert horizontal coordinates stored as a 3 x N array to Cartesian coordinates. Angles are assumed to be in radians.
RadarData.azimuth_rad — Function
azimuth_rad(bisectors)The unwrapped azimuth angle associated with the bistatic bisector stored in each column of input, in radians.
Compute azimuth look direction, in radians.
RadarData.elevation_rad — Function
elevation_rad(bisectors)The unwrapped elevation angle associated with the bistatic bisector stored in each column of input, in radians.
Compute elevation look direction, in radians.
RadarData.slant_plane_rot_2D — Function
slant_plane_rot_2D(bisectors)Compute rotation matrix to align bisectors to form a slant-plane-aligned ground-plane image. This centers the bisectors in azimuth.
RadarData.slant_plane_rot_3D — Function
slant_plane_rot_3D(bisectors, align_roll = false)Compute rotation matrix to align bisectors to form a slant-plane aligned image. By default, the rotation will only rotate in the azimuth and elevation directions. To also correct for a residual roll angle between the ground plane and the slant plane, set align_roll = true.
RadarData.ned_to_enu — Function
ned_to_enu(ned)Convert North-East-Down coordinates to East-North-Up.
RadarData.body_to_ecef — Function
body_to_ecef(ned)Convert body coordinates to ECEF orientations.
RadarData.enu_rotation — Function
enu_rotation(lla)Compute rotation matrix from local ENU coordinates to ECEF coordinates, given lla as origin of ENU frame. ecef = R * enu + ecef_ref ENU coordinate axes are described by the columns of R.
RadarData.intersect_los_plane — Function
intersect_los_plane(body_los, pnt, ground_hae_m = 0)Compute intersection of line of sight vector relative to body frame with ENU plane referenced to pnt.ecef, and return ENU coordinate. Ground plane is assumed to have given height above ellipsoid (HAE).
Range Compression
Pulse compression utilities:
RadarData.synth_chirp — Function
synth_chirp(sample_rate_hz, bandwidth_hz, duration_ns, carrier_hz = 0, start_phase_normalized = 0)Synthesize chirp given sample rate in Hz, bandwidth in Hz, and duration of the waveform in nanoseconds. start_phase_normalized is a phase offset in cycles, in the range [0,1). Input a negative bandwidth_hz to return a down-chirp.
RadarData.synth_chirp! — Function
synth_chirp!(chirp, sample_rate_hz, bandwidth_hz, duration_ns, carrier_hz = 0, start_phase_normalized = 0)Synthesize chirp given sample rate in Hz, bandwidth in Hz, and duration of the waveform in nanoseconds. start_phase_normalized is a phase offset in cycles, in the range [0,1). Input a negative bandwidth_hz to return a down-chirp.
RadarData.range_compress — Function
range_compress(iq_data, ref_waveform_fft; downsample_rate = 1)Apply FFT-based convolution to columns of iq_data with FFT of a reference waveform.
RadarData.range_compress! — Function
range_compress!(iq_data, ref_waveform_fft)Apply FFT-based convolution to columns of iq_data with FFT of a reference waveform. This version operates in-place, and so does not offer down-sampling or appropriate padding and trucation.
Image Metadata
Structures for SAR image formation and metadata.
Image Plane
RadarData.ImagePlane — Type
ImagePlaneEnum specifying the image focus plane convention.
Values:
GROUND_PLANE: Image plane coincides with ENU ground plane (z=0)FIXED_EL_PLANE: Slant plane for constant-elevation flight through aperture centerSLANT_PLANE: Best-fit plane to VPH bisector vectors
PFA Knots
Polar Format Algorithm metadata structure:
RadarData.PFAKnots — Type
Polar Format Algorithm Knots data structure.
This structure holds metadata relevant to the formation and inversion of polar format images.
spatial_freqs::Vector{Float64}: Frequency list, radians/meterbisectors::Matrix{Float64}: Bistatic bisector vectors (3 x num_pulses)ref_range_m::Vector{Float64}: Two-way reference range per pulse, in metersslow_time_s::Vector{Float64}: Time relative to reference time, per pulse, in secondsref_time_s::Float64: Reference time, in seconds since Unix Epochk_center::StaticArraysCore.SVector{2, Float64}: Spatial frequency center, removed for basebanding (radians/meter)exp_inds::StaticArraysCore.SVector{2, Float64}: Frequency and slow-time indices which correspond to k-centerkx_image::Vector{Float64}: Spatial frequency in first dimension, uniformly spaced for imaging (radians/meter)ky_image::Vector{Float64}: Spatial frequency in second dimension, uniformly spaced for imaging (radians/meter)x_image::Vector{Float64}: Image axis first dimension, meters. Range for slant plane aligned imagery.y_image::Vector{Float64}: Image axis second dimension, meters. Cross range for slant plane aligned imagery.slant_plane_rot::StaticArraysCore.SMatrix{3, 3, Float64}: Rotation from ENU to slant planetx_poly::StaticArraysCore.SMatrix{3, 3, Float64}: Polynomial coefficients for slant-plane-aligned transmitter positionkernel_sign::Float64: FFT sign convention, default is -1separable::Bool: Whether to use separable interpolation or joint interpolationinner_box::Bool: Whether to use an inner box in frequency domain or outer boxquadratic::Bool: Whether to apply quadratic phase error correctiondistortion::Bool: Whether to correct the characteristic PFA distortion by resampling the imageimage_plane::ImagePlane: Choice of focus plane for image, see ImagePlane enum for optionsenu_align::Bool: Resamples to align image with VPH sensor coordinate convention (ENU)comp_poly::StaticArraysCore.SVector{3, Float64}: Derived quantity, range, rate, etc. of the sensor at aperture centerradius_start::Vector{Float64}: Derived quantity, starting index for radial interpolationradius_delta::Vector{Float64}: Derived quantity, index step for radial interpolation
RadarData.compute_vph_center — Function
compute_vph_center(k_center, spatial_freqs, bisectors) -> Vector{Float64}Find VPH [frequencyindex, pulseindex] corresponding to k-space center. Uses nonlinear optimization to match k_center with interpolated VPH bisector geometry.
FFT Utilities
Convenience functions for FFT operations:
RadarData.fft_spacing — Function
fft_spacing(fft_len)Relative indices for window of length fft_len centered on the DC-bin of an equivalently sized FFT.
RadarData.sfft — Function
sfft(in_array, [dims])Symmetric FFT, equivalent to fftshift(fft(ifftshift(input)))
RadarData.sifft — Function
sifft(in_array, [dims])Symmetric IFFT, equivalent to fftshift(ifft(ifftshift(input)))
RadarData.vph_to_rd — Function
vph_to_rd(in_array, kernel_sign = -1)Create a range-Doppler image from VPH.data using FFTs / IFFTs according to VPH.kernel_sign.
RadarData.rd_to_vph — Function
rd_to_vph(in_array, kernel_sign = -1)Convert complex range-Doppler image back to spatial frequency domain (VPH.data domain) using FFTs / IFFTs based on VPH.kernel_sign.
Support for Conventions
Common conventions are encapsulated in function handles for easy recall:
RadarData.spatial_freqs — Function
spatial_freqs(freqs)For frequency freqs in Hz, return the spatial frequency 2πf/c.
spatial_freqs(vph)For frequency freqs in Hz, return the spatial frequency 2πf/c.
RadarData.bandwidth — Function
bandwidth(freq_list_hz)Return the bandwidth represented by equispaced freq_list_hz.
bandwidth(vph)Return the bandwidth spanned by VPH.freq_list_hz.
RadarData.range_res — Function
range_res(bandwidth)Given bandwidth in Hz, compute two-way range resolution in meters. Note that this value will not change for upsampled range profiles.
range_res(vph)Compute two-way range resolution in meters.
RadarData.velocity_res — Function
velocity_res(center_freq)Given center_freq in Hz, compute two-way velocity resolution in meters per pulse.
velocity_res(vph)Compute two-way velocity resolution in meters per pulse.
RadarData.range_axis — Function
range_axis(range_step, num_bins)Compute range axis (meters) of range-Doppler image given the range step and number of range bins.
range_axis(vph)Compute range axis (two-way meters) of range-Doppler image formed from VPH.
RadarData.velocity_axis — Function
velocity_axis(vel_step, num_bins)Compute velocity axis (m/pulse) of range-Doppler image formed from VPH.
velocity_axis(vph)Compute velocity axis (m/pulse) of range-Doppler image formed from VPH.
Index
RadarData.c0RadarData.ImagePlaneRadarData.PFAKnotsRadarData.PNTRadarData.PNTHistoryRadarData.PVARadarData.PVAHeaderRadarData.SARImageRadarData.VPHRadarData.VPHRadarData.VPHBase.showRadarData.azimuth_radRadarData.azimuth_radRadarData.bandwidthRadarData.bandwidthRadarData.bisectorsRadarData.bistatic_anglesRadarData.body_to_ecefRadarData.bp_layover_projectionRadarData.cart_to_horizonRadarData.cart_to_horizon_unwrapRadarData.center_freqRadarData.center_freqRadarData.compute_vph_centerRadarData.cross_range_dir_enuRadarData.cross_range_extentRadarData.doppler_axisRadarData.elevation_radRadarData.elevation_radRadarData.enu_frameRadarData.enu_rotationRadarData.extract_cpiRadarData.fast_time_axisRadarData.fft_spacingRadarData.freq_pad!RadarData.freq_truncate!RadarData.freq_truncate!RadarData.get_freq_listRadarData.horizon_coordsRadarData.horizon_to_cartRadarData.image_axesRadarData.image_corners_ecefRadarData.image_corners_llaRadarData.interp_ecefRadarData.interp_statesRadarData.intersect_los_planeRadarData.ned_to_enuRadarData.priRadarData.range_axisRadarData.range_axisRadarData.range_compressRadarData.range_compress!RadarData.range_dir_enuRadarData.range_pad!RadarData.range_rate_to_pointRadarData.range_resRadarData.range_resRadarData.range_to_pointRadarData.rd_to_vphRadarData.receive_pva!RadarData.resolutionRadarData.rs_to_vphRadarData.rs_to_vph!RadarData.sfftRadarData.sifftRadarData.slant_plane_rot_2DRadarData.slant_plane_rot_3DRadarData.spatial_freqsRadarData.spatial_freqsRadarData.synth_chirpRadarData.synth_chirp!RadarData.time_axisRadarData.time_truncate!RadarData.time_truncate!RadarData.velocity_axisRadarData.velocity_axisRadarData.velocity_resRadarData.velocity_resRadarData.vph_to_rdRadarData.vph_to_rsRadarData.vph_to_rs!