eaarl.analyze

Process raw data to derive pointeger records

eaarl.analyze.add_fs(frame, ops, prefix='fs', limit=12)[source]

Add the first surface target to the waveform data using centroid

Detects a target using the centroid of the waveform. This will generally correspond to the first surface.

Adds five fields to the dataframe: fs_pos, which is the position in the waveform of the target; fs_range, which is the distance in meters between the mirror and the target; and fx_x, fs_y, and fs_z, which are the UTM coordinates of the target.

Parameters
frame : pandas.DataFrame
DataFrame with pulse data as returned by get_for_region(), get_by_time(), or get_by_rasters().
ops : dict
The ops data, available as flight.ops on an eaarl.io.flight.Flight or by manually loading an ops file as a dict.
prefix : string, default “fs\_”
Allows you to change the prefix for the fields added to the dataframe.
limit : integer or None, default 12
Limits how many samples of the waveform are used for the centroid calculation. By default, the first 12 samples are used.
eaarl.analyze.add_mirror(frame, ops)[source]

Adds the mirror location to the records

Adds four fields to the dataframe: tx_pos, which is the centroid of the waveform; and mir_x, mir_y, and mir_z, which are the UTM coordinates of the mirror on the plane.

Parameters
frame : pandas.DataFrame
Dataframe with waveform records.
eaarl.analyze.centroid(wf, limit=None)[source]

Returns the centroid of the waveform

Returns the 0-based index into the waveform where the centroid is located. If a centroid cannot be calculated, returns -1.

Parameters
wf : sequence of numbers
Any sequence of numbers suitable as input to np.array, representing the sample values for the digitized waveform.
eaarl.analyze.remove_failed_thresh(frame, rx=True, tx=True)[source]

Removes records with failed rx/tx thresholds.

Parameters
frame : pandas.DataFrame
DataFrame to discard records from. Must contain fields thresh_rx and thresh_tx.
rx : bool
If True, discard records where thersh_rx == 1.
tx : bool
If True, discard records where thersh_tx == 1.
Returns : pandas.DataFrame
New pandas.DataFrame with kept records.
eaarl.analyze.select_eaarla_channel(frame, max_saturated=5, max_samples=12, saturation_value=250)[source]

Returns a frame with the optimal channel for each EAARL-A raster.

The EAARL-A system collected three channels for each laser pulse. Channel 1 received 90% of the return energy, channel 2 received 9% of the return energy, and channel 3 received 1% of the return energy. This permits a greater overall range of sensitivity: if the first channel is saturated, you can use the second; if the second is saturated, you can use the third. (Channel 4 is unused on the EAARL-A system and contains noise, so it is never used.)

This function picks the first non-saturated channel for each pulse.

Parameters
frame : pandas.DataFrame
DataFrame of raster data to extract from. Must contain fields channel, raster_number, pulse_number, and rx. Must be sorted by raster_number, then pulse_number, then channel.
max_saturated : int
Maximum number of samples that may be saturated. Default is 5.
max_samples : int
Maximum number of samples at the head of the waveform to check. Defaults to 12.
saturation_value : int
Saturation value threshold. If a sample is greater than or equal to this, it is saturated. Default is 250.
Returns : pandas.DataFrame
New pandas.DataFrame with kept records.