pypaw package¶
Submodules¶
pypaw.adjoint module¶
Class that calculate adjoint source using asdf
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- class pypaw.adjoint.AdjointASDF(path, param, verbose=False)[source]¶
Bases: pypaw.procbase.ProcASDFBase
Adjoint Source ASDF
- pypaw.adjoint.adjoint_wrapper(obsd_station_group, synt_station_group, config=None, obsd_tag=None, synt_tag=None, windows=None, event=None, adj_src_type='multitaper_misfit', interp_delta=None, interp_npts=None, figure_mode=False, figure_dir=False, adjoint_src_flag=True)[source]¶
Function wrapper for pyasdf.
Parameters: - obsd_station_group – observed station group, which contains seismogram(stream) and station information(inventory)
- synt_station_group – synthetic station group. Same as obsd_station_group
- config (pyadjoint.Config) – config object for adjoint source
- obsd_tag (str) – observed seismogram tag, used for extracting the seismogram in observed asdf file
- synt_tag (str) – synthetic seismogram tag, used for extracting the seismogram in synthetic asdf file
- windows (list) – windows for this station group. Two dimension list. The first dimension is different channels, the second dimension is windows for this channel, like [[chan1_win1, chan1_win2], [chan2_win1,], ...]
- event (obspy.Inventory) – event information
- adj_src_type (st) – adjoint source type, currently support: 1) “cc_traveltime_misfit” 2) “multitaper_misfit” 3) “waveform_misfit”
- adjoint_src_flag (bool) – calcualte adjoint source, put this to true. If false, only make measurements but no adjoint sources.
- figure_mode (bool) – plot figures for adjoint source or not
- figure_dir (str) – output figure directory
Returns: adjoint sources for pyasdf write out(reshaped)
pypaw.adjoint_prepro module¶
- Class that handles the whole preprocessing workflow, including:
- signal processing
- window selection
- adjoint sources
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- class pypaw.adjoint_prepro.AdjPreASDF(path, param, components=['Z', 'R', 'T'], verbose=False)[source]¶
Bases: pypaw.procbase.ProcASDFBase
- pypaw.adjoint_prepro.func_wrapper(obsd_station_group, synt_station_group, obsd_tag=None, synt_tag=None, event=None, param=None, _verbose=False, figure_mode=False, figure_dir=None)[source]¶
combo function, including: 1) observed data signal processing 2) synthetic data signal processing 3) window selection based on a pair of data 4) adjoint source constructor
pypaw.adjoint_util module¶
Methods that contains utils for adjoint sources
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- pypaw.adjoint_util.calculate_chan_weight(adjsrcs, windows_sta)[source]¶
Calcualte window weights based on adjoint sources and windows
Parameters: - adjsrcs –
- windows_sta –
Returns:
- pypaw.adjoint_util.ensemble_fake_adj(stream, time_offset=0.0)[source]¶
Ensemble fake adjoint sources from stream, for test purpose
pypaw.convert module¶
Methods that contains utils for adjoint sources
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- class pypaw.convert.ConvertASDF(path, verbose=False, status_bar=False)[source]¶
Bases: object
pypaw.procbase module¶
Parent class for general asdf processing. Wraps things like MPI and parallel I/O so they are invisible to users.
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- class pypaw.procbase.ProcASDFBase(path, param, verbose=False)[source]¶
Bases: object
- check_output_file(filename, remove_flag=True)[source]¶
Check existance of output file. If directory of output file not exists, raise ValueError; If output file exists, remove it
pypaw.process module¶
Parent class for singal processing asdf file and handles parallel I/O so they are invisible to users.
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- class pypaw.process.ProcASDF(path, param, verbose=False)[source]¶
Bases: pypaw.procbase.ProcASDFBase
pypaw.utils module¶
Parent class for singal processing asdf file and handles parallel I/O so they are invisible to users.
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- pypaw.utils.drawProgressBar(percent, user_text='', barLen=20)[source]¶
Draw status progress bars in terminal. Not recommendded used for job scripts(will create thousands of lines of output)
- pypaw.utils.isclose(a, b, rel_tol=1e-09, abs_tol=0.0)[source]¶
Compare two numbers see if they are close to each other to a tolerance level
- pypaw.utils.smart_read_json(json_file, mpi_mode=True, comm=None, object_hook=False)[source]¶
read json file under mpi and multi-processing environment. Hook it to an JSONObject(not the conventional way to read it as object)
pypaw.window module¶
Class for window selection on asdf file and handles parallel I/O so they are invisible to users.
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
- class pypaw.window.WindowASDF(path, param, components=['Z', 'R', 'T'], verbose=False)[source]¶
Bases: pypaw.procbase.ProcASDFBase
pypaw.write_window module¶
Methods for write out windows
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |
Module contents¶
copyright: | Wenjie Lei (lei@princeton.edu), 2016 |
---|---|
license: | GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) |