pyadjoint.config

Configuration object for Pyadjoint.

To add new adjoint sources, you will need to add a name, function and config to ADJSRC_TYPES, get_config and get_function, respectively.

authors

adjTomo Dev Team (adjtomo@gmail.com), 2022 Youyi Ruan (youyir@princeton.edu), 2016 Lion Krischer (krischer@geophysik.uni-muenchen.de), 2016

license

GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html)

Module Contents

Classes

ConfigWaveform

Waveform misfit function required parameters

ConfigExponentiatedPhase

Exponentiated Phase misfit function required parameters

ConfigCCTraveltime

Cross-correlation Traveltime misfit function required parameters

ConfigMultitaper

Multitaper misfit function required parameters

Functions

get_config(adjsrc_type, min_period, max_period, **kwargs)

Defines two common parameters for all configuration objects and then

get_function(adjsrc_type)

Wrapper for getting the correct adjoint source function based on the

Attributes

pyadjoint.config.ADJSRC_TYPES = ['waveform', 'convolution', 'exponentiated_phase', 'cc_traveltime', 'multitaper', 'waveform_dd',...[source]
pyadjoint.config.get_config(adjsrc_type, min_period, max_period, **kwargs)[source]

Defines two common parameters for all configuration objects and then reassigns self to a sub Config class which dictates its own required parameters

pyadjoint.config.get_function(adjsrc_type)[source]

Wrapper for getting the correct adjoint source function based on the adjsrc_type. Many adjoint sources share functions with different flags so this function takes care of the logic of choosing which.

Parameters

adjsrc_type (str) – choice of adjoint source

Return type

function

Returns

calculate_adjoint_source function for the correct adjoint source type

class pyadjoint.config.ConfigWaveform(min_period, max_period, taper_type='hann', taper_percentage=0.3, double_difference=False)[source]

Waveform misfit function required parameters

Parameters
  • min_period (float) – Minimum period of the filtered input data in seconds.

  • max_period (float) – Maximum period of the filtered input data in seconds.

  • taper_percentage (float) – Percentage of a time window needs to be tapered at two ends, to remove the non-zero values for adjoint source and for fft.

  • taper_type (str) – taper type, see pyadjoint.utils.signal.TAPER_COLLECTION list for available taper types

  • double_difference (bool) – flag to turn on double difference measurements, which signals to the main calc function whether additional waveforms are required at input

class pyadjoint.config.ConfigExponentiatedPhase(min_period, max_period, taper_type='hann', taper_percentage=0.3, wtr_env=0.2, double_difference=False)[source]

Exponentiated Phase misfit function required parameters

Parameters
  • min_period (float) – Minimum period of the filtered input data in seconds.

  • max_period (float) – Maximum period of the filtered input data in seconds.

  • taper_percentage (float) – Percentage of a time window needs to be tapered at two ends, to remove the non-zero values for adjoint source and for fft.

  • taper_type (str) – taper type, see pyadjoint.utils.signal.TAPER_COLLECTION list for available taper types

  • wtr_env – float

  • wtr_env – window taper envelope amplitude scaling

  • double_difference (bool) – flag to turn on double difference measurements, which signals to the main calc function whether additional waveforms are required at input

class pyadjoint.config.ConfigCCTraveltime(min_period, max_period, taper_type='hann', taper_percentage=0.3, measure_type='dt', use_cc_error=True, dt_sigma_min=1.0, dlna_sigma_min=0.5, double_difference=False)[source]

Cross-correlation Traveltime misfit function required parameters

Parameters
  • min_period (float) – Minimum period of the filtered input data in seconds.

  • max_period (float) – Maximum period of the filtered input data in seconds.

  • taper_percentage (float) – Percentage of a time window needs to be tapered at two ends, to remove the non-zero values for adjoint source and for fft.

  • taper_type (str) – taper type, see pyadjoint.utils.signal.TAPER_COLLECTION list for available taper types

  • measure_type – measurement type used in calculation of misfit, dt(travel time), am(dlnA), wf(full waveform)

  • measure_type – string

  • use_cc_error (bool) – use cross correlation errors for normalization

  • dt_sigma_min (float) – minimum travel time error allowed

  • dlna_sigma_min (float) – minimum amplitude error allowed

  • double_difference (bool) – flag to turn on double difference measurements, which signals to the main calc function whether additional waveforms are required at input

class pyadjoint.config.ConfigMultitaper(min_period, max_period, lnpt=15, transfunc_waterlevel=1e-10, water_threshold=0.02, ipower_costaper=10, min_cycle_in_window=0.5, taper_type='hann', taper_percentage=0.3, mt_nw=4.0, num_taper=5, dt_fac=2.0, phase_step=1.5, err_fac=2.5, dt_max_scale=3.5, measure_type='dt', dt_sigma_min=1.0, dlna_sigma_min=0.5, use_cc_error=True, use_mt_error=False, double_difference=False)[source]

Multitaper misfit function required parameters

Parameters
  • min_period (float) – Minimum period of the filtered input data in seconds.

  • max_period (float) – Maximum period of the filtered input data in seconds.

  • taper_percentage (float) – Percentage of a time window needs to be tapered at two ends, to remove the non-zero values for adjoint source and for fft.

  • taper_type (str) – taper type, see pyadjoint.utils.signal.TAPER_COLLECTION list for available taper types

  • measure_type (str) – measurement type used in calculation of misfit, dt(travel time), am(dlnA), wf(full waveform)

  • use_cc_error (bool) – use cross correlation errors for normalization

  • use_mt_error (bool) – use multi-taper error for normalization

  • dt_sigma_min (float) – minimum travel time error allowed

  • dlna_sigma_min (float) – minimum amplitude error allowed

  • lnpt (int) – power index to determine the time length use in FFT (2^lnpt)

  • transfunc_waterlevel (float) – Water level on the transfer function between data and synthetic.

  • water_threshold (float) – the triggering value to stop the search. If the spectra is larger than 10*water_threshold it will trigger the search again, works like the heating thermostat.

  • ipower_costaper (int) – order of cosine taper, higher the value, steeper the shoulders.

  • min_cycle_in_window (int) – Minimum cycle of a wave in time window to determin the maximum period can be reliably measured.

  • mt_nw (float) – bin width of multitapers (nw*df is the half bandwidth of multitapers in frequency domain, typical values are 2.5, 3., 3.5, 4.0)

  • num_taper (int) – number of eigen tapers (2*nw - 3 gives tapers with eigen values larger than 0.96)

  • dt_fac (float) – percentage of wave period at which measurement range is too large and MTM reverts to CCTM misfit

  • err_fac (float) – percentange of error at which error is too large

  • dt_max_scale (float) – used to calculate maximum allowable time shift

  • phase_step (float) – maximum step for cycle skip correction (?)

  • double_difference (bool) – flag to turn on double difference measurements, which signals to the main calc function whether additional waveforms are required at input