diff --git a/tutorials/get_dvv_chif.ipynb b/tutorials/get_dvv_chif.ipynb deleted file mode 100644 index 0b7fbd8d..00000000 --- a/tutorials/get_dvv_chif.ipynb +++ /dev/null @@ -1,201 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Measure changes in seismic velocities using a single station\n", - "\n", - "In this example, we will download data from a French network. That station is located where big \"bassin\" were made to store water, but these were affecting the local aquifer replenishing." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Import basic modules" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from noisepy.seis import download, cross_correlate, stack, plotting_modules\n", - "from noisepy.seis.asdfstore import ASDFRawDataStore, ASDFCCStore\n", - "from noisepy.seis.datatypes import ConfigParameters\n", - "from dateutil.parser import isoparse\n", - "from noisepy.seis import noise_module\n", - "import os\n", - "import glob\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "import logging\n", - "from obspy.signal.filter import bandpass\n", - "\n", - "\n", - "logger = logging.getLogger(__name__)\n", - "path = \"~/data\" # for use in Colab\n", - "# path = os.path.expanduser(\"~/data\") # for local runs\n", - "# print(path)\n", - "\n", - "MAX_MEM = 4.0\n", - "\n", - "os.makedirs(path,exist_ok=True)\n", - "\n", - "raw_data_path = os.path.join(path, \"RAW_DATA\")\n", - "cc_data_path = os.path.join(path, \"CCF\")\n", - "stack_data_path = os.path.join(path, \"STACK\")\n", - "os.system(f\"rm -rf {raw_data_path}\")" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Ambient noise project configuration\n", - "\n", - "Some key parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "config = ConfigParameters() # default config parameters which can be customized\n", - "config.inc_hours = 12\n", - "config.start_date = isoparse(\"2022-06-18\")\n", - "config.end_date = isoparse(\"2022-06-21\")\n", - "config.samp_freq= 40 # (int) Sampling rate in Hz of desired processing (it can be different than the data sampling rate)\n", - "config.cc_len= 3600.0 # (float) basic unit of data length for fft (sec)\n", - " # criteria for data selection\n", - "config.ncomp = 3 # 1 or 3 component data (needed to decide whether do rotation)\n", - "\n", - "\n", - "config.acorr_only = True # only perform auto-correlation or not\n", - "config.xcorr_only = False # only perform cross-correlation or not\n", - "\n", - "\n", - "config.lamin = 40 # min latitude\n", - "config.lamax = 50 # max latitude\n", - "config.lomin = 0 # min longitude\n", - "config.lomax = 10 # max longitude\n", - "config.net_list = [\"FR\"] # look for all network codes\n", - "config.stations = [\"CHIF\"]\n", - "\n", - "\n", - " # pre-processing parameters\n", - "config.step= 1800.0 # (float) overlapping between each cc_len (sec)\n", - "config.stationxml= False # station.XML file used to remove instrument response for SAC/miniseed data\n", - "config.rm_resp= \"inv\" # select 'no' to not remove response and use 'inv' if you use the stationXML,'spectrum',\n", - "config.freqmin = 0.05\n", - "config.freqmax = 10.0\n", - "config.max_over_std = 10 # threshold to remove window of bad signals: set it to 10*9 if prefer not to remove them\n", - "\n", - "# TEMPORAL and SPECTRAL NORMALISATION\n", - "config.freq_norm= \"rma\" # choose between \"rma\" for a soft whitenning or \"no\" for no whitening. Pure whitening is not implemented correctly at this point.\n", - "config.smoothspect_N = 10 # moving window length to smooth spectrum amplitude (points)\n", - " # here, choose smoothspect_N for the case of a strict whitening (e.g., phase_only)\n", - "\n", - "config.time_norm = \"no\" # 'no' for no normalization, or 'rma', 'one_bit' for normalization in time domain,\n", - " # TODO: change time_norm option from \"no\" to \"None\"\n", - "config.smooth_N= 10 # moving window length for time domain normalization if selected (points)\n", - "\n", - "config.cc_method= \"xcorr\" # 'xcorr' for pure cross correlation OR 'deconv' for deconvolution;\n", - " # FOR \"COHERENCY\" PLEASE set freq_norm to \"rma\", time_norm to \"no\" and cc_method to \"xcorr\"\n", - "\n", - "# OUTPUTS:\n", - "config.substack = True # True = smaller stacks within the time chunk. False: it will stack over inc_hours\n", - "config.substack_len = config.cc_len # how long to stack over (for monitoring purpose): need to be multiples of cc_len\n", - " # if substack=True, substack_len=2*cc_len, then you pre-stack every 2 correlation windows.\n", - " # for instance: substack=True, substack_len=cc_len means that you keep ALL of the correlations\n", - "\n", - "config.maxlag= 200 # lags of cross-correlation to save (sec)\n", - "config.substack = True" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Download data" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "from obspy.clients.fdsn.client import Client\n", - "from obspy.core.utcdatetime import UTCDateTime\n", - "\n", - "client = Client(\"RESIF\")\n", - "starttime = UTCDateTime(\"2023-06-18T00:00:00.000000\")\n", - "endtime = UTCDateTime(\"2023-06-20T00:00:00.000000\")\n", - "s = client.get_waveforms(\"FR\", \"CHIF\", location = \"*\", channel = \"HH*\",\n", - " starttime = starttime, endtime = endtime)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Download using noisepy:\n", - "\n", - "(buggy for now?)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Download data locally. Enters raw data path, channel types, stations, config, and fdsn server.\n", - "download(raw_data_path, config, \"RESIF\")" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "noisepy", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.16" - }, - "orig_nbformat": 4 - }, - "nbformat": 4, - "nbformat_minor": 2 -}