When a coordinates are read in on initializing a dataset, they're checked for regular spacing using the data type of the coordinates in the file, so a floating-point axis is checked using single-precision testing.
But, on writing a netCDF dataset, Ferret/PyFerret always writes coordinates in double precision.
It looks as though we changed the testing for regular-spacing somewhere at about version 7.4, and I'll have a look at that. Also, we've been working along in general on changes so that any netCDF files that Ferret writes as subsets or otherwise based on netcdf files, match what is in the input files. Things like upcasing variable names and ignoring attributes should at least be controllable. In recent versions we write data using the same data type as the input file, and it should be easy to do the same for axes, so for this example the y-axis would be written as single precision coordinate variable. So we'll have a look at that too.
Ansley
On 7/3/2020 6:51 AM, Ryo Furue wrote:
Ferret Team,
I searched our mailing archive but didn't find it there.
My original netCDF file has an x axis like
float lat = 9.95, 10.05, 10.15, . . .
without the "point_spacing=even" attribute.
I open the file in PyFerret and save just one timestep (L) into a new file:
save/file=tmp.nc/l=10 var
I then open this new file and PyFerret says,
*** NOTE: Axis "LAT" is irregular. Ignoring erroneous point_spacing=even attribute.
Indeed the new file has gotten the "point_spacing=even" attribute.
I come across this problem from time to time. (Today I reproduced this on PyFerret v7.5 on Linux.)
The axis is a single-precision real and the gridpoints may not be precisely represented. So, I'm not surprised that this axis isn't regarded as "even". That is, PyFerret is doing the right thing when it reads the new netCDF file. So, it's probably a mistake that it added the "even" attribute when it saved the data.
Strangely, the longitude axis -0.05, 0.05, 0.15, . . . , which originally didn't have a point_spacing attribute either, got a point_spacing = "uneven" attribute in the new file!
Cheers,Ryo
-- Ansley Manke Science Data Integration Group NOAA Pacific Marine Environmental Laboratory 7600 Sand Point Way NE Seattle WA 98115 I am currently teleworking and am available Tue-Wed-Thu.