pyatoa.utils.asdf.clean

Convenience functions for removing data from Pyasdf ASDFDataSet objects. All functions work with the dataset as an input and act in-place on the dataset so no returns

Module Contents

Functions

clean_dataset(ds[, iteration, step_count, fix_windows])

Removes synthetic waveforms and auxiliary data so that only observation

del_synthetic_waveforms(ds[, iteration, step_count])

Remove "synthetic_{iter_tag}{step_tag}" tagged waveforms from an asdf

del_auxiliary_data(ds[, iteration, step_count, ...])

Delete all items in auxiliary data for a given iter_tag, if iter_tag not

pyatoa.utils.asdf.clean.clean_dataset(ds, iteration=None, step_count=None, fix_windows=False)[source]

Removes synthetic waveforms and auxiliary data so that only observation data remains for new iterations. If no iteration is given, will wipe all non-observation data and all auxiliary data

Parameters:
  • ds (pyasdf.ASDFDataSet) – dataset to be cleaned

  • fix_windows (bool) – don’t delete MisfitWindows

  • iteration – iteration number, e.g. “i01”. Will be formatted so int ok.

  • step_count (str or int) – step count e.g. “s00”. Will be formatted so int ok.

pyatoa.utils.asdf.clean.del_synthetic_waveforms(ds, iteration=None, step_count=None)[source]

Remove “synthetic_{iter_tag}{step_tag}” tagged waveforms from an asdf dataset. If no iter_tag number given, wipes all synthetic data from dataset.

Parameters:
  • ds (pyasdf.ASDFDataSet) – dataset to be cleaned

  • iteration – iteration number, e.g. “i01”. Will be formatted so int ok.

  • step_count (str or int) – step count e.g. “s00”. Will be formatted so int ok.

pyatoa.utils.asdf.clean.del_auxiliary_data(ds, iteration=None, step_count=None, retain=None, only=None)[source]

Delete all items in auxiliary data for a given iter_tag, if iter_tag not given, wipes all auxiliary data.

Parameters:
  • ds (pyasdf.ASDFDataSet) – dataset to be cleaned

  • iteration – iteration number, e.g. “i01”. Will be formatted so int ok.

  • step_count (str or int) – step count e.g. “s00”. Will be formatted so int ok.

  • retain (list of str) – list of auxiliary data tags to retain, that is: delete all auxiliary data EXCEPT FOR the names given in this variable

  • only (list of str) – list of auxiliary data tags to remove, that is: ONLY delete auxiliary data that matches the names given in this variable. Lower in priority than ‘retain’