backscatter.fitacf.fitacf module

class backscatter.fitacf.fitacf.PhaseDataPoints(raw_data, phase_type, lags, range_obj)[source]

Bases: object

Contains phase data points for a particular range.

Phase data points can apply to both ACF or XCF phase. This class is used for both velocity and elevation points. This class creates an array of phases, placeholder sigmas(alpha_2), and t values for a range created from the raw data.

create_arrays(raw_data, phase_type, lags, range_obj)[source]

Creates the data arrays associated with a range

From the raw data, phase is determined for ACF or XCF data. Sigmas are determined after power fitting, so alpha_2 is used a placeholder at this point. After sigma is found, t is determined by multiplying lag numbers by the fundamental spacing.

Parameters:
  • raw_data – a dictionary of raw data parameters

  • phase_type – “acfd” or “xcfd” to select which data arrays to use

  • lags – list of lag dictionaries

  • range_obj – The range object this data is to associated with

remove_bad_points(bad_indices)[source]

Removes data points that are to be excluded from fitting

Parameters:

bad_indices – a list of indices of points to remove

set_phases(phases)[source]

Reassign phases

Parameters:

phases – an array of new phases

set_sigmas(sigmas)[source]

Reassign sigma values

Parameters:

sigmas – an array of new sigmas

class backscatter.fitacf.fitacf.PowerDataPoints(raw_data, lags, range_obj)[source]

Bases: object

Contains the power data points for a particular range

This class contains creates an array of log powers, sigmas, and t values for a range created from the raw data.

create_arrays(raw_data, lags, range_obj)[source]

Creates the data arrays associated with a range

From the raw data, the magnitude of the power is found. It is then normalized for the calculation of sigma. After sigma is found, t is determined by multiplying lag numbers by the fundamental spacing.

Parameters:
  • raw_data – a dictionary of raw data parameters

  • lags – list of lag dictionaries

  • range_obj – The range object this data is to associated with

remove_bad_points(bad_indices)[source]

Removes data points that are to be excluded from fitting

Parameters:

bad_indices – a list of indices of points to remove

remove_inf_points(non_inf_indices)[source]
class backscatter.fitacf.fitacf.Range(idx, range_number, raw_data, lags)[source]

Bases: object

This class holds all the data associated with a range to be fit

The Range class extracts what is necessary from the raw data for a particular range in order to prepare for a fit. This class computes the cross-range interference for a range and then generates the alpha_2 values for each lag. Phases, elevations, and power data points are then constructed and calculated from the raw data.

find_alphas(raw_data, lags)[source]

From cross-range interference, computes alpha_2 for each lag

Parameters:
  • raw_data – a dictionary of raw data parameters

  • lags – a list of lag dictionaries

Returns:

an array of alphas for each lag

find_cri(raw_data)[source]

Creates an array of cross range interference for each pulse

Parameters:

raw_data – a dictionary of raw data parameters

remove_bad_alphas(bad_indices)[source]

Remove alpha_2 that are associated with bad data points

Parameters:

bad_indices – a list of indices of points to remove

backscatter.fitacf.fitacf.create_lag_list(raw_data)[source]

Creates a list of lag dictionaries from raw data

This method uses the mplgs, ptab, mppul, ltab, mpinc, and smsep fields of the raw data to create a dictionary for each lag. Each lag dictionary contains a field for it’s number, the pulses used to make the lag, the indices at which those pulses are located in ptab, and the sample bases.

Lag fields {‘number’,’pulses’,’pulse2_idx’,’pulse1_idx’,’sample_base1’,’sample_base2’} :param raw_data: a dictionary of raw data parameters :returns: list of lag dictionaries

backscatter.fitacf.fitacf.debug_output(range_list, raw_data)[source]
backscatter.fitacf.fitacf.eprint(*args, **kwargs)[source]
backscatter.fitacf.fitacf.fit(raw_records, tdiff: Optional[float] = None)[source]

Performs the whole fitting procedure for rawacf data

Calls the _fit procedure in a parallelized multiprocessing environment to speed up the procedure. The speed of this routine scales with number of cores.

Parameters:
  • raw_records – a list of raw data dictionaries

  • tdiff – Propagation time difference between arrays, in us.

Returns:

a list of dictionaries with fitted data

backscatter.fitacf.fitacf.main()[source]