Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates in response to code review #232

Merged
merged 8 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions scripts/aqd_make_press_ac.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import division, print_function\n",
"import stglib\n",
"import matplotlib.pyplot as plt\n",
"import xarray as xr\n",
Expand All @@ -38,8 +37,7 @@
"outputs": [],
"source": [
"def read_met_data(filename):\n",
" a = pd.read_csv(filename, header=2, parse_dates=[2],\n",
" infer_datetime_format=True, index_col=2)\n",
" a = pd.read_csv(filename, header=2, parse_dates=[2], index_col=2)\n",
"\n",
" # add 6 hours to get to UTC (but remian naive)\n",
" a.index = a.index + pd.Timedelta('6 hours')\n",
Expand Down Expand Up @@ -68,10 +66,10 @@
"outputs": [],
"source": [
"# Load the raw Aquadopp data\n",
"RAW = xr.open_dataset(basedir + '10761Aaqd-raw.cdf', autoclose=True)\n",
"RAW = xr.load_dataset(basedir + '10761Aaqd-raw.cdf')\n",
"\n",
"# Load the met data\n",
"gndcrmet = xr.open_dataset(basedir + 'gndcrmet.nc', autoclose=True)\n",
"gndcrmet = xr.load_dataset(basedir + 'gndcrmet.nc')\n",
"\n",
"met = gndcrmet['BP'] # make a new met variable\n",
"met = met.rename('atmpres') # rename it to the standard atmpres variable name\n",
Expand All @@ -85,7 +83,9 @@
"metadata": {},
"source": [
"## Load clean data\n",
"Note that you need to run the proper run scripts with your generated atmpres.cdf files... this only uses example files."
"Note that you need to run the proper run scripts with your generated atmpres.cdf files... this only uses example files.\n",
"\n",
"Note also that the load_clean function below is set up to deal with older EPIC files. Files generated with modern versions of stglib will be in CF Conventions, but the process of generating an atmospheric pressure file is essentially the same."
]
},
{
Expand All @@ -99,7 +99,7 @@
"\n",
" ds = xr.open_dataset(basedir + filename, decode_times=False, autoclose=True)\n",
" ds['time'] = ds['time_cf']\n",
" ds = ds.drop('time2')\n",
" ds = ds.drop_vars('time2')\n",
" \n",
" return xr.decode_cf(ds)\n",
"\n",
Expand Down Expand Up @@ -136,7 +136,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -150,9 +150,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
203 changes: 0 additions & 203 deletions scripts/dw_make_press_ac.ipynb

This file was deleted.

Loading
Loading