Hi William
What are the missing_value and/or _FillValue flags for the
variable? It sounds as if there is only a scale_factor and not an
add_offset attribute, is that correct?
I've made some little test datasets and I see this behavior in
one instance. Below is a ncdump of my file. If the variable's
attributes include both
missing_value and _FillValue attributes, or if it has only a
_FillValue attribute, then things work correctly. If it has only a
missing_value, then as you reported, zero is treated as a bad
value in listings and SHADE plots. This particular example does
the same thing with older versions, not just v7.5.
So thank you for the report; we'll have a look.
Example file:
> ncdump test.nc
netcdf test {
dimensions:
xax = 3 ;
yax = 2 ;
variables:
double xax(xax) ;
xax:point_spacing = "even" ;
xax:axis = "X" ;
double yax(yax) ;
yax:point_spacing = "even" ;
yax:axis = "Y" ;
float var(yax, xax) ;
var:missing_value = -1.e+34f ;
var:_FillValue = -1.e+34f ;
var:scale_factor = 1000. ;
var:long_name = "example variable" ;
// global attributes:
:history = "PyFerret V7.5 (optimized) 2-Aug-19" ;
:Conventions = "CF-1.6" ;
data:
xax = 1, 2, 3 ;
yax = 1, 2 ;
var =
1.1, 0, 2.2,
3.3, 4.4, 4.8 ;
}
On 8/2/2019 9:58 AM, William Lipscomb
wrote:
Hello,
I'm new to this list and to PyFerret (though I've used
Ferret for a while). I'm having an issue plotting fields with
the netCDF scale_factor attribute. For example, I have a 2D
field "thck" (type float) with scale_factor = 1000., and with
values of 0.0 in parts of the domain. It seems that ferret
gets confused about the zero values.
- When I type "list thck", then wherever the value is 0.0,
I see four dots instead of the value.
- When I type "shade thck", then wherever the value is
0.0, I get a white background instead of the color
corresponding to 0.0.
A manual fix is to use NCO to delete the scale_factor
attribute and then multiply thck by 1000. The zero values
are of course still zero, but now they list and plot
correctly.
I was wondering if this is a known issue and if there is
a workaround within Ferret, without removing the attribute.
I'm using PyFerret v7.5 (optimized) on a Mac, with Darwin
17.7.0. I have the same problem on Cheyenne, an NCAR HPC
using PyFerret 7.5 with Linux 4.12.14-94.41-default. I
don't recall having this issue with earlier versions of
Ferret (before PyFerret).
Thanks,
Bill
--
William Lipscomb
National Center for Atmospheric Research
Boulder, CO
(505) 699-8016
--
Ansley Manke
NOAA/PMEL Science Data Integration Group
7600 Sand Point Way NE
206-526-6246