Getting Started#

Welcome to the NoisePy Colab Tutorial!

This tutorial will walk you through the basic steps of using NoisePy to compute ambient noise cross correlation functions.

First, we install the noisepy-seis package

# Uncomment and run this line if the environment doesn't have noisepy already installed:
# ! pip install noisepy-seis 

Warning: NoisePy uses obspy as a core Python module to manipulate seismic data. Restart the runtime now for proper installation of obspy on Colab.

Then we import the basic modules

from noisepy.seis import download, cross_correlate, stack_cross_correlations, __version__
from noisepy.seis.io import plotting_modules
from noisepy.seis.io.asdfstore import ASDFRawDataStore, ASDFCCStore, ASDFStackStore
from noisepy.seis.io.datatypes import CCMethod, ConfigParameters, FreqNorm, RmResp, TimeNorm
from datetime import datetime, timezone
from datetimerange import DateTimeRange
import os
import shutil
print(f"Using NoisePy version {__version__}")

path = os.path.join(".", "get_started_data")

os.makedirs(path,exist_ok=True)
raw_data_path = os.path.join(path, "RAW_DATA")
cc_data_path = os.path.join(path, "CCF")
stack_data_path = os.path.join(path, "STACK")
/opt/hostedtoolcache/Python/3.10.19/x64/lib/python3.10/site-packages/noisepy/seis/io/utils.py:13: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)
  from tqdm.autonotebook import tqdm
Using NoisePy version 0.1.dev1

Ambient Noise Project Configuration#

We store the metadata information about the ambient noise cross correlation workflow in a ConfigParameters() object. We first initialize it, then we tune the parameters for this cross correlation.

config = ConfigParameters() # default config parameters which can be customized
config.inc_hours = 12
config.sampling_rate = 20  # (int) Sampling rate in Hz of desired processing (it can be different than the data sampling rate)
config.cc_len = 3600  # (float) basic unit of data length for fft (sec)
    # criteria for data selection
config.ncomp = 3  # 1 or 3 component data (needed to decide whether do rotation)

config.acorr_only = False  # only perform auto-correlation or not
config.xcorr_only = True  # only perform cross-correlation or not

config.inc_hours = 12 # if the data is first 

config.lamin = 31       # min latitude
config.lamax = 42       # max latitude
config.lomin = -124     # min longitude
config.lomax = -115     # max longitude

# pre-processing parameters
config.step = 1800.0  # (float) overlapping between each cc_len (sec)
config.stationxml = False  # station.XML file used to remove instrument response for SAC/miniseed data
config.rm_resp = RmResp.INV  # select 'no' to not remove response and use 'inv' if you use the stationXML,'spectrum',
config.freqmin = 0.05
config.freqmax = 2.0
config.max_over_std  = 10  # threshold to remove window of bad signals: set it to 10*9 if prefer not to remove them

# TEMPORAL and SPECTRAL NORMALISATION
config.freq_norm = FreqNorm.RMA # choose between "rma" for a soft whitenning or "no" for no whitening. Pure whitening is not implemented correctly at this point.
config.smoothspect_N = 10  # moving window length to smooth spectrum amplitude (points)
    # here, choose smoothspect_N for the case of a strict whitening (e.g., phase_only)

config.time_norm = TimeNorm.NO  # 'no' for no normalization, or 'rma', 'one_bit' for normalization in time domain,
    # TODO: change time_norm option from "no" to "None"
config.smooth_N = 10  # moving window length for time domain normalization if selected (points)

config.cc_method = CCMethod.XCORR # 'xcorr' for pure cross correlation OR 'deconv' for deconvolution;
    # FOR "COHERENCY" PLEASE set freq_norm to "rma", time_norm to "no" and cc_method to "xcorr"

# OUTPUTS:
config.substack = True  # True = smaller stacks within the time chunk. False: it will stack over inc_hours
config.substack_windows = 1  # how long to stack over (for monitoring purpose)
    # if substack=True, substack_windows=2, then you pre-stack every 2 correlation windows.
    # for instance: substack=True, substack_windows=1 means that you keep ALL of the correlations

config.maxlag = 200  # lags of cross-correlation to save (sec)
config.substack = True

Step 0: download data#

This step will download data using obspy and save them into ASDF files locally. The data will be stored for each time chunk defined in hours by inc_hours.

The download will clean up the raw data by detrending, removing the mean, bandpassing (broadly), removing the instrumental response, merging gaps, ignoring too-gappy data.

Use the function download with the following arguments:

  • path:where to put the data

  • config: configuration settings, in particular:

    • channel: list of the seismic channels to download, and example is shown below

    • stations: list of the seismic stations, it can be “*” (not “all”)

    • start_time

    • end_time

  • client_url_key: the string for FDSN clients

config.networks = ["*"]
config.stations = ["A*"]
config.channels = ["BH?"]
config.start_date = datetime(2019, 2, 1, tzinfo=timezone.utc)
config.end_date = datetime(2019, 2, 2, tzinfo=timezone.utc)
timerange = DateTimeRange(config.start_date, config.end_date)

# Download data locally. Enters raw data path, channel types, stations, config, and fdsn server.
download(raw_data_path, config)
2025-12-02 21:20:37,974 139988402854784 INFO fdsn_download.download(): Download
        From: 2019-02-01T00:00:00.000000Z
        To: 2019-02-02T00:00:00.000000Z
        Networks: ['*']
        Stations: ['A*']
        Channels: ['BH?']
        
2025-12-02 21:20:39,332 139988402854784 INFO fdsn_download.download(): Fetched inventory
2025-12-02 21:20:39,333 139988402854784 INFO utils.log_raw(): TIMING:  1.359 secs for Getting inventory
2025-12-02 21:20:39,647 139986456274624 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T00%3A00%3A00.000000&endtime=2019-02-01T12%3A00%3A00.000000&network=CI&station=ALP&location=%2A&channel=BHZ
Request Submitted:
2025/12/02 21:20:39 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ALP.BHZ)
2025-12-02 21:20:39,649 139986761344704 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T00%3A00%3A00.000000&endtime=2019-02-01T12%3A00%3A00.000000&network=CI&station=ADO&location=%2A&channel=BHZ
Request Submitted:
2025/12/02 21:20:39 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ADO.BHZ)
2025-12-02 21:20:39,649 139986473055936 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T00%3A00%3A00.000000&endtime=2019-02-01T12%3A00%3A00.000000&network=CI&station=ALP&location=%2A&channel=BHN
Request Submitted:
2025/12/02 21:20:39 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ALP.BHN)
2025-12-02 21:20:39,651 139986744563392 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T00%3A00%3A00.000000&endtime=2019-02-01T12%3A00%3A00.000000&network=CI&station=ALP&location=%2A&channel=BHE
Request Submitted:
2025/12/02 21:20:39 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ALP.BHE)
2025-12-02 21:20:39,893 139986456274624 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T00%3A00%3A00.000000&endtime=2019-02-01T12%3A00%3A00.000000&network=CI&station=ALP&location=%2A&channel=BHZ
Request Submitted:
2025/12/02 21:20:39 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ALP.BHZ)
2025-12-02 21:20:41,109 139986439493312 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:41,112 139986271729344 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:41,378 139986696316608 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:41,435 139986713097920 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:41,508 139986744563392 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:41,517 139986473055936 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:41,573 139986761344704 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:41,697 139986456274624 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:43,504 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:43,825 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:44,007 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:44,126 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:44,245 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:44,364 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:44,519 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:44,746 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:44,890 139986439493312 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:45,052 139986271729344 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:45,128 139986696316608 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:45,130 139986713097920 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T11:59:59.950000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:46,196 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:46,338 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:46,453 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:46,568 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:46,987 139986439493312 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T12%3A00%3A00.000000&endtime=2019-02-02T00%3A00%3A00.000000&network=CI&station=ALP&location=%2A&channel=BHN
Request Submitted:
2025/12/02 21:20:46 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ALP.BHN)
2025-12-02 21:20:46,991 139986696316608 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T12%3A00%3A00.000000&endtime=2019-02-02T00%3A00%3A00.000000&network=CI&station=ARV&location=%2A&channel=BHN
Request Submitted:
2025/12/02 21:20:46 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ARV.BHN)
2025-12-02 21:20:47,252 139986439493312 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T12%3A00%3A00.000000&endtime=2019-02-02T00%3A00%3A00.000000&network=CI&station=ALP&location=%2A&channel=BHN
Request Submitted:
2025/12/02 21:20:47 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ALP.BHN)
2025-12-02 21:20:47,262 139986696316608 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T12%3A00%3A00.000000&endtime=2019-02-02T00%3A00%3A00.000000&network=CI&station=ARV&location=%2A&channel=BHN
Request Submitted:
2025/12/02 21:20:47 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ARV.BHN)
2025-12-02 21:20:47,504 139986696316608 WARNING fdsn_download.download_stream(): <class 'obspy.clients.fdsn.header.FDSNInternalServerException'>/Service responds: Internal server error
HTTP Status code: 500
Detailed response of server:

