junxiemq / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

[request] add roll and region functions #174

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In particular with global data sets, I have been experiencing that a grid 
boundary goes right through my region of interest. In that case, I usually use 
np.roll or similar, with the inconvenience that I have to load the data into 
memory and then apply the shift explicitly for all the variables I access.

It would be very convenient if the roll parameters could be set when opening a 
netCDF4.Dataset or via a function Dataset.set_roll(shift,dimension) or the like.

Similarly, being able to select a region of the dataset once for all variables 
in a Dataset would be of great utility.

Both functions actually only require a mapping of the indices in __getitem__.

Any chance that these functions will be added in the future?

Original issue reported on code.google.com by jbndmi on 22 Apr 2013 at 4:37

GoogleCodeExporter commented 8 years ago
I'm guessing your problem is specific to global datasets for domains that 
straddle the periodic boundary?  While I appreciate the inconvenience this 
causes, I'm skeptical about building this in to the library.  Seems like it is 
best handled by a custom convenience function that could be loaded as needed.  
If you would like to contribute one, I could add it to netCDF4_utils.

Original comment by whitaker.jeffrey@gmail.com on 22 Apr 2013 at 5:45

GoogleCodeExporter commented 8 years ago
You guessed right. I see your point that this issue is perhaps too specific for 
the general library. I will consider contributing a function to the utils 
library. Thanks for your comment!

Original comment by jbndmi on 24 Apr 2013 at 2:55

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04