diff --git a/code/apres/ApRES_deployment_QC_v1.ipynb b/code/apres/ApRES_deployment_QC_v1.ipynb new file mode 100644 index 0000000..04671bf --- /dev/null +++ b/code/apres/ApRES_deployment_QC_v1.ipynb @@ -0,0 +1,1628 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# ApRES data quality control \n", + "Use this notebook to quality control data collected during the deployment of ApRES units. \n", + "\n", + "As described in the [checklist](https://docs.google.com/document/d/1szAn3jsHMNxfMRui8-35VI7EjeVs8Lp5sB5TTNECf4c/edit), a short series of unattended measurements should be made using attenuator and gain settings selected by performing trial bursts. This notebook can then be used to load and examine those data. This will inform any changes needed to the survey (e.g, changing gain or attenuator settings, or the number of sub-bursts), or confirm that the selected settings are, to our best estimate, the most appropriate to be used. \n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If needed, a conda environment can be created using the provided environment.yml file. Type the following in the terminal:\n", + "\n", + "```\n", + "conda env create -f environment.yml\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the XApRES package" + ] + }, + { + "cell_type": "code", + "execution_count": 123, + "metadata": {}, + "outputs": [], + "source": [ + "import xapres as xa\n", + "import xarray as xr\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Point the code to the data\n", + "Change the path in the cell below to be path to the folder containing the dat files colleted during the short unattended survey. " + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [], + "source": [ + "directory = \"../../data/apres-test-ldeo-may31-2024/data/DIR2024-05-31-1932\" " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the data" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
<xarray.Dataset> Size: 24MB\n", + "Dimensions: (time: 10, chirp_time: 40001, chirp_num: 2,\n", + " attenuator_setting_pair: 2, profile_range: 16644)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 80B 2024-05-31T19:32:55 ... 2024-0...\n", + " * chirp_time (chirp_time) float64 320kB 0.0 2.5e-05 5e-05 ... 1.0 1.0\n", + " * profile_range (profile_range) float64 133kB 0.0 0.2103 ... 3.5e+03\n", + " * chirp_num (chirp_num) int64 16B 0 1\n", + " filename (time) <U85 3kB '../../data/apres-test-ldeo-may31-2024/d...\n", + " burst_number (time) int64 80B 0 1 2 3 4 5 6 7 8 9\n", + " AFGain (attenuator_setting_pair) int64 16B -14 -4\n", + " attenuator (attenuator_setting_pair) float64 16B 6.0 10.0\n", + " orientation (time) <U7 280B 'unknown' 'unknown' ... 'unknown' 'unknown'\n", + "Dimensions without coordinates: attenuator_setting_pair\n", + "Data variables:\n", + " chirp (time, chirp_time, chirp_num, attenuator_setting_pair) float64 13MB ...\n", + " profile (time, profile_range, chirp_num, attenuator_setting_pair) complex128 11MB ...\n", + " latitude (time) float64 80B 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n", + " longitude (time) float64 80B 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n", + " battery_voltage (time) float64 80B 12.4 12.41 12.41 ... 12.42 12.42 12.42\n", + " temperature_1 (time) float64 80B 32.43 31.84 34.78 ... 28.9 30.47 28.9\n", + " temperature_2 (time) float64 80B 32.98 33.77 32.2 ... 33.18 34.36 33.57
<xarray.DataArray 'profile' (average_over_n_chirps: 20, profile_range: 6658)> Size: 1MB\n", + "dask.array<concatenate, shape=(20, 6658), dtype=float64, chunksize=(1, 6658), chunktype=numpy.ndarray>\n", + "Coordinates:\n", + " AFGain int64 8B dask.array<chunksize=(), meta=np.ndarray>\n", + " attenuator float64 8B dask.array<chunksize=(), meta=np.ndarray>\n", + " burst_number int64 8B dask.array<chunksize=(), meta=np.ndarray>\n", + " filename <U83 332B dask.array<chunksize=(), meta=np.ndarray>\n", + " * profile_range (profile_range) float64 53kB 0.0 0.2103 ... 1.4e+03\n", + " time datetime64[ns] 8B 2022-06-16T08:06:44\n", + " * average_over_n_chirps (average_over_n_chirps) int64 160B 0 1 2 ... 17 18 19