eaarl.io.flight

Handling for mission data

eaarl.io.flight.flip_waveforms

Specifies whether waveforms should be “flipped” when loading. EAARL waveforms are inverted by default. When this setting is True (the default), the waveforms are flipped so that they look as one would normally expect. Set to False to disable that behavior. Note that other code (such as in eaarl.analyze) expects the waveforms to be flipped (so they are not inverted), so setting this to False may cause some functions to not yield sensible results.

exception eaarl.io.flight.EdbNotLoadedError[source]

Exception raised when edb data is needed but is not loaded

exception eaarl.io.flight.Error[source]

Base class for exceptions in this module

class eaarl.io.flight.Flight(date, zone=None)[source]

Represents a set of raw data sources for an EAARL flight

This facilitates correlating the data sources together.

__init__(date, zone=None)[source]

Initialize self. See help(type(self)) for accurate signature.

asdict(basedir=None)[source]

Returns the configuration for the flight as a dict

Parameters
basedir : string or None
If provided, the paths for files will be relative to this directory.
gps_time_offset()[source]

Returns the time offset between GPS and UTC time for the flight

load_edb(edb_file)[source]

Loads the given EDB file

load_gps(gps_file)[source]

Loads the given GPS file

load_ins(ins_file)[source]

Loads the given INS file

load_ops(ops_file)[source]

Loads the given OPS file

save(conf_file)[source]

Saves the configuration for the flight to a file

soe_day_start()[source]

Returns the epoch time for the start of the day of the flight

times_by_region(region)[source]

Retrieve time ranges corresponding to a region

This determines the time periods where the plane was within the bounds of the given region.

Parameters
region : shapely.geometry.base.BaseGeometry
Region of interest to retrieve time ranges for, using WGS-84 geographic coordinates
wfs_by_raster(rasters=None, start=None, count=1, ranges=None, progress=True)[source]

Retrieves waveform data for raster numbers

Returns DataFrame of waveform data for the given raster number(s). If start and count are provided, then rasters are returned for the given range. If ranges is is provided, then it is treated as a sequence of (start, count) entries. If rasters is provided, it should be a sequence of raster numbers.

Parameters
rasters : int or sequence of ints or None
Sequence of raster numbers
start : integer or None
Starting raster number
count : integer
Number of rasters to retrieve
ranges : sequence of tuples
Sequence of (start, count) tuples.
progress : tqdm.tqdm or boolean, default True
If True and if tqdm is available for import, then a progressbar will be displayed during raster reading. Specify False to disable. You can also specify your own instance of tqdm.tqdm (or compatible) for customizing output.
wfs_by_region(region, progress=True)[source]

Retrieve waveform data corresponding to a region

This retrieves data for records where the plane was within the given region. In other words, the data is retrieved based on the plane’s location instead of the target locations. You may need to expand your region by a few hundred meters to compensate.

Parameters
region : shapely.geometry.base.BaseGeometry
Region of interest to retrieve pulse data for, using WGS-84 geographic coordinates
progress : tqdm.tqdm or boolean, default True
If True and if tqdm is available for import, then a progressbar will be displayed during raster reading. Specify False to disable. You can also specify your own instance of tqdm.tqdm (or compatible) for customizing output.
wfs_by_time(start=None, stop=None, ranges=None, progress=True)[source]

Retrieve waveform data for given time ranges

Returns DataFrame of waveform data for the given time range(s). If start and stop are provided, then data for rasters are returned such that start <= raster start time < stop. If ranges is provided, then each tuple of start, stop are used.

Parameters
start : numeric or None
A start time
stop : numeric or None
A stop time
ranges : sequence or None
Sequence of start and stop tuples.
progress : tqdm.tqdm or boolean, default True
If True and if tqdm is available for import, then a progressbar will be displayed during raster reading. Specify False to disable. You can also specify your own instance of tqdm.tqdm (or compatible) for customizing output.
exception eaarl.io.flight.GpsNotLoadedError[source]

Exception raised when gps data is needed but is not loaded

exception eaarl.io.flight.InsNotLoadedError[source]

Exception raised when ins data is needed but is not loaded

exception eaarl.io.flight.InvalidDateError(err, message)[source]

Exception raised when the date doesn’t work correctly

__init__(err, message)[source]

Initialize self. See help(type(self)) for accurate signature.

exception eaarl.io.flight.NotLoadedError[source]

Base for exceptions relating to dependency data not loaded

exception eaarl.io.flight.OpsNotLoadedError[source]

Exception raised when ops data is needed but is not loaded

eaarl.io.flight.create_flight(date, basedir=None, ops=None, ins=None, gps=None, edb=None, zone=None)[source]

Loads a flight with the given configuration

Parameters
date : string
The date of the flight
basedir : string or None
If provided, then paths are resolved as relative to this path.
ops : string or None
Path to the ops configuration file
ins : string or None
Path to the ins file
gps : string or None
Path to the gps file
edb : string or None
Path to the edb file
zone : string or None
UTM zone for the data
eaarl.io.flight.fromdict(conf, basedir=None)[source]

Loads a flight based on a configuration dict

Parameters
basedir : string or None
If provided, then paths in the configuration will be resolved as relative to this path.
eaarl.io.flight.load(conf_file)[source]

Loads a flight based on a configuration file