Skip to content

Output filtered data to a netCDF file #14

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

Merged
merged 11 commits into from
Nov 12, 2019
Merged

Output filtered data to a netCDF file #14

merged 11 commits into from
Nov 12, 2019

Conversation

angus-g
Copy link
Owner

@angus-g angus-g commented Aug 7, 2019

Using the source files, and the variable/dimension dictionaries, a netCDF dataset is created to hold the filtered data. The approach I've taken here is pretty ugly, and makes too many assumptions. Ideally, I'd like to use xarray to do most of the work, but incremental writes to a dataset are one of the unsupported operations.

See #1.

@angus-g angus-g added the help wanted Extra attention is needed label Aug 7, 2019
@angus-g angus-g force-pushed the netcdf-outfile branch 2 times, most recently from 23cc698 to 132e6c2 Compare August 27, 2019 06:46
@angus-g angus-g force-pushed the netcdf-outfile branch 2 times, most recently from 52fd8e8 to c8d70a7 Compare October 24, 2019 01:12
@angus-g angus-g added incomplete This feature isn't ready yet and removed help wanted Extra attention is needed labels Oct 24, 2019
@angus-g
Copy link
Owner Author

angus-g commented Oct 24, 2019

While I believe I have the core functionality and some unit tests in place, I don't know whether this is quite ready for a merge. However, it does deserve some real-world testing. One issue I suspect will become more apparent is #27 (warn on existing output), since this will wipe existing filtered output with an experiment of the same name!

I've tagged this as 0.4.0beta1, and uploaded to conda under the beta label. To install from the beta label, run conda install --override -c angus-g/label/beta lagrangian-filtering. Installations using pip -e can checkout the netcdf-outfile branch.

@angus-g angus-g added testing This is under active testing and removed incomplete This feature isn't ready yet labels Oct 24, 2019
@angus-g angus-g mentioned this pull request Oct 29, 2019
Using the source files, and the variable/dimension dictionaries, a
netCDF dataset is created to hold the filtered data. The approach I've
taken here is pretty ugly, and makes too many assumptions. Ideally,
I'd like to use xarray to do most of the work, but incremental writes
to a dataset are one of the unsupported operations.
This is really just the most basic case, and doesn't cover any tricky
corner cases.
This adds a few more test cases. In particular, the staggered test
case caught missing behaviour when variables have their own separate
dimensions (as is the case for staggered variables).
I had been testing wildcard filenames before, and in those cases it
seems like parcels expanded the wildcard when creating the
FieldSet. However, with two wildcards, this wasn't happening. We
manually expand wildcards when querying the input datasets for the
metadata needed to create the output file.

Closes #34.
This adds a flag to filtering and create_out to control whether an
existing output file should be clobbered or not.

Closes #27.
For example, a data variable might only have dims ("time", "lat",
"lon"), but a "depth" dimension was specified in indices.
@angus-g angus-g merged commit 5ba358b into master Nov 12, 2019
@angus-g angus-g deleted the netcdf-outfile branch November 12, 2019 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing This is under active testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant