Skip to content

zjzzqs/Pycwb2sac

 
 

Repository files navigation

Pycwb2sac

Pycwb2sac is a python version of Cwb2sac which convers CWB .D files to either SAC or Obspy Stream format
Written by Lindsay Chuang @ June 24, 2019
Please contact author by kanglianan@gmail.com if there is any question

To run this program, please make sure you have these packages installed:

  1. Python 3
  2. Obspy

Before execute the code, please

Modify the first line of Pycwb2sac.py and change it to where your python path is. i.e.

Change it from
#!/Users/anaconda/envs/obspy/bin/python
to
#!/Linda/anaconda/envs/obspy/bin/python

Run the script and input three or four(optional) parameters in this order:

Pycwb2sac <NSTA.DAT> <output_format SAC:0, Obspy:1> <Pfile(optional)>

$ ./Pycwb2sac.py 13010557.d05 NSTA.DAT 0 13010557.p05

Note:
(1) NSTA.DAT in here is a fixed version from the original one.
(2) Pfile is optional. If given, the earthquke and station information will be wrote to headers
(3) All the data files in .D file will be converted regardless if the station is listed in .P file.

Converting Obspy .pk file to SAC file

To further convert .pk file to individual SAC files, please run the script Obspy2SAC.py

$ ./Obspy2SAC.py 1991-01-01T01:19:46.930000Z_1991-01-01T01:26:02.760000Z.pk

About

A python version of Cwb2sac

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%