500
Error 500: STP clients exceeded. Please try again later OR download data from the SCEDC public data set hosted on the cloud (AWS). For details, please see https://scedc.caltech.edu/cloud/ 
More Details:
handler exited, code: 1  reason: Internal Server Error
Request:
http://service.scedc.caltech.edu/fdsnws/dataselect/1/query?starttime=2019-02-01T12%3A00%3A00.000000&endtime=2019-02-02T00%3A00%3A00.000000&network=CI&station=ARV&location=%2A&channel=BHN
Request Submitted:
2025/12/02 21:20:47 UTC
Service version:
Service: fdsnws-dataselect  version: 1.1.0 for get_waveforms(ARV.BHN)
2025-12-02 21:20:48,765 139986456274624 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHE | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:48,968 139986713097920 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHE | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:49,244 139986271729344 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHZ | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:49,307 139986744563392 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHN | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:49,348 139986473055936 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHE | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:49,424 139986761344704 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHZ | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:49,529 139986696316608 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHN | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:49,541 139986439493312 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHN | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:51,148 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:51,473 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:51,742 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:51,896 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:52,013 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:52,150 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:52,278 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:52,418 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:52,446 139986744563392 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHZ | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:53,022 139986456274624 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHE | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:53,092 139986713097920 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHN | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:53,146 139986271729344 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHZ | 2019-02-01T11:59:59.950000Z - 2019-02-01T23:59:59.900000Z | 20.0 Hz, 864000 samples using inv
2025-12-02 21:20:53,831 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:54,178 139988402854784 INFO fdsn_download.download(): Downloaded BHE/bhe_00
2025-12-02 21:20:54,325 139988402854784 INFO fdsn_download.download(): Downloaded BHN/bhn_00
2025-12-02 21:20:54,443 139988402854784 INFO fdsn_download.download(): Downloaded BHZ/bhz_00
2025-12-02 21:20:54,558 139988402854784 INFO utils.log_raw(): TIMING: 16.584 secs for Total Download

List the files that were downloaded, just to make sure !

print(os.listdir(raw_data_path))
['2019_02_01_00_00_00T2019_02_01_12_00_00.h5', 'station.csv', '2019_02_01_12_00_00T2019_02_02_00_00_00.h5']

Plot the raw data, make sure it’s noise!

file = os.path.join(raw_data_path, "2019_02_01_00_00_00T2019_02_01_12_00_00.h5")
raw_store = ASDFRawDataStore(raw_data_path) # Store for reading raw data
timespans = raw_store.get_timespans()
plotting_modules.plot_waveform(raw_store, timespans[0], 'CI','ADO', 0.01, 0.4) # this function takes for input: filename, network, station, freqmin, freqmax for a bandpass filter
_images/7c27fce69d2dab79a6ec8300578bf0f82e4b3e80173b38d5f1cc8e8276db3aee.png

Step 1: Cross-correlation#

This step will perform the cross correlation. For each time chunk, it will read the data, perform classic ambient noise pre-processing (time and frequency normalization), FFT, cross correlation, substacking, saving cross correlations in to a temp ASDF file (this is not fast and will be improved).

# For this tutorial make sure the previous run is empty
if os.path.exists(cc_data_path):
    shutil.rmtree(cc_data_path)
config.freq_norm = FreqNorm.RMA
cc_store = ASDFCCStore(cc_data_path) # Store for writing CC data

# print the configuration parameters. Some are chosen by default but we cab modify them
print(config)
client_url_key='SCEDC' start_date=datetime.datetime(2019, 2, 1, 0, 0, tzinfo=datetime.timezone.utc) end_date=datetime.datetime(2019, 2, 2, 0, 0, tzinfo=datetime.timezone.utc) sampling_rate=20 single_freq=True cc_len=3600 lamin=31 lamax=42 lomin=-124 lomax=-115 down_list=False networks=['*'] stations=['A*'] channels=['BH?'] step=1800.0 freqmin=0.05 freqmax=2.0 freq_norm=<FreqNorm.RMA: 'rma'> time_norm=<TimeNorm.NO: 'no'> cc_method=<CCMethod.XCORR: 'xcorr'> smooth_N=10 smoothspect_N=10 substack=True substack_windows=1 maxlag=200 inc_hours=12 max_over_std=10 ncomp=3 stationxml=False rm_resp=<RmResp.INV: 'inv'> rm_resp_out='VEL' respdir=None acorr_only=False xcorr_only=True stack_method=<StackMethod.LINEAR: 'linear'> keep_substack=False rotation=True correction=False correction_csv=None storage_options=defaultdict(<class 'dict'>, {})

Perform the cross correlation

cross_correlate(raw_store, config, cc_store)
2025-12-02 21:20:55,550 139988402854784 INFO correlate.cross_correlate(): Starting Cross-Correlation with 4 cores
2025-12-02 21:20:55,581 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.029 secs for get 12 channels
2025-12-02 21:20:55,582 139988402854784 INFO correlate.cc_timespan(): Checking for stations already done: 10 pairs
2025-12-02 21:20:55,584 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.002 secs for check for 4 stations already done (warm up cache)
2025-12-02 21:20:55,586 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.002 secs for check for stations already done
2025-12-02 21:20:55,586 139988402854784 INFO correlate.cc_timespan(): Still need to process: 4/4 stations, 12/12 channels, 10/10 pairs for 2019-02-01T00:00:00+0000 - 2019-02-01T12:00:00+0000
2025-12-02 21:20:55,876 139988402854784 INFO correlate._filter_channel_data(): Picked 20.0 as the closest sampling_rate to 20.0. 
2025-12-02 21:20:55,877 139988402854784 INFO correlate._filter_channel_data(): Filtered to 12/12 channels with sampling rate == 20.0
2025-12-02 21:20:55,878 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.292 secs for Read channel data: 12 channels
2025-12-02 21:20:56,153 139985975629504 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:56,206 139986692994752 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:56,276 139986473055936 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:56,282 139986009192128 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:56,287 139986439493312 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:56,291 139986709776064 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:56,292 139985992410816 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:56,293 139986456274624 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:58,670 139985975629504 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:59,075 139986473055936 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHE | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:59,174 139986692994752 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHN | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:20:59,193 139986456274624 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHZ | 2019-02-01T00:00:00.000000Z - 2019-02-01T12:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:00,515 139988402854784 INFO utils.log_raw(): TIMING CC Main:  4.638 secs for Preprocess: 12 channels
2025-12-02 21:21:00,516 139988402854784 INFO correlate.check_memory(): Require  0.07gb memory for cross correlations
2025-12-02 21:21:01,128 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.611 secs for Compute FFTs: 12 channels
2025-12-02 21:21:01,129 139988402854784 INFO correlate.cc_timespan(): Starting CC with 10 station pairs
2025-12-02 21:21:02,813 139988402854784 INFO utils.log_raw(): TIMING CC Main:  1.684 secs for Correlate and write to store
2025-12-02 21:21:02,918 139988402854784 INFO utils.log_raw(): TIMING CC Main:  7.366 secs for Process the chunk of 2019-02-01T00:00:00+0000 - 2019-02-01T12:00:00+0000
2025-12-02 21:21:02,950 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.026 secs for get 12 channels
2025-12-02 21:21:02,951 139988402854784 INFO correlate.cc_timespan(): Checking for stations already done: 10 pairs
2025-12-02 21:21:02,953 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.002 secs for check for 4 stations already done (warm up cache)
2025-12-02 21:21:02,954 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.002 secs for check for stations already done
2025-12-02 21:21:02,955 139988402854784 INFO correlate.cc_timespan(): Still need to process: 4/4 stations, 12/12 channels, 10/10 pairs for 2019-02-01T12:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:03,231 139988402854784 INFO correlate._filter_channel_data(): Picked 20.0 as the closest sampling_rate to 20.0. 
2025-12-02 21:21:03,232 139988402854784 INFO correlate._filter_channel_data(): Filtered to 12/12 channels with sampling rate == 20.0
2025-12-02 21:21:03,232 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.278 secs for Read channel data: 12 channels
2025-12-02 21:21:03,563 139986439493312 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHE | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:03,564 139986009192128 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHN | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:03,576 139985975629504 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHZ | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:03,580 139986473055936 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHZ | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:03,593 139985992410816 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHN | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:03,593 139986456274624 INFO noise_module.preprocess_raw(): removing response for CI.ALP..BHE | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:03,598 139986709776064 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHN | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:03,619 139986692994752 INFO noise_module.preprocess_raw(): removing response for CI.ADO..BHE | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:06,312 139986009192128 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHE | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:06,347 139986473055936 INFO noise_module.preprocess_raw(): removing response for CI.ARV..BHZ | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:06,401 139986692994752 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHN | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:06,422 139986439493312 INFO noise_module.preprocess_raw(): removing response for CI.AVM..BHZ | 2019-02-01T12:00:00.000000Z - 2019-02-02T00:00:00.000000Z | 20.0 Hz, 864001 samples using inv
2025-12-02 21:21:07,798 139988402854784 INFO utils.log_raw(): TIMING CC Main:  4.566 secs for Preprocess: 12 channels
2025-12-02 21:21:07,799 139988402854784 INFO correlate.check_memory(): Require  0.07gb memory for cross correlations
2025-12-02 21:21:08,453 139988402854784 INFO utils.log_raw(): TIMING CC Main:  0.653 secs for Compute FFTs: 12 channels
2025-12-02 21:21:08,454 139988402854784 INFO correlate.cc_timespan(): Starting CC with 10 station pairs
2025-12-02 21:21:09,142 139985835521728 ERROR correlate.save(): Error saving CI.ADO and CI.ADO for 2019-02-01T12:00:00+0000 - 2019-02-02T00:00:00+0000: Unable to synchronously open file (file is already open for read-only)
2025-12-02 21:21:09,792 139988402854784 INFO utils.log_raw(): TIMING CC Main:  1.338 secs for Correlate and write to store
2025-12-02 21:21:09,896 139988402854784 INFO utils.log_raw(): TIMING CC Main:  6.972 secs for Process the chunk of 2019-02-01T12:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:09,900 139988402854784 INFO utils.log_raw(): TIMING CC Main: 14.350 secs for Step 1 in total with 4 cores
2025-12-02 21:21:09,901 139988402854784 ERROR correlate.cross_correlate(): Errors occurred during cross-correlation. Check logs for details. The following pairs failed:
2019-02-01T12:00:00+0000 - 2019-02-02T00:00:00+0000
[(CI.ADO, CI.ADO)]

