Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bugs in relative_TT_residuals_plotter #215

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@ seismic/xcorqc/**/*.pbs
**/junk.*
**/LOG_CODE_DUPES_*.txt
**/LOG_LOCATION_DUPES_*.txt
/seismic/gps_corrections/p_combined.txt
11 changes: 5 additions & 6 deletions seismic/gps_corrections/relative_tt_residuals_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
else:
import pathlib # pylint: disable=import-error

from seismic.gps_corrections.picks_reader_utils import (read_picks_ensemble,
get_network_stations,
compute_matching_network_mask,
generate_large_events_catalog)
from picks_reader_utils import (read_picks_ensemble, get_network_stations, compute_matching_network_mask, generate_large_events_catalog)

# pylint: disable=invalid-name, fixme, too-many-locals, too-many-statements
# pylint: disable=attribute-defined-outside-init, logging-format-interpolation, logging-not-lazy
Expand Down Expand Up @@ -318,11 +315,13 @@ def _plot_network_relative_to_ref_station(df_plot, ref, target_stns, batch_optio
:type display_options: class DisplayOptions
"""
register_matplotlib_converters()
if df_plot is None:
return
df_plot = df_plot.assign(relTtResidual=(df_plot['ttResidual'] - df_plot['ttResidualRef']))

# Re-order columns
df_plot = df_plot[['#eventID', 'originTimestamp', 'mag', 'originLon', 'originLat', 'originDepthKm',
'net', 'sta', 'cha', 'pickTimestamp', 'phase', 'stationLon', 'stationLat',
'net', 'sta', 'cha', 'pickTimestamp', 'stationLon', 'stationLat',
'distance', 'snr', 'ttResidual', 'ttResidualRef', 'relTtResidual',
'qualityMeasureCWT', 'qualityMeasureSlope', 'nSigma']]

Expand Down Expand Up @@ -704,7 +703,7 @@ def main(picks_file, network1, networks2, stations1=None, stations2=None,
df_raw_picks = read_picks_ensemble(picks_file)
# Remove unused columns
df_raw_picks = df_raw_picks[['#eventID', 'originTimestamp', 'mag', 'originLon', 'originLat', 'originDepthKm',
'net', 'sta', 'cha', 'pickTimestamp', 'phase', 'stationLon', 'stationLat', 'az',
'net', 'sta', 'cha', 'pickTimestamp', 'stationLon', 'stationLat', 'az',
'baz', 'distance', 'ttResidual', 'snr', 'qualityMeasureCWT', 'qualityMeasureSlope',
'nSigma']]
log.debug("Number of raw picks: {}".format(len(df_raw_picks)))
Expand Down