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

Selector problems with reversed dims #56

Closed
Mattriks opened this issue Aug 14, 2020 · 6 comments
Closed

Selector problems with reversed dims #56

Mattriks opened this issue Aug 14, 2020 · 6 comments

Comments

@Mattriks
Copy link
Contributor

I tried to extract time series from an ocean dataset e.g. ersstv5.nc that has Lat = Float32[88.0, 86.0, …, -86.0, -88.0]. The point 100°E, 40°N is clearly land, but extracting this point shows ocean temperatures:

sst = NCDstack("ersstv5.mnmean.nc")[:sst]
sst[Lat(At(40)), Lon(At(100))]

Float32[13.2772, 14.0097, 13.6713,     11.1825, 11.3001, 12.3442]

And the reflected point (which is in ocean) has all missing values:

sst[Lat(Near(-40)), Lon(Near(100))]

Float32[-9.96921f36, -9.96921f36, -9.96921f36,    -9.96921f36, -9.96921f36, -9.96921f36]
@rafaqz
Copy link
Owner

rafaqz commented Aug 14, 2020

Yep I'm just in the process of trying to track down the last of these bugs.

Can you upload the file somewhere? That's probably the easiest way to fix this.

@Mattriks
Copy link
Contributor Author

ftp:https://ftp.cdc.noaa.gov/Datasets/noaa.ersst.v5/sst.mon.ltm.1981-2010.nc (1mb)

@rafaqz
Copy link
Owner

rafaqz commented Aug 14, 2020

It plots upside down too. My tests are are all with files with forward order latitudes, so thanks for catching this. There's a lot of detail to getting this all right for every format...

@rafaqz
Copy link
Owner

rafaqz commented Aug 14, 2020

Ok fixed :)

I'll push it through sometime today.

@rafaqz
Copy link
Owner

rafaqz commented Aug 14, 2020

Ok that's on master now. Let me know any other issues you have, I'm keen to make a release this week.

@rafaqz
Copy link
Owner

rafaqz commented Aug 14, 2020

And by the way - for some reason NCDatasets,jl is not picking up the missing value in that file.

You can set it manually by passing the kwarg for the array constructor to the stack:

A = NCDstack(file; childkwargs=(missingval=-9.96921f36,))[:sst]

And convert it to missing with replace_missing(A) if you need to.

@rafaqz rafaqz closed this as completed Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants