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

Add content on wrangling netCDF files? #7

Open
DamienIrving opened this issue Jun 28, 2018 · 1 comment
Open

Add content on wrangling netCDF files? #7

DamienIrving opened this issue Jun 28, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@DamienIrving
Copy link
Collaborator

DamienIrving commented Jun 28, 2018

It would be nice to add a lesson on wrangling netCDF files.

The premise for the lesson could be that we want to download some ERA-Interim precipitation data (total precipitation, synoptic monthly mean) to compare to our models. Wrangling that data would involve something like the following (from here) to have the ERA-Interim data dimensions and attributes match the CMIP5 data files:

ncpdq -P upk ${infile} {infile}
cdo invertlat -sellonlatbox,0,359.9,-90,90 -mulc,33 -monsum ${infile} ${outfile}
ncrename -O -v tp,pr ${outfile}
ncatted -O -a calendar,global,d,, ${outfile}
ncatted -O -a standard_name,pr,o,c,"precipitation_flux" ${outfile}
ncatted -O -a long_name,pr,o,c,"precipitation flux" ${outfile}
ncatted -O -a units,pr,o,c,"mm/day" ${outfile}

(The -mulc,33 covers mutliplying by 1000 to convert the units from m/month to mm/month and then dividing by 30 to crudely convert to mm/day.)

The main barrier to this lesson is that cdo isn't available on windows and the conda-forge recipe for Mac is broken: conda-forge/cdo-feedstock#15

I love the convenience of cdo, but the fact that it essentially only works on Linux machines is very problematic. To get around this, I could do the cdo parts of the wrangling on a Linux machine in advance and provide the final file for download - the participants could then do the nco parts?

Other useful links:

@DamienIrving DamienIrving added the enhancement New feature or request label Jun 28, 2018
@DamienIrving DamienIrving changed the title netCDF lesson Add content on wrangling netCDF files? Jul 3, 2018
@MathewBiddle
Copy link

It would be nice to do something a little higher level wrt netCDF. How to work with netCDF in Python is a question I get quite frequently. Most of the examples are using gridded model (or satellite) output. However, netCDF has various other featureTypes (like profile, timeseries, etc) that are a little easier to understand from the get-go. A lesson giving the background on netCDF and the various conventions which can be applied would be helpful. Then, showing how to not only open and investigate data, but how to create and manage netCDF would be helpful.

We have a couple examples in the IOOS code gallery which could be expanded upon into a lesson here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants