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.c0Constant
c0 = 299792458

Speed 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.VPHType
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-time

  • freq_list_hz::Vector{Float64}: Frequency list, in Hz

  • ref_range_m::Vector{Float64}: Two-way range to the center range bin for each pulse

  • slow_time_s::Vector{Float64}: Per-pulse collection time, in seconds relative to ref_time_s

  • ref_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), meters

  • rx_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 -1

  • c_eff_ms::Float64: Effective speed of light (m/s)

  • range_domain::Bool: Whether the first dimension represents frequency or range (fast-time)

RadarData.VPHMethod
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 = 0
  • rx_pos_enu = tx_pos_enu
  • srp_enu = zeros(3,1)
  • srp_lla = [39.729866; -84.077144; 0]
  • kernel_sign = -1
  • c_eff_ms = c0
  • range_domain = false
RadarData.VPHMethod
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.priMethod
Approximate pulse repetition interval of VPH.
Assumes constant pulse spacing.
RadarData.spatial_freqsMethod
spatial_freqs(vph)

For frequency freqs in Hz, return the spatial frequency 2πf/c.

RadarData.range_axisMethod
range_axis(vph)

Compute range axis (two-way meters) of range-Doppler image formed from VPH.

RadarData.fast_time_axisMethod
fast_time_axis(vph)

Compute the range axis of the VPH, scaled to relative times of arrival, in seconds.

RadarData.velocity_axisMethod
velocity_axis(vph)

Compute velocity axis (m/pulse) of range-Doppler image formed from VPH.

RadarData.time_axisMethod
time_axis(vph)

Form an equispaced list of times, spanning duration of VPH collection.

RadarData.cross_range_extentMethod
cross_range_extent(vph)

Compute unambiguous cross range extent (in meters) around scene reference point.

RadarData.range_dir_enuMethod
range_dir_enu(vph)

Return a unit vector pointing towards the down-range direction, in ENU coordinates.

RadarData.cross_range_dir_enuMethod
cross_range_dir_enu(vph)

Return a unit vector pointing towards the cross-range direction (positive velocity), in ENU coordinates.

RadarData.bp_layover_projectionMethod
bp_layover_projection(vph)

Compute approximate layover projection for ENU coordinates in short aperture backprojection imagery. Only appropriate for approximately monostatic collections.

Base.showFunction
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.rs_to_vph!Method
rs_to_vph!(vph)

Convert range and slow-time data back to frequency and slow-time data.

RadarData.rs_to_vphMethod
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, 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, start_time_s, stop_time_s)

Truncate VPH in time, as indicated by start and stop times.

RadarData.extract_cpiMethod
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.SARImageType

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 ComplexF64

  • row_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 axis

  • col_label::String: Label for column axis

  • srp_lla::StaticArraysCore.SVector{3, Float64}: Scene reference point in LLA coordinates

  • srp_pixel::StaticArraysCore.SVector{2, Int64}: Pixel corresponding to scene reference point

  • row_unit_vector::StaticArraysCore.SVector{3, Float64}: Unit vector pointing in direction of increasing first direction in ECEF coordinate frame

  • col_unit_vector::StaticArraysCore.SVector{3, Float64}: Unit vector pointing in direction of increasing second direction in ECEF coordinate frame

  • algorithm::String: Identifier for algorithm used to form the image

  • full_size::StaticArraysCore.SVector{2, Int64}: Full image size, if this image is a sub-image

  • start_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.resolutionMethod
resolution(image)

Return static vector with pixel spacing in meters of SARImage in row and column axes.

Missing docstring.

Missing docstring for srp_ecef(::SARImage). Check Documenter's build log for details.

RadarData.image_corners_ecefFunction
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_llaFunction
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_frameFunction
enu_frame(image)

Return East-North-Up (ENU) coordinate frame centered on image SRP, expressed in relative ECEF coordinates.

RadarData.image_axesFunction
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.PVAHeaderType

Position, Velocity, Attitude message header. Corresponds to ASPN convention in aspn_schema/header.schema.json

RadarData.PVAType

Position, Velocity, Attitude message. Corresponds to ASPN convention in aspn_schema/measurement_position_velocity_attitude.schema.json.

RadarData.PNTType
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.PNTHistoryType
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_statesFunction
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_ecefFunction
interp_ecef(history, time_s)

Interpolate ECEF field of position history for multiple times.

RadarData.range_rate_to_pointFunction
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_horizonFunction
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_unwrapFunction
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_cartFunction
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_radFunction
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_radFunction
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_2DFunction
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_3DFunction
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_enuFunction
ned_to_enu(ned)

Convert North-East-Down coordinates to East-North-Up.

RadarData.enu_rotationFunction
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_planeFunction
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_chirpFunction
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_compressFunction
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.ImagePlaneType
ImagePlane

Enum 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 center
  • SLANT_PLANE: Best-fit plane to VPH bisector vectors
Missing docstring.

Missing docstring for GROUND_PLANE. Check Documenter's build log for details.

Missing docstring.

Missing docstring for FIXED_EL_PLANE. Check Documenter's build log for details.

Missing docstring.

Missing docstring for SLANT_PLANE. Check Documenter's build log for details.

PFA Knots

Polar Format Algorithm metadata structure:

RadarData.PFAKnotsType

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/meter

  • bisectors::Matrix{Float64}: Bistatic bisector vectors (3 x num_pulses)

  • ref_range_m::Vector{Float64}: Two-way reference range per pulse, in meters

  • slow_time_s::Vector{Float64}: Time relative to reference time, per pulse, in seconds

  • ref_time_s::Float64: Reference time, in seconds since Unix Epoch

  • k_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-center

  • kx_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 plane

  • tx_poly::StaticArraysCore.SMatrix{3, 3, Float64}: Polynomial coefficients for slant-plane-aligned transmitter position

  • kernel_sign::Float64: FFT sign convention, default is -1

  • separable::Bool: Whether to use separable interpolation or joint interpolation

  • inner_box::Bool: Whether to use an inner box in frequency domain or outer box

  • quadratic::Bool: Whether to apply quadratic phase error correction

  • distortion::Bool: Whether to correct the characteristic PFA distortion by resampling the image

  • image_plane::ImagePlane: Choice of focus plane for image, see ImagePlane enum for options

  • enu_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 center

  • radius_start::Vector{Float64}: Derived quantity, starting index for radial interpolation

  • radius_delta::Vector{Float64}: Derived quantity, index step for radial interpolation

RadarData.compute_vph_centerFunction
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_spacingFunction
fft_spacing(fft_len)

Relative indices for window of length fft_len centered on the DC-bin of an equivalently sized FFT.

RadarData.sfftFunction
sfft(in_array, [dims])

Symmetric FFT, equivalent to fftshift(fft(ifftshift(input)))

RadarData.sifftFunction
sifft(in_array, [dims])

Symmetric IFFT, equivalent to fftshift(ifft(ifftshift(input)))

RadarData.vph_to_rdFunction
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_vphFunction
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_freqsFunction
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.bandwidthFunction
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_resFunction
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_resFunction
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_axisFunction
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_axisFunction
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