Skip to content

Commit

Permalink
Fixed a small plotting bug and updated instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Jun 27, 2022
1 parent 659db4e commit 368cf46
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 5 deletions.
5 changes: 4 additions & 1 deletion seismic/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dependencies
The workflow requires MPI (mpi4py) and parallel HDF5 (h5py) capabilities on the NCI.
Installation instructions for NCI (Gadi ) are as follows:
Installation instructions for the NCI (Gadi), to be executed from a login node, are as follows:

### Load system modules:
1. `module purge`
Expand Down Expand Up @@ -119,6 +119,7 @@ mpirun -np 48 python extract_event_traces.py --waveform-database asdf_files.txt
--event-catalog-file OA_events.xml --event-trace-datafile OA_waveforms.h5
--network-list "OA" --p-data --s-data --sw-data > out.txt 2>&1
```
See [extract_waveforms.pbs](pbs/extract_waveforms.pbs) for a concrete example.
## Orientation Analysis

Station-orientation reports are generated by an MPI-parallel driving script:
Expand All @@ -128,3 +129,5 @@ based on (i) Receiver Functions and (ii) Surface-wave Polarization.
### Typical usage:
`mpirun -np 48 python bulk_station_orientations.py
OA_waveforms_X-Y.h5 'OA' --output-basename OA_orientations`

See [bulk_orientations.pbs](pbs/bulk_orientations.pbs) for a concrete example.
26 changes: 26 additions & 0 deletions seismic/pbs/bulk_orientations.pbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#PBS -P vy72
#PBS -N bulk_orientations
#PBS -q express
#PBS -l walltime=24:00:00,mem=192GB,ncpus=48,jobfs=50GB
#PBS -l storage=scratch/rxh562+gdata/ha3
#PBS -l wd
#PBS -j oe
#PBS -M rakib.hassan@ga.gov.au
#PBS -m bae

module purge
module load pbs
module load python3-as-python
module load openmpi/3.1.4
module load hdf5/1.10.5p
module load geos

export PATH=$HOME/.local/bin:$PATH
export PYTHONPATH=/g/data/ha3/rakib/seismic/pst/hiperseis/:$PYTHONPATH
export LC_ALL=en_AU.UTF-8
export LANG=en_AU.UTF-8

mpirun -np 48 python /g/data/ha3/rakib/seismic/pst/hiperseis/seismic/bulk_station_orientations.py /g/data/ha3/Passive/SHARED_DATA/DataQuality/Orientation/OA/OA_waveforms_20170911T000036-20210401T053646.h5 'OA' --output-basename /g/data/ha3/Passive/SHARED_DATA/DataQuality/Orientation/OA/OA_orientations


26 changes: 26 additions & 0 deletions seismic/pbs/extract_waveforms.pbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#PBS -P vy72
#PBS -N extract_waveforms
#PBS -q express
#PBS -l walltime=24:00:00,mem=192GB,ncpus=48,jobfs=50GB
#PBS -l storage=scratch/rxh562+gdata/ha3
#PBS -l wd
#PBS -j oe
#PBS -M rakib.hassan@ga.gov.au
#PBS -m bae

module purge
module load pbs
module load python3-as-python
module load openmpi/3.1.4
module load hdf5/1.10.5p
module load geos

export PATH=$HOME/.local/bin:$PATH
export PYTHONPATH=/g/data/ha3/rakib/seismic/pst/hiperseis/:$PYTHONPATH
export LC_ALL=en_AU.UTF-8
export LANG=en_AU.UTF-8

mpirun -np 48 python /g/data/ha3/rakib/seismic/pst/hiperseis/seismic/extract_event_traces.py --waveform-database /g/data/ha3/Passive/SHARED_DATA/Index/asdf_files.txt --event-catalog-file /g/data/ha3/rakib/seismic/pst/orientation/OA_events_20170911T000036-20210401T053646.xml --event-trace-datafile /g/data/ha3/Passive/SHARED_DATA/DataQuality/Orientation/OA/OA_waveforms.h5 --network-list "OA" --p-data --s-data --sw-data > /g/data/ha3/rakib/seismic/pst/orientation/out.txt 2>&1


8 changes: 4 additions & 4 deletions seismic/swp_station_orientations.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,9 @@ def analyze_station_orientations(ned, grv_dict, save_plots_path=None, ax=None):
plt.subplot(1, 1, 1)
plt.title('DLOPy results: ' + full_code, fontsize=16)
plt.plot([0, 1], [corr, corr], '-', linewidth=4, color=(0.8, 0.8, 0.8), zorder=5)
sc = plt.scatter(r1cc, centerat(r1phi, m=CEN), c=c, marker='o', cmap=cm.viridis, alpha=0.5, zorder=1,
sc = plt.scatter(r1cc, centerat(-r1phi, m=CEN), c=c, marker='o', cmap=cm.viridis, alpha=0.5, zorder=1,
label='R1')
plt.scatter(r2cc, centerat(r2phi, m=CEN), c=c, marker='^', cmap=cm.viridis, alpha=0.5, zorder=1,
plt.scatter(r2cc, centerat(-r2phi, m=CEN), c=c, marker='^', cmap=cm.viridis, alpha=0.5, zorder=1,
label='R2')
plt.text(0.5, corr, 'Mean: {0:.3f} deg'.format(corr), fontsize=14, zorder=10)
cbar = plt.colorbar(sc)
Expand All @@ -720,9 +720,9 @@ def analyze_station_orientations(ned, grv_dict, save_plots_path=None, ax=None):
elif(ax is not None):
fig = ax.get_figure()
ax.plot([0, 1], [corr, corr], '-', linewidth=4, color=(0.8, 0.8, 0.8), zorder=5)
sc = ax.scatter(r1cc, centerat(r1phi, m=CEN), c=c, marker='o', cmap=cm.viridis, alpha=0.5, zorder=1,
sc = ax.scatter(r1cc, centerat(-r1phi, m=CEN), c=c, marker='o', cmap=cm.viridis, alpha=0.5, zorder=1,
label='R1')
ax.scatter(r2cc, centerat(r2phi, m=CEN), c=c, marker='^', cmap=cm.viridis, alpha=0.5, zorder=1,
ax.scatter(r2cc, centerat(-r2phi, m=CEN), c=c, marker='^', cmap=cm.viridis, alpha=0.5, zorder=1,
label='R2')
ax.text(0.5, corr, 'Mean: {0:.3f} deg'.format(corr), fontsize=14, zorder=10)

Expand Down

0 comments on commit 368cf46

Please sign in to comment.