Skip to content

Commit

Permalink
big update
Browse files Browse the repository at this point in the history
remove .ds_store
update jan 1
  • Loading branch information
shaunwbell committed Jan 6, 2025
1 parent 320f41b commit ead101b
Show file tree
Hide file tree
Showing 245 changed files with 138,906 additions and 8,127 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ index.html
*.nc
*.csv
jupyterbook/content/code_gallery/ecofoci_field*/*/*/*.png
jupyterbook/content/code_gallery/ecofoci_fielddata_history/.DS_Store
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.1"
"version": "3.12.8"
}
},
"nbformat": 4,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,27 @@
"***TODO:***\n",
"+ Add ability to specify cast/instrument and make all values missing/removed\n",
"+ Add ability to linearly interpolate between singleton points in profile for speciffic parameters\n",
"+ Update any meta data "
"+ Update any meta data\n",
"\n",
"***Changes from previous cruises:***\n",
"+ use GSW instead of SW for dens0 calculation"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "studied-pollution",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/bell/src/ecofocipy/src/EcoFOCIpy/plots/sbe_ctd_plots.py:10: UserWarning: The seawater library is deprecated! Please use gsw instead.\n",
" import seawater as sw\n"
]
}
],
"source": [
"import os\n",
"import numpy as np\n",
Expand Down Expand Up @@ -77,16 +89,33 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 27,
"id": "62303737-7588-498d-84dc-8fdc784358a9",
"metadata": {},
"outputs": [],
"source": [
"# Following routines will eventually get ported to ecofocipy as subroutines to be called\n",
"\n",
"import seawater as sw\n",
"import gsw_xarray as gsw\n",
"\n",
"def sigmat_update(salinity=None,temperature=None):\n",
"def sigmat_update(salinity=None,temperature=None,depth=None,latitude=0,longitude=0):\n",
" r'''\n",
" Changes to T or S (commonly to despike values or apply a salinity offset) will need corresponding changes in sigmat.\n",
" Calculation uses Gibbs-Seawater\n",
" '''\n",
" SA = gsw.SA_from_SP(SP=salinity,\n",
" p=depth,\n",
" lat=latitude,\n",
" lon=longitude)\n",
" CT = gsw.CT_from_t(SA,\n",
" temperature,\n",
" depth)\n",
" \n",
" dens0 = gsw.density.sigma0(SA,CT)\n",
"\n",
" return dens0\n",
" \n",
"def sigmat_update_old(salinity=None,temperature=None):\n",
" '''\n",
" Changes to T or S (commonly to despike values or apply a salinity offset) will need corresponding changes in sigmat\n",
" '''\n",
Expand All @@ -96,7 +125,7 @@
" return sigt\n",
"\n",
"\n",
"def oxyconc_update(salinity=None,temperature=None, oxygen_conc_umkg=None,pressure=None):\n",
"def oxyconc_update(salinity=None,temperature=None, oxygen_conc_umkg=None,pressure=None,sigmatheta_pri=0):\n",
" '''\n",
" Although PJS tends to look at %sat to QC, changes are usually applied on the concentration parameter. So %sat will need recalculation.\n",
" Changes to T/S also drive some small corrections.\n",
Expand Down Expand Up @@ -137,15 +166,15 @@
" \n",
" # determine sigmatheta and convert Oxygen from micromoles/kg to ml/l\n",
" # calculate new oxygen saturation percent using derived oxsol\n",
" sigmatheta_pri = sw.eos80.pden(s=salinity, t=temperature, p=pressure)\n",
" # sigmatheta_pri = sw.eos80.pden(s=salinity, t=temperature, p=pressure)\n",
" oxygen_conc_mll = oxygen_conc_umkg * sigmatheta_pri / 44660\n",
" \n",
" return oxygen_conc_mll,((oxygen_conc_mll) / Oxsol_pri) * 100.0, oxygen_conc_umkg"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 33,
"id": "a11505a2-6f36-454b-8f46-d5c54c479526",
"metadata": {
"tags": []
Expand All @@ -156,16 +185,18 @@
"output_type": "stream",
"text": [
"Updated: DY2407c001_ctd.nc\n",
"Updated: DY2407c002_ctd.nc\n"
"No file to update: DY2407c001_ctd.updated.nc\n",
"Updated: DY2407c002_ctd.nc\n",
"No file to update: DY2407c002_ctd.updated.nc\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/6r/n_mpcj7d7pdf9ncqvjy5vb8c0000jm/T/ipykernel_12735/397792649.py:39: UserWarning: Times can't be serialized faithfully to int64 with requested units 'days since 1900-01-01'. Resolution of 'minutes' needed. Serializing times to floating point instead. Set encoding['dtype'] to integer dtype to serialize to int64. Set encoding['dtype'] to floating point dtype to silence this warning.\n",
"/var/folders/6r/n_mpcj7d7pdf9ncqvjy5vb8c0000jm/T/ipykernel_11935/560199972.py:39: UserWarning: Times can't be serialized faithfully to int64 with requested units 'days since 1900-01-01'. Resolution of 'minutes' needed. Serializing times to floating point instead. Set encoding['dtype'] to integer dtype to serialize to int64. Set encoding['dtype'] to floating point dtype to silence this warning.\n",
" cruise_data_update.to_netcdf(sample_data_dir+cast.replace(ncfiles,'.updated.nc'),format='NETCDF3_CLASSIC',encoding={'time':{'units':'days since 1900-01-01'}})\n",
"/var/folders/6r/n_mpcj7d7pdf9ncqvjy5vb8c0000jm/T/ipykernel_12735/397792649.py:39: UserWarning: Times can't be serialized faithfully to int64 with requested units 'days since 1900-01-01'. Resolution of 'minutes' needed. Serializing times to floating point instead. Set encoding['dtype'] to integer dtype to serialize to int64. Set encoding['dtype'] to floating point dtype to silence this warning.\n",
"/var/folders/6r/n_mpcj7d7pdf9ncqvjy5vb8c0000jm/T/ipykernel_11935/560199972.py:39: UserWarning: Times can't be serialized faithfully to int64 with requested units 'days since 1900-01-01'. Resolution of 'minutes' needed. Serializing times to floating point instead. Set encoding['dtype'] to integer dtype to serialize to int64. Set encoding['dtype'] to floating point dtype to silence this warning.\n",
" cruise_data_update.to_netcdf(sample_data_dir+cast.replace(ncfiles,'.updated.nc'),format='NETCDF3_CLASSIC',encoding={'time':{'units':'days since 1900-01-01'}})\n"
]
}
Expand All @@ -185,14 +216,14 @@
" \n",
" #update sigmat (or calculate it I suppose)\n",
" sigup = sigmat_update(salinity=pandas_csv.salinity_ch1,\n",
" temperature=pandas_csv.temperature_ch1)\n",
" cruise_data_update['sigma_t_ch1'] = (['time','latitude','longitude','depth'],(sigup * 0) + np.nan)\n",
" cruise_data_update['sigma_t_ch1'].values = sigup\n",
" temperature=pandas_csv.temperature_ch1,\n",
" depth=pandas_csv.depth)\n",
" cruise_data_update['sigma_t_ch1'] = sigup\n",
" \n",
" sigup2 = sigmat_update(salinity=pandas_csv.salinity_ch2,\n",
" temperature=pandas_csv.temperature_ch2)\n",
" cruise_data_update['sigma_t_ch2'] = (['time','latitude','longitude','depth'],(sigup2 * 0) + np.nan)\n",
" cruise_data_update['sigma_t_ch2'].values = sigup2 \n",
" temperature=pandas_csv.temperature_ch2,\n",
" depth=pandas_csv.depth)\n",
" cruise_data_update['sigma_t_ch2'] = sigup2\n",
" \n",
" #update \n",
" #need to update any other oxy conc units too\n",
Expand Down Expand Up @@ -328,9 +359,9 @@
"hash": "bc96f01bfc9d2c897ec898f99e5079e1d7ab4b93a6c269a5e00afdb6d52f3b37"
},
"kernelspec": {
"display_name": "Python [conda env:py311] *",
"display_name": "Python [conda env:p312]",
"language": "python",
"name": "conda-env-py311-py"
"name": "conda-env-p312-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -342,7 +373,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.10"
"version": "3.12.8"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"source": [
"# Using EcoFOCIpy to process raw field data\n",
"\n",
"## DY2410 (Fall Mooring Cruise - Dyson)\n",
"## DY2407 (Spring Mooring Cruise - Dyson)\n",
"\n",
"## BO Oxygen Data\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"id": "studied-pollution",
"metadata": {
"tags": []
Expand All @@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"id": "offensive-level",
"metadata": {
"tags": []
Expand All @@ -47,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 7,
"id": "third-yellow",
"metadata": {
"tags": []
Expand Down Expand Up @@ -100,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 8,
"id": "f0fb5c09-d76d-455c-89f4-3ba6a7954f00",
"metadata": {
"tags": []
Expand Down Expand Up @@ -217,43 +217,29 @@
" <td>7</td>\n",
" <td>414.924500</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>5/20/2024</td>\n",
" <td>1148</td>\n",
" <td>444.936998</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>5/24/2024</td>\n",
" <td>440</td>\n",
" <td>422.563636</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Cast Niskin O2 (uM)\n",
"0 1 1 378.676337\n",
"1 1 2 360.325790\n",
"2 1 3 391.045738\n",
"3 1 4 403.876479\n",
"4 1 5 410.724907\n",
"5 1 6 441.293469\n",
"6 1 7 447.402320\n",
"7 2 1 387.668718\n",
"8 2 2 379.812731\n",
"9 2 3 371.404091\n",
"10 2 4 372.886771\n",
"11 2 5 393.445621\n",
"12 2 6 415.333062\n",
"13 2 7 414.924500\n",
"14 5/20/2024 1148 444.936998\n",
"15 5/24/2024 440 422.563636"
" Cast Niskin O2 (uM)\n",
"0 1 1 378.676337\n",
"1 1 2 360.325790\n",
"2 1 3 391.045738\n",
"3 1 4 403.876479\n",
"4 1 5 410.724907\n",
"5 1 6 441.293469\n",
"6 1 7 447.402320\n",
"7 2 1 387.668718\n",
"8 2 2 379.812731\n",
"9 2 3 371.404091\n",
"10 2 4 372.886771\n",
"11 2 5 393.445621\n",
"12 2 6 415.333062\n",
"13 2 7 414.924500"
]
},
"execution_count": 4,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -265,7 +251,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 9,
"id": "ec15a06d-f7e3-4a0e-880a-2bb48beef0bd",
"metadata": {},
"outputs": [],
Expand All @@ -283,7 +269,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 10,
"id": "586c00a1-4b89-4488-927c-a9d84df24225",
"metadata": {
"tags": []
Expand Down Expand Up @@ -311,7 +297,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 11,
"id": "freelance-fairy",
"metadata": {
"tags": []
Expand All @@ -336,7 +322,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 12,
"id": "checked-raise",
"metadata": {
"tags": []
Expand All @@ -357,7 +343,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 13,
"id": "24b2c8b0",
"metadata": {
"tags": []
Expand All @@ -380,7 +366,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 14,
"id": "modular-volunteer",
"metadata": {
"scrolled": true,
Expand Down
Loading

0 comments on commit ead101b

Please sign in to comment.