Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
robfatland committed Jun 17, 2024
1 parent c20cd25 commit 75c9556
Show file tree
Hide file tree
Showing 66 changed files with 1,034 additions and 5,098 deletions.
3,509 changes: 0 additions & 3,509 deletions book/chapters/loadData-Shallow_profilers.ipynb

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
261 changes: 0 additions & 261 deletions book/chapters/rob/Untitled.ipynb

This file was deleted.

4 changes: 2 additions & 2 deletions book/chapters/rob/anomaly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "1c216635-59e5-4886-bbd5-634c54c5606b",
"metadata": {},
"source": [
"# Anomaly 1\n",
"## anomaly\n",
"\n",
"\n",
"This notebook generates anomaly metadata for an OOI RCA shallow profiler, typically scanning a time series lasting\n",
Expand Down Expand Up @@ -818,7 +818,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
177 changes: 40 additions & 137 deletions book/chapters/rob/anomaly3.ipynb

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions book/chapters/rob/data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data\n",
"\n",
"\n",
"\n",
"## Introduction\n",
"# Introduction\n",
"\n",
"\n",
"Data are pulled in as large files for ingest. These are external to the\n",
Expand Down Expand Up @@ -212,7 +208,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -247,7 +243,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 2,
"metadata": {
"tags": []
},
Expand All @@ -257,8 +253,6 @@
"# Example output file: 'axb_nitrate_jan22_nitrate.nc' gives site, instrument, sensor and time range\n",
"# spkir requires only one output file; but seven sensor re-names: To 'spkir412nm' etcetera.\n",
"\n",
"\n",
"\n",
"# if not ReformatDataFile(False): print('ReformatDataFile() returned False')"
]
},
Expand Down Expand Up @@ -613,7 +607,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
1 change: 1 addition & 0 deletions book/chapters/rob/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def ReformatDataFile(verbose=False):




def ProfileGenerator(sourcefnm, z_key, verbose = False):
"""
ProfileGenerator traverses pandas Series z of pressures/depths and matching pandas Series t of times.
Expand Down
236 changes: 236 additions & 0 deletions book/chapters/rob/data2.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "8aa370ef-3ab8-4cf3-bf13-96a783e342f9",
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'netcdf4'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnetcdf4\u001b[39;00m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'netcdf4'"
]
}
],
"source": [
"import netcdf4"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2228ec14-bbdb-429b-b19a-49d273c67dbd",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import xarray as xr\n",
"import s3fs\n",
"\n",
"def loadData(zarrDir):\n",
" fs = s3fs.S3FileSystem(anon=True)\n",
" zarr_store = fs.get_mapper(zarrDir)\n",
" ds = xr.open_zarr(zarr_store, consolidated=True)\n",
" return ds\n",
"\n",
"#zarrFile = 'ooi-data/CE04OSPS-SF01B-2A-CTDPFA107-streamed-ctdpf_sbe43_sample'\n",
"#zarrFile = 'ooi-data/RS01SBPS-SF01A-2A-CTDPFA102-streamed-ctdpf_sbe43_sample'\n",
"zarrFile = 'ooi-data/RS03AXPS-SF03A-2A-CTDPFA302-streamed-ctdpf_sbe43_sample'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c57ef9be-6c75-4d0f-8c9a-a554283e2185",
"metadata": {},
"outputs": [],
"source": [
"fs = s3fs.S3FileSystem(anon=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "61658874-bc3f-45b0-918e-4eef06312e17",
"metadata": {},
"outputs": [],
"source": [
"fs.listdir('ooi-data', detail = False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "82406a7f-1ccf-4c5f-a759-393fb3199919",
"metadata": {},
"outputs": [],
"source": [
"# use ds.sel( to narrow the time window dim"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a56bc2c6-e16d-49ee-b3cc-8166935f0c42",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"siteData = loadData(zarrFile)\n",
"siteData"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6d82a0a7-c1a0-48dc-ae14-f32a41356e99",
"metadata": {},
"outputs": [],
"source": [
"siteData.time[-1]"
]
},
{
"cell_type": "markdown",
"id": "6b15a656-09fa-4a70-b3d6-434ecd8e1fc3",
"metadata": {},
"source": [
"```\n",
"['ooi-data/CE02SHBP-LJ01D-05-ADCPTB104-streamed-adcp_velocity_beam',\r\n",
" 'ooi-data/CE02SHBP-LJ01D-06-CTDBPN106-streamed-ctdbp_no_sample',\r\n",
" 'ooi-data/CE02SHBP-LJ01D-07-VEL3DC108-streamed-vel3d_cd_velocity_data',\r\n",
" 'ooi-data/CE02SHBP-LJ01D-09-PCO2WB103-streamed-pco2w_b_sami_data_record',\r\n",
" 'ooi-data/CE02SHBP-LJ01D-10-PHSEND103-streamed-phsen_data_record',\r\n",
" 'ooi-data/CE04OSBP-LJ01C-05-ADCPSI103-streamed-adcp_velocity_beam',\r\n",
" 'ooi-data/CE04OSBP-LJ01C-06-CTDBPO108-streamed-ctdbp_no_sample',\r\n",
" 'ooi-data/CE04OSBP-LJ01C-07-VEL3DC107-streamed-vel3d_cd_velocity_data',\r\n",
" 'ooi-data/CE04OSBP-LJ01C-09-PCO2WB104-streamed-pco2w_b_sami_data_record',\r\n",
" 'ooi-data/CE04OSBP-LJ01C-10-PHSEND107-streamed-phsen_data_record',\r\n",
" 'ooi-data/CE04OSPS-PC01B-4A-CTDPFA109-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/CE04OSPS-PC01B-4A-CTDPFA109-streamed-ctdpf_sbe43_sample',\r\n",
" 'ooi-data/CE04OSPS-PC01B-4B-PHSENA106-streamed-phsen_data_record',\r\n",
" 'ooi-data/CE04OSPS-PC01B-4D-PCO2WA105-streamed-pco2w_a_sami_data_record',\r\n",
" 'ooi-data/CE04OSPS-SF01B-2A-CTDPFA107-streamed-ctdpf_sbe43_sample',\r\n",
" 'ooi-data/CE04OSPS-SF01B-2B-PHSENA108-streamed-phsen_data_record',\r\n",
" 'ooi-data/CE04OSPS-SF01B-3A-FLORTD104-streamed-flort_d_data_record',\r\n",
" 'ooi-data/CE04OSPS-SF01B-3C-PARADA102-streamed-parad_sa_sample',\r\n",
" 'ooi-data/CE04OSPS-SF01B-3D-SPKIRA102-streamed-spkir_data_record',\r\n",
" 'ooi-data/CE04OSPS-SF01B-4A-NUTNRA102-streamed-nutnr_a_dark_sample',\r\n",
" 'ooi-data/CE04OSPS-SF01B-4A-NUTNRA102-streamed-nutnr_a_sample',\r\n",
" 'ooi-data/CE04OSPS-SF01B-4B-VELPTD106-streamed-velpt_velocity_data',\r\n",
" 'ooi-data/CE04OSPS-SF01B-4F-PCO2WA102-streamed-pco2w_a_sami_data_record',\r\n",
" 'ooi-data/RS01SBPS-PC01A-05-ADCPTD102-streamed-adcp_velocity_beam',\r\n",
" 'ooi-data/RS01SBPS-PC01A-06-VADCPA101-streamed-vadcp_velocity_beam',\r\n",
" 'ooi-data/RS01SBPS-PC01A-06-VADCPA101-streamed-vadcp_velocity_beam_5',\r\n",
" 'ooi-data/RS01SBPS-PC01A-4A-CTDPFA103-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/RS01SBPS-PC01A-4A-CTDPFA103-streamed-ctdpf_sbe43_sample',\r\n",
" 'ooi-data/RS01SBPS-PC01A-4B-PHSENA102-streamed-phsen_data_record',\r\n",
" 'ooi-data/RS01SBPS-PC01A-4C-FLORDD103-streamed-flort_d_data_record',\r\n",
" 'ooi-data/RS01SBPS-SF01A-2A-CTDPFA102-streamed-ctdpf_sbe43_sample',\r\n",
" 'ooi-data/RS01SBPS-SF01A-2D-PHSENA101-streamed-phsen_data_record',\r\n",
" 'ooi-data/RS01SBPS-SF01A-3A-FLORTD101-streamed-flort_d_data_record',\r\n",
" 'ooi-data/RS01SBPS-SF01A-3C-PARADA101-streamed-parad_sa_sample',\r\n",
" 'ooi-data/RS01SBPS-SF01A-3D-SPKIRA101-streamed-spkir_data_record',\r\n",
" 'ooi-data/RS01SBPS-SF01A-4A-NUTNRA101-streamed-nutnr_a_dark_sample',\r\n",
" 'ooi-data/RS01SBPS-SF01A-4A-NUTNRA101-streamed-nutnr_a_sample',\r\n",
" 'ooi-data/RS01SBPS-SF01A-4B-VELPTD102-streamed-velpt_velocity_data',\r\n",
" 'ooi-data/RS01SBPS-SF01A-4F-PCO2WA101-streamed-pco2w_a_sami_data_record',\r\n",
" 'ooi-data/RS01SLBS-LJ01A-05-HPIESA101-streamed-echo_sounding',\r\n",
" 'ooi-data/RS01SLBS-LJ01A-10-ADCPTE101-streamed-adcp_velocity_beam',\r\n",
" 'ooi-data/RS01SLBS-LJ01A-12-CTDPFB101-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/RS01SLBS-MJ01A-06-PRESTA101-streamed-prest_real_time',\r\n",
" 'ooi-data/RS01SLBS-MJ01A-12-VEL3DB101-streamed-vel3d_b_sample',\r\n",
" 'ooi-data/RS01SUM1-LJ01B-12-VEL3DB104-streamed-vel3d_b_sample',\r\n",
" 'ooi-data/RS01SUM2-MJ01B-12-ADCPSK101-streamed-adcp_velocity_beam',\r\n",
" 'ooi-data/RS03ASHS-MJ03B-07-TMPSFA301-streamed-tmpsf_sample',\r\n",
" 'ooi-data/RS03ASHS-MJ03B-09-BOTPTA304-streamed-botpt_nano_sample_15s',\r\n",
" 'ooi-data/RS03ASHS-MJ03B-10-CTDPFB304-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/RS03AXBS-LJ03A-05-HPIESA301-streamed-echo_sounding',\r\n",
" 'ooi-data/RS03AXBS-LJ03A-10-ADCPTE303-streamed-adcp_velocity_beam',\r\n",
" 'ooi-data/RS03AXBS-LJ03A-11-OPTAAC303-streamed-optaa_sample',\r\n",
" 'ooi-data/RS03AXBS-LJ03A-12-CTDPFB301-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/RS03AXBS-MJ03A-06-PRESTA301-streamed-prest_real_time',\r\n",
" 'ooi-data/RS03AXBS-MJ03A-12-VEL3DB301-streamed-vel3d_b_sample',\r\n",
" 'ooi-data/RS03AXPS-PC03A-05-ADCPTD302-streamed-adcp_velocity_beam',\r\n",
" 'ooi-data/RS03AXPS-PC03A-06-VADCPA301-streamed-vadcp_velocity_beam',\r\n",
" 'ooi-data/RS03AXPS-PC03A-06-VADCPA301-streamed-vadcp_velocity_beam_5',\r\n",
" 'ooi-data/RS03AXPS-PC03A-4A-CTDPFA303-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/RS03AXPS-PC03A-4B-PHSENA302-streamed-phsen_data_record',\r\n",
" 'ooi-data/RS03AXPS-PC03A-4C-FLORDD303-streamed-flort_d_data_record',\r\n",
" 'ooi-data/RS03AXPS-SF03A-2A-CTDPFA302-streamed-ctdpf_sbe43_sample',\r\n",
" 'ooi-data/RS03AXPS-SF03A-2D-PHSENA301-streamed-phsen_data_record',\r\n",
" 'ooi-data/RS03AXPS-SF03A-3A-FLORTD301-streamed-flort_d_data_record',\r\n",
" 'ooi-data/RS03AXPS-SF03A-3B-OPTAAD301-streamed-optaa_sample',\r\n",
" 'ooi-data/RS03AXPS-SF03A-3C-PARADA301-streamed-parad_sa_sample',\r\n",
" 'ooi-data/RS03AXPS-SF03A-3D-SPKIRA301-streamed-spkir_data_record',\r\n",
" 'ooi-data/RS03AXPS-SF03A-4A-NUTNRA301-streamed-nutnr_a_dark_sample',\r\n",
" 'ooi-data/RS03AXPS-SF03A-4A-NUTNRA301-streamed-nutnr_a_sample',\r\n",
" 'ooi-data/RS03AXPS-SF03A-4B-VELPTD302-streamed-velpt_velocity_data',\r\n",
" 'ooi-data/RS03AXPS-SF03A-4F-PCO2WA301-streamed-pco2w_a_sami_data_record',\r\n",
" 'ooi-data/RS03CCAL-MJ03F-12-CTDPFB305-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/RS03ECAL-MJ03E-12-CTDPFB306-streamed-ctdpf_optode_sample',\r\n",
" 'ooi-data/RS03INT1-MJ03C-07-D1000A301-streamed-d1000_sample',\r\n",
" 'ooi-data/RS03INT1-MJ03C-09-TRHPHA302-streamed-trhph_sample',\r\n",
" 'ooi-data/RS03INT1-MJ03C-10-TRHPHA301-streamed-trhph_sample',\r\n",
" 'ooi-data/RS03INT2-MJ03D-12-VEL3DB304-streamed-vel3d_b_sample',\r\n",
" 'ooi-data/annotations',\r\n",
" 'ooi-data/index.json',\r\n",
" 'ooi-data/stats.json']\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e08e785a-5741-45e5-9f4c-cb497fa83eed",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"type(siteData)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5646cad3-6c2a-4898-9092-59cfdc88eb60",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"siteData.to_netcdf(\"~/RS03AXPS-SF03A-2A-CTDPFA302-streamed-ctdpf_sbe43_sample.nc\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit 75c9556

Please sign in to comment.