Closed chironbang closed 1 year ago
Hi, It is not clear to me why you get a difference. Can you post your code for this comparison, so that I can try to reproduce? Though I would probably need to use another dataset unless you can also share a minimalistic file from MITgcm.
Hi,
It turns out that the netCDF CF generic reader reads these data wrongly, as the order of dimension is lat, lon
, and not lon, lat
.
This is not the most common, and I believe it violates the COARDS convention, but not the CF convention.
Is this raw output from the MIT model, or something that you post processed?
In the latter case, a workaround could be to switch dimension, e.g. with Nco:
ncpdq -a lat,lon MITgcm.nc MIT_swapped.nc
Anyway, we should try to make the netCDF_CF_generic reader more robust by handling any ordering of dimensions.
It is not the raw output but something I post-processed. I swapped it as you suggested and it works. Thank you!
Hello,
I am trying to generate virtual drifters by providing a velocity field (I used MITgcm from UC San Diego ). I exported the data, and when plotting the velocity vectors along a drifter's trajectory, they seem to make sense (the velocity vector is tangent to the trajectory). Nevertheless, I noticed that the data from the reader extracted using the method
get_timeseries_at_position
do not match the actual velocity field. I queried the eastward velocity at an existing location (so I guess interpolation is not the issue here).The reader class I used is
reader_netCDF_CF_generic.Reader
. I usednetCDF4
andPandas
to load, create then extract the time series at that location to compare with whatget_timeseries_at_position
gave me.My code is adapted from the Drifter tutorial available on the OpenDrift website.
The only velocity I loaded are eastward and northward (no wind data provided). And the reader printout is:
Any insight would be appreciated.
By the way, thank you for the library, it is really helpful.
Chiron