eaarl-io  1.0.1+71abbd4
EAARL Input/Output Library (Public API)
Macros | Functions
units.h File Reference

Unit conversions for EAARL data. More...

#include "eaarlio/edb.h"
#include "eaarlio/raster.h"
#include <stdint.h>

Go to the source code of this file.

Macros

#define EAARLIO_UNITS_SCAN_ANGLE_COUNTS_DEGREES   0.045
 Conversion factor for scan angle counts to degrees. More...
 
#define EAARLIO_UNITS_TIME_FRACTION_SECONDS   1.6e-6
 Conversion factor for fractional time to seconds. More...
 

Functions

double eaarlio_units_edb_time (struct eaarlio_edb_record *record)
 Returns the timestamp for an EDB record. More...
 
double eaarlio_units_raster_time (struct eaarlio_raster *raster)
 Returns the timestamp for an EAARL raster. More...
 
double eaarlio_units_pulse_time (struct eaarlio_raster *raster, uint16_t pulse_number)
 Returns the timestamp for a pulse in an EAARL raster. More...
 
double eaarlio_units_pulse_scan_angle (struct eaarlio_pulse *pulse)
 Returns the scan angle in degrees for a pulse. More...
 

Detailed Description

Unit conversions for EAARL data.

This header provides constants and functions for use in converting hardware-specific units to standard units for time and angles.

Macro Definition Documentation

◆ EAARLIO_UNITS_SCAN_ANGLE_COUNTS_DEGREES

#define EAARLIO_UNITS_SCAN_ANGLE_COUNTS_DEGREES   0.045

Conversion factor for scan angle counts to degrees.

The raw value for scan angle counts (eaarlio_pulse::scan_angle_counts) needs to be multiplied by this to convert it into degrees.

◆ EAARLIO_UNITS_TIME_FRACTION_SECONDS

#define EAARLIO_UNITS_TIME_FRACTION_SECONDS   1.6e-6

Conversion factor for fractional time to seconds.

The raw values for fractional times (eaarlio_raster::time_fraction and eaarlio_pulse::time_offset) need to be multiplied by this to convert them to seconds.

Function Documentation

◆ eaarlio_units_edb_time()

double eaarlio_units_edb_time ( struct eaarlio_edb_record record)

Returns the timestamp for an EDB record.

Uses the eaarlio_edb_record::time_seconds and eaarlio_edb_record::time_fraction fields to derive a timestamp in seconds of the epoch.

Parameters
[in]recordAn EDB record
Returns
The seconds-of-the-epoch timestamp for the record, or 0 if record is NULL
Examples:
example_edb_read.c.

◆ eaarlio_units_pulse_scan_angle()

double eaarlio_units_pulse_scan_angle ( struct eaarlio_pulse pulse)

Returns the scan angle in degrees for a pulse.

Uses the eaarlio_pulse::scan_angle_counts field to derive the scan angle in degrees.

Parameters
[in]pulseAn EAARL pulse
Returns
The scan angle in degrees, or 0 if pulse is NULL
Examples:
eaarlio_yaml.c, and example_flight_read_raster_pulse.c.

◆ eaarlio_units_pulse_time()

double eaarlio_units_pulse_time ( struct eaarlio_raster raster,
uint16_t  pulse_number 
)

Returns the timestamp for a pulse in an EAARL raster.

Uses the eaarlio_raster::time_seconds and eaarlio_raster::time_fraction fields and the eaarlio_pulse::time_offset field from the specified pulse to derive a timestamp in seconds of the epoch.

Parameters
[in]rasterAn EAARL raster
[in]pulse_numberThe pulse number, which is a 1-based index into eaarlio_raster::pulse.
Returns
The seconds-of-the-epoch timestamp for the pulse, or 0 if raster is NULL or if the pulse cannot be retrieved
Examples:
eaarlio_yaml.c, and example_flight_read_raster_pulse.c.

◆ eaarlio_units_raster_time()

double eaarlio_units_raster_time ( struct eaarlio_raster raster)

Returns the timestamp for an EAARL raster.

Uses the eaarlio_raster::time_seconds and eaarlio_raster::time_fraction fields to derive a timestamp in seconds of the epoch.

Parameters
[in]rasterAn EAARL raster
Returns
The seconds-of-the-epoch timestamp for the raster, or 0 if raster is NULL
Examples:
eaarlio_yaml.c, example_flight_read_raster_pulse.c, and example_flight_read_rasters.c.