pyatoa.utils.asdf.add

ASDF Datasets can be given auxiliary data to supplement the existing waveform, event and station information contained. The functions contained in this script add new auxiliary data structures to existing ASDF datasets

Module Contents

Functions

add_misfit_windows(windows, ds, path)

Write Pyflex misfit windows into the auxiliary data of an ASDFDataSet

add_adjoint_sources(adjsrcs, ds, path, time_offset)

Writes the adjoint source to an ASDF file.

pyatoa.utils.asdf.add.add_misfit_windows(windows, ds, path)[source]

Write Pyflex misfit windows into the auxiliary data of an ASDFDataSet

Parameters:
  • windows (dict of list of pyflex.Window) – dictionary of lists of window objects with keys corresponding to components related to each window

  • ds (pyasdf.ASDFDataSet) – ASDF data set to save windows to

  • path (str) – internal pathing to save location of auxiliary data

pyatoa.utils.asdf.add.add_adjoint_sources(adjsrcs, ds, path, time_offset)[source]

Writes the adjoint source to an ASDF file.

Warning

It is inherently assumed SPECFEM will be using the adjoint source

Note

Modified from Pyadjoint source code: pyadjoint.adjoint_source.write_to_asdf()

Note

SPECFEM requires one additional parameter: the temporal offset of the first sample in seconds. This will have been set by the parameter USER_T0 in the constants.h.in file of SPECFEM’s setup directory

Parameters:
  • adjsrcs (list of pyadjoint.asdf_data_set.ASDFDataSet) – adjoint source to save

  • path (str) – internal pathing for save location in the auxiliary data attr.

  • ds (pyasdf.ASDFDataSet) – The ASDF data structure read in using pyasdf.

  • time_offset (float) – The temporal offset of the first sample in seconds. This is required if using the adjoint source as input to SPECFEM.