-
Notifications
You must be signed in to change notification settings - Fork 94
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
YAML area configuration does not allow to specify the dtype and dtype is ignored in equality comparisons #590
Comments
I would consider dtype in the init method deprecated. At least it will not be included in future versions of the area definition class or at least not the ones I have planned. |
How would you recommend user controlling the dtype when resampling? Keyword argument to |
I'm tempted to say resampling should always use 64-bit floats for projected areas and optionally/possibly do 32-bit floats for lon/lats (degrees) coordinate systems. |
I run out of memory with 64-bit floats, but my code completes fine when I force them to be 32 bits (projected area). |
Are the lon/lats being forced to 32-bit in your changes or the x/y coordinates? We've (Panu and me at least) discussed in the past on slack that 64-bit is required for x/y meter accuracy in most projections, but is way overkill for lon/lat degrees. At least that's my memory. |
Also, if this is running out of memory (OOM) with the "nearest" resampler then it is likely the generation of the KDTree that is the major contributor to the memory usage as the entire thing has to exist in memory at once (no dask chunking). The KDTree involves 3 axes (x, y, z) of geocentric coordinates...but I thought that was always 64-bit so I might be wrong about the dtype of the lon/lats contributing to this. |
Today I learned that an areadefinition has a dtype attribute. This seems to be not very well documented and not very well supported, but it's relevant. It is used at least in
get_lonlats()
, which is used in resampling, so changing the dtype can have considerable memory implications and make the difference between having enough RAM or not.Code Sample, a minimal, complete, and verifiable piece of code
Problem description
Executing the code reveals several problems:
ar.dump()
does not output the dtypear
andar2
are considered equal despite having different dtypesar3
, loaded from a string that does encode the dtype, getsfloat64
despite the YAML definition statingfloat32
.It does not appear to be possible to specify the dtype in the YAML configuration (nor in
pyresample.create_area_def()
).Expected Output
Actual Result, Traceback if applicable
Versions of Python, package at hand and relevant dependencies
pyresample main (v1.28.2-2-g711f354)
The text was updated successfully, but these errors were encountered: