adjtomo/pyatoa

manually edit misfit windows before adjoint source creation

Opened this issue · 0 comments

bch0w commented

Pyatoa currently does not allow the User to manually edit the automatically selected windows that come out of Pyflex, before they are used to calculate adjoint sources. However this can be a useful feature when you want to remove windows, isolate certain phases, or edit window start and end times.

Pyflex has option to write misfit windows to JSON files.

We can include the ability to read these files back in Pyatoa or Pyflex to be used for subsequent adjoint source creation. Workflow code this could look something like:

ds = ASDFDataSet("event.h5")
mgmt = Manager(ds=ds, config=cfg)
for station in stations:
    mgmt.gather(station_code=station)
    mgmt.standardize()
    mgmt.preprocess()
    mgmt.window(write="windows.json")

# >>> User manually edits the windows file here

for station in stations:
    mgmt.load(ds=ds, file="windows.json", station=station)
    mgmt.measure() 
    mgmt.plot()