pyatoa.utils.asdf.load
Functions for extracting information from a Pyasdf ASDFDataSet object
Module Contents
Functions
|
Returns misfit windows from an ASDFDataSet for a given iteration, step, |
|
Load adjoint sources from a pyasdf ASDFDataSet and return in the format |
|
Convert the parameter dictionary of an ASDFDataSet MisfitWindow into a |
|
Given an iteration and step count, find windows from the previous step |
- pyatoa.utils.asdf.load.load_windows(ds, net, sta, iteration, step_count, return_previous=False)[source]
Returns misfit windows from an ASDFDataSet for a given iteration, step, network and station, as well as a count of windows returned.
If given iteration and step are not present in dataset (e.g. during line search, new step), will try to search the previous step, which may or may not be contained in the previous iteration.
Returns windows as Pyflex Window objects which can be used in Pyadjoint or in the Pyatoa workflow.
Note
Expects that windows are saved into the dataset at each iteration and step such that there is a coherent structure within the dataset
- Parameters:
ds (pyasdf.ASDFDataSet) – ASDF dataset containing MisfitWindows subgroup
net (str) – network code used to find the name of the misfit window
sta (str) – station code used to find the name of the misfit window
iteration (int or str) – current iteration, will be formatted by the function
step_count (int or str) – step count, will be formatted by the function
return_previous (bool) – search the dataset for available windows from the previous iteration/step given the current iteration/step
- Rtype window_dict:
dict
- Return window_dict:
dictionary containing misfit windows, in a format expected by Pyatoa Manager class
- pyatoa.utils.asdf.load.load_adjsrcs(ds, net, sta, iteration, step_count)[source]
Load adjoint sources from a pyasdf ASDFDataSet and return in the format expected by the Manager class, that is a dictionary of adjoint sources
- Parameters:
ds (pyasdf.ASDFDataSet) – ASDF dataset containing MisfitWindows subgroup
net (str) – network code used to find the name of the adjoint source
sta (str) – station code used to find the name of the adjoint source
iteration (int or str) – current iteration, will be formatted by the function
step_count (int or str) – step count, will be formatted by the function
- Return type:
- Returns:
dictionary containing adjoint sources, in a format expected by Pyatoa Manager class
- pyatoa.utils.asdf.load.dataset_windows_to_pyflex_windows(windows, network, station)[source]
Convert the parameter dictionary of an ASDFDataSet MisfitWindow into a dictionary of Pyflex Window objects, in the same format as Manager.windows
Returns empty dict and 0 if no windows are found
- Parameters:
- Return type:
- Returns:
dictionary of window attributes in the same format that Pyflex outputs
- pyatoa.utils.asdf.load.previous_windows(windows, iteration, step_count)[source]
Given an iteration and step count, find windows from the previous step count. If none are found for the given iteration, return the most recently available windows.
Note
Assumes that windows are saved at each iteration.