Plot a single set of the cross correlation

pairs = cc_store.get_station_pairs()
timespans = cc_store.get_timespans(*pairs[0])
plotting_modules.plot_substack_cc(cc_store, timespans[0], 0.1, 1, 200, False)
_images/4e1e56960b9b0f88f4ec63aa27770bbba64d46b87dd8d3f5054ec9990b7058c0.png _images/c95efb468f2a66ca4cb590e6a9b2b9103845d621439756aaec8e85eb0a98ef53.png _images/d1a52a5ba1a071c5f9f7f9f980d5c41aaa7e588ba382c8dd74147e6297d7a232.png _images/516f9483815921edf97e4f031262be25874488fc997b82aa6bb78cf90e5b0cd2.png _images/3cb2d37dee8f22507b9d925db89cb07526d5d8cf573f89376149b41c57ebbcbe.png _images/baad1af2d6d47cc45c69ecbff7165772c922e979c4abc30bff8e9f9c59d46a88.png _images/e8086356a2ea67be01f8ca1a8a93d8379fcb11321b104e6fb3c4d66282451930.png _images/c888d93971116fc8340af01e9d2e7143351204bfee150a0b2d257fb7b116c666.png _images/d252983ed637a35a71f49a8767f4cf24b265028daf86a6b26c817f965be82cc8.png _images/4a2393074ac7ec122b37896262fc77dd892a7ac6cbb378a5c21beff620574b55.png _images/8e9d4c4b4169d78ab1ae6a83851b82e1c69d448111342a1e6dede977782a3d7f.png _images/dda90952502546dc53fac9564f51bf80d6915a361a362909828e75adea692435.png _images/830f8d7e5d6cc11b695bb0c4407a4981d9eb90d07ec95ea5a4244346b86ed5e6.png _images/7e6998c7b9456e1c7772bf4bf0131659d1f2ad834c7f7cc6c22996c14c2f4b1f.png _images/f562415306460fad14179f404ace77a8be1e4edc3f29067a1ec9d5b2c3e65530.png _images/b90d6d76cee2efff2909001af1dbf2e5f0fc47991751f3ec9d4202fcffeef974.png _images/d700ee56198d24a6b36218a862d85f794b671ef8635d26767279965172d45be0.png _images/521dadba20ee28b33d9fa0f044ea1e455950b857564ac41aae51fb6eb0684ea2.png _images/f8535b9206fdb50d77c2d70347c9549d4b0743ea21e34121b5d9399bb5e9f2a2.png _images/78ee5559088c7ce45a4c08a586567058d185b3748c9fc2d6af028e9c4af6215a.png _images/13147fa0a7967ee27dad7982cd2bf3fd95293c1c5f09a2b0f4e9038c5cb06365.png _images/40a2a6cb25f5afb2067ad3810c9eea45e95da07e367cf261aa3a0fb7508f4e52.png _images/0e66c956a94c39755f01a1ca249d0571a974947e8a93ebbc40e48928b3749aa7.png _images/bfe5ec568f5218a9f52fa075057a824426423cd07206b1c8835e31fac6171352.png _images/41ae861becde2aeb6b6cfe62fefdfc03b28ed1df6a949c462af4c500b0f34581.png _images/2fb6deed61a7f874ac3b7eaa85a5f65f8698d80261841322c86bd42e784aed47.png _images/eb535c822e2d2e42c37c2205b5eaecd8f0fa80cda46885495f6f78fa5001fe6b.png _images/7a23d0e8dde99980ed3b0c940a2fa44c4682ed1d1b94cc9f4bbcea31ab3c5754.png _images/ab31b842f16ed2db6a0fb1afa635059edf4dff7adaf4e6b10bce69bdbf4ed007.png _images/1d053ce5fe1929a8cc60b8ac66244cebbb881b8ff3ca576e8f78d856ab1c35fb.png _images/97af1c780f34d5bbb15f42d3e562030852ddd200f76c34ba6e6e012699862413.png _images/8a832b9934ecde9732145ecb80c6876c43cbc0d289bbee60cafff8a2a3fe7c99.png _images/041a078f1d1d2de3e14b950249ebd2c6dd1624f279b765c08d864a01a8b754fa.png _images/864d643d13f046424c24c5aa0a33e909476d3702699f2bb8bbb74f074b9292ee.png _images/9e58f925f9d42473ebaf1e8dab84d08992a9dd6a2cddc8cdb9ee327c9fb705c0.png _images/fb6957d7a90b4a3365531344f692b654ca3913852e64e99ce0b961a2c0e679f7.png _images/2557d44a62fb93e36aa87d013664be9ca9aea8b942513cf998709fd4f8088e33.png _images/089d2b86ae0a9e8503ed40beb29705b08ae63e5f03216206fe9e178d15d1b92b.png _images/29b440d6d1664b8f3ecf11a66b5bedd53e441682daaeeb715d599131fa15c049.png _images/c0cd9162f8a0808cd89c6853dfe61365f166a9610bda28aa6f35c14e4d41ac4d.png _images/6faa2bc1432ad228aa9cb1d3958673bce6303cee314e64019a072f2e622a76ce.png _images/3c3fafb0e7f43a797a876d346843170cd0db3471902d80a7841b4b2fcb4a37f4.png _images/93158f8a1d87d8cb256b681e42d7b89d1321b9d046b1fe77a3e7b30de7e44ac9.png _images/d08f2278b7be0fc706b7d6a5c907155303bb6c82093b0075760b5344a06779fb.png _images/2c9985c79fdf055d4926dbb9c62fb871aeb2a8b665dba93dff1bd70f5d85dc0b.png _images/015f68a31b732bc17e0def3fe0d506c3a9e868a2c4590c4ec46561aafbcb63c7.png _images/9d7fadc7ac3112b6b9d9e09325fced34ac85ed5852e1ea8a1e5be2973a0f8cf1.png _images/a22dafab85d95d56b0490c8fa424b76c4324be42ec143e553c968dbc58f7cba3.png _images/6416a52e1cccd443110a4becf912cf09a33c1c13a0b1f8c8b0f84f6447637f69.png _images/769a44e9026155c56586670809feaee5284d280e376a5860b999f86dcf82e852.png _images/141e13b1c1fcd9878c66665cefdb0f249d8a0f259565624245660d4e6a320c57.png _images/fb753ced9d021d441dd0d7ffd1e449d319906467cb2c88ece9241e7591c4d0a7.png _images/c621e1f5ce924ea3bb8137b47b2bb61fc83d358017b54b73d54410c917490afa.png _images/6dcdcebbad2f1b867b2f738c6032dd946ff7ab443b76e11936288af8b4f61951.png _images/cfbaa627fce5526b85901dd75e8d9137ce6f43b3b3e758e2141befccf3aeb8f0.png _images/8ff26bc078092ed6fe1346691488ee8905535fefabaa2f102619c7b0dfb67f5f.png _images/c2e19602f8cbb58f69d681eb2187761a08827fb692aaad11dba53fb7a0edbe8a.png _images/3b41085526231992cb02a66fd10219b765ec022c7b200f10925d9d06fd1bf5cf.png _images/fbd31ba5142968abd5e51d38e846efe02e7dd740df933f680cfc8373e1806b48.png _images/52b705d002f330fef98e2c1ff90e11ed01ee5ff96187047c57144d3cea97d3e0.png _images/5a389b18f9e5b11bcf7361f1cdc33efcaaa0af127ac4b8a940b0a2f546cbc10d.png _images/d6e988d76c54e5f5c1c519c0d6a994ffe2286ccaa9cbc11bc1f73f7defb88146.png _images/e71bb0d47c742eedd74ce1ebd61096976811fb3e782dbb969d2099308e24cfa6.png _images/4edb9d573ad3df3ec7975a04c973becd6183a5c40094176cc2e3da8194d60e49.png _images/f8028e959604a892ceb36586965dbf0c334ac8c42bde3ba4b96dda65294b6c2d.png _images/243ac21300c330915bb96d3b6ba9c8a92cbb20fc9c039ce623ec0c1e9a513c6d.png _images/c4e9a01007856465eb724d77b570204c79901346137d39158bc4f705b08c59c8.png _images/82ff6e1c833038f7d86f94bc4a3d521e3e52baa46f8c36927ba32e2dca1e37ca.png _images/d88beca72b8b4a373607598d07b14d7ee52f9c1bbd99493b70e18a3cef7328f7.png _images/ad4b3760240dd168859fa50025570652f11e941b420d9477bc063bc245832477.png _images/13fbb7275c5fe74d9dfac20a171cd54c683c3d49367dde64de328f6333e78c37.png _images/7390c20cda6dcc15a3ed6dfd69450c970c0fed82c805a92da72ca197baf4bbcc.png _images/a4dc65e1c9475054439731aff575b916099f236da2d4223242ffadf3b783c55b.png _images/5d36659dfbe2e88c8f615b0e161884ad5cbafa1ee217ec25ce6097dd142191f9.png _images/b194985df1403d1565a0c42f40671dbcf05821e07568a8a9047bb67d45e7bf39.png _images/79a5689355bd7f3ffc75f4974b042c526d9ac1a7ac91dc8a02e57c7dd22f8dcd.png _images/91f7327926f3292117aa1a4ba0a39af8767b1467b0aca07f8cd1bac10b9c2c15.png _images/e4bf33985d124577de6d238deef3ffd1fb71a29bba37b5dcf46ffe45060914e8.png

Step 2: Stack the cross correlation#

This combines the time-chunked ASDF files to stack over each time chunk and at each station pair.

# open a new cc store in read-only mode since we will be doing parallel access for stacking
cc_store = ASDFCCStore(cc_data_path, mode="r")
print(cc_store.get_station_pairs())
stack_store = ASDFStackStore(stack_data_path)
config.stations = ["*"] # stacking doesn't support prefixes yet, so allow all stations
stack_cross_correlations(cc_store, stack_store, config)
2025-12-02 21:21:31,475 139988402854784 INFO stack.initializer(): Station pairs: 10
[(CI.ARV, CI.AVM), (CI.AVM, CI.AVM), (CI.ADO, CI.ADO), (CI.ALP, CI.AVM), (CI.ARV, CI.ARV), (CI.ADO, CI.ARV), (CI.ADO, CI.ALP), (CI.ALP, CI.ARV), (CI.ALP, CI.ALP), (CI.ADO, CI.AVM)]
2025-12-02 21:21:34,968 139840269749120 INFO stack.stack_store_pair(): Stacking CI.ADO_CI.ADO/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:34,984 140655974435712 INFO stack.stack_store_pair(): Stacking CI.ADO_CI.ARV/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,000 139840269749120 INFO utils.log_raw(): TIMING:  0.026 secs for loading CCF data
2025-12-02 21:21:35,006 139840269749120 INFO utils.log_raw(): TIMING:  0.006 secs for stack/rotate all station pairs (CI.ADO, CI.ADO)
2025-12-02 21:21:35,035 139840269749120 INFO utils.log_raw(): TIMING:  0.028 secs for writing stack pair (CI.ADO, CI.ADO)
2025-12-02 21:21:35,037 139840269749120 INFO stack.stack_store_pair(): Stacking CI.ALP_CI.ALP/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,039 140116788292480 INFO stack.stack_store_pair(): Stacking CI.ADO_CI.ALP/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,051 140083602312064 INFO stack.stack_store_pair(): Stacking CI.ADO_CI.AVM/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,063 140655974435712 INFO utils.log_raw(): TIMING:  0.074 secs for loading CCF data
2025-12-02 21:21:35,073 140655974435712 INFO utils.log_raw(): TIMING:  0.010 secs for stack/rotate all station pairs (CI.ADO, CI.ARV)
2025-12-02 21:21:35,084 139840269749120 INFO utils.log_raw(): TIMING:  0.040 secs for loading CCF data
2025-12-02 21:21:35,091 139840269749120 INFO utils.log_raw(): TIMING:  0.008 secs for stack/rotate all station pairs (CI.ALP, CI.ALP)
2025-12-02 21:21:35,116 139840269749120 INFO utils.log_raw(): TIMING:  0.024 secs for writing stack pair (CI.ALP, CI.ALP)
2025-12-02 21:21:35,118 139840269749120 INFO stack.stack_store_pair(): Stacking CI.ALP_CI.ARV/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,127 140116788292480 INFO utils.log_raw(): TIMING:  0.079 secs for loading CCF data
2025-12-02 21:21:35,134 140083602312064 INFO utils.log_raw(): TIMING:  0.078 secs for loading CCF data
2025-12-02 21:21:35,137 140116788292480 INFO utils.log_raw(): TIMING:  0.011 secs for stack/rotate all station pairs (CI.ADO, CI.ALP)
2025-12-02 21:21:35,145 140083602312064 INFO utils.log_raw(): TIMING:  0.011 secs for stack/rotate all station pairs (CI.ADO, CI.AVM)
2025-12-02 21:21:35,151 140655974435712 INFO utils.log_raw(): TIMING:  0.077 secs for writing stack pair (CI.ADO, CI.ARV)
2025-12-02 21:21:35,153 140655974435712 INFO stack.stack_store_pair(): Stacking CI.ALP_CI.AVM/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,188 139840269749120 INFO utils.log_raw(): TIMING:  0.067 secs for loading CCF data
2025-12-02 21:21:35,198 139840269749120 INFO utils.log_raw(): TIMING:  0.010 secs for stack/rotate all station pairs (CI.ALP, CI.ARV)
2025-12-02 21:21:35,222 140116788292480 INFO utils.log_raw(): TIMING:  0.083 secs for writing stack pair (CI.ADO, CI.ALP)
2025-12-02 21:21:35,223 140083602312064 INFO utils.log_raw(): TIMING:  0.077 secs for writing stack pair (CI.ADO, CI.AVM)
2025-12-02 21:21:35,223 140116788292480 INFO stack.stack_store_pair(): Stacking CI.ARV_CI.ARV/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,224 140083602312064 INFO stack.stack_store_pair(): Stacking CI.ARV_CI.AVM/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,225 140655974435712 INFO utils.log_raw(): TIMING:  0.067 secs for loading CCF data
2025-12-02 21:21:35,240 140655974435712 INFO utils.log_raw(): TIMING:  0.015 secs for stack/rotate all station pairs (CI.ALP, CI.AVM)
2025-12-02 21:21:35,274 139840269749120 INFO utils.log_raw(): TIMING:  0.075 secs for writing stack pair (CI.ALP, CI.ARV)
2025-12-02 21:21:35,274 139840269749120 INFO stack.stack_store_pair(): Stacking CI.AVM_CI.AVM/2019-02-01T00:00:00+0000 - 2019-02-02T00:00:00+0000
2025-12-02 21:21:35,280 140116788292480 INFO utils.log_raw(): TIMING:  0.052 secs for loading CCF data
2025-12-02 21:21:35,289 140116788292480 INFO utils.log_raw(): TIMING:  0.010 secs for stack/rotate all station pairs (CI.ARV, CI.ARV)
2025-12-02 21:21:35,298 140083602312064 INFO utils.log_raw(): TIMING:  0.070 secs for loading CCF data
2025-12-02 21:21:35,308 140083602312064 INFO utils.log_raw(): TIMING:  0.011 secs for stack/rotate all station pairs (CI.ARV, CI.AVM)
2025-12-02 21:21:35,316 140116788292480 INFO utils.log_raw(): TIMING:  0.025 secs for writing stack pair (CI.ARV, CI.ARV)
2025-12-02 21:21:35,316 140655974435712 INFO utils.log_raw(): TIMING:  0.076 secs for writing stack pair (CI.ALP, CI.AVM)
2025-12-02 21:21:35,322 139840269749120 INFO utils.log_raw(): TIMING:  0.044 secs for loading CCF data
2025-12-02 21:21:35,326 139840269749120 INFO utils.log_raw(): TIMING:  0.005 secs for stack/rotate all station pairs (CI.AVM, CI.AVM)
2025-12-02 21:21:35,341 139840269749120 INFO utils.log_raw(): TIMING:  0.015 secs for writing stack pair (CI.AVM, CI.AVM)
2025-12-02 21:21:35,359 140083602312064 INFO utils.log_raw(): TIMING:  0.051 secs for writing stack pair (CI.ARV, CI.AVM)
2025-12-02 21:21:35,945 139988402854784 INFO utils.log_raw(): TIMING:  4.474 secs for step 2 in total
pairs = stack_store.get_station_pairs()
print(f"Found {len(pairs)} station pairs")
sta_stacks = stack_store.read_bulk(timerange, pairs) # no timestamp used in ASDFStackStore
Found 10 station pairs
2025-12-02 21:21:36,224 139988402854784 INFO utils.log_raw(): TIMING:  0.271 secs for loading 10 stacks

Plot the stacks

print(os.listdir(cc_data_path))
print(os.listdir(stack_data_path))
['2019_02_01_00_00_00T2019_02_01_12_00_00.h5', '2019_02_01_12_00_00T2019_02_02_00_00_00.h5']
['CI.AVM', 'CI.ALP', 'CI.ARV', 'CI.ADO']
plotting_modules.plot_all_moveout(sta_stacks, 'Allstack_linear', 0.1, 0.2, 'ZZ', 1)
2025-12-02 21:21:36,236 139988402854784 INFO plotting_modules.plot_all_moveout(): Plottting: Allstack_linear, 10 station pairs
200 8001
_images/c5de41ebca20c7217db5ba775d04b6ac15b8ce5af1affcfe98a8f73ba98efe59.png