-----Original Message-----
From: John Caron [mailto:address@hidden]
Sent: 16 September 2010 14:06
To: Jon Blower
Subject: Re: [Ncwms-users] transparent pixels
it should work for all data types.
Jon Blower wrote:
Ah, yes, I do use NaN to decide on missing values. I notice that
GridDatatype.isMissingData() always takes a double as an argument.
Will
this work for integer data types too?
The utility routine might be useful but TBH it would be just as easy
for
me to use GridDatatype.isMissingData() if this works on all data
types.
Cheers, Jon
*From:* John Caron [mailto:address@hidden]
*Sent:* 16 September 2010 01:02
*To:* Jon Blower
*Cc:* Ethan Davis
*Subject:* Fwd: RE: [Ncwms-users] transparent pixels
Hi Jon:
Im guessing on the following:
You use NaN to decide on missing values. But this is only used if the
data type is float or double. In the case of integral data types, you
have to test for missing data explicitly by doing
GridDatatype.isMissingData(val);
I could perhaps offer a utility routine that does that for you,
converted to floats as needed, so you can uniformly test for NaN.
Perhaps:
Array result = GridDatatype.setMissingData(Array org);
let me know if you think this is really the problem.
-------- Original Message --------
*Subject: *
RE: [Ncwms-users] transparent pixels
*Date: *
Tue, 14 Sep 2010 13:04:26 +1000
*From: *
Johan <address@hidden> <mailto:address@hidden>
*To: *
'John Caron' <address@hidden> <mailto:address@hidden>
Hi John,
Attached are some sample nc files and a sample ncml aggregation file.
The nc filenames start with the variable datatype followed by any
attributes
that are present, such as _FillValue, missing_value, add_offset,
scale_factor.
The only files that work properly are
float32_fill.nc
int8_fill_offset_scale.nc
int8_fill_missing_offset_scale_20100913T233200.nc
The latter is also used in the ncml aggregation file. Unfortunately, I
cannot reproduce the problem associated with that anymore... Not sure
what
was going on there yesterday. Basically, when I looked at the service
in
godiva2, some map tiles were transparent and others were not,
seemingly at
random. I'll let you know if I can replicate it.
Thanks,
Johan
-----Original Message-----
From: John Caron [mailto:address@hidden]
Sent: Tuesday, 14 September 2010 12:34 AM
To: Johan
Cc: address@hidden
<mailto:address@hidden>
Subject: Re: [Ncwms-users] transparent pixels
Hi Johan:
If you can send me some sample files where you see these problems,
i'll try
to figure out whats going on. thanks.
John
Johan wrote:
Thanks Ethan, Pauline and Peter, who responded to my request.
I'll share my solution/workaround with the group in case anyone comes
across
the same problem.
I followed the documentation on using missing_value, _FillValue, and
valid_min, valid_max attributes. None of this worked for me. I should
point
out that I'm generating netcdf files using the python NETCDF4 library
and
the datatype of my variable is 8-bit integer. I'm using ncWMS-1.0RC2.
When I change the datatype to float (32bit) it works fine, but this
obviously wastes a lot of resources. 16-bit integers did not work
either.
Then I used 8-bit integer with attributes 'add_offset=0.0' and
'scale_factor=1.0', and that works! So that's my workaround for now.
The
only drawback is that the service returns decimal numbers instead of
integers.
Interestingly, if I add both the attribute 'missing_value' and
'_FillValue'
the result depends on how the file is read. Reading the file via an
NcML
aggregation results in partial success only, with some images being
transparent but not all. Reading the file directly works fine.
So I omit the 'missing_value' attribute for this reason.
Cheers,
Johan
Dr Johan Swinnen
GIS Developer
Navy Hydrography and METOC Branch
p: 02 9359 3130 | f: 02 9359 3120 | w: http://www.metoc.gov.au
-----Original Message-----
From: Ethan Davis [mailto:address@hidden]
Sent: Friday, 10 September 2010 12:54 AM
To: address@hidden
<mailto:address@hidden>
Subject: Re: [Ncwms-users] transparent pixels
Hi Johan,
The "Writing NetCDF Files: Best Practices" document has a section on
"Missing Data Values" here
http://www.unidata.ucar.edu/software/netcdf/docs/BestPractices.html#Miss
ing%
20Data%20Values
Another option it doesn't mention at the moment is missing_value.
I believe all the options (missing_value, _FillValue, and valid
range/min/max) are recognized by ncWMS.
Note: Yes, missing_value was deprecated for awhile but, being more
obvious than _FillValue, it is coming back into favor. It will be
added
to the above document soon.
Ethan
On 9/8/2010 2:12 AM, Peter Walker wrote:
Hi Johan,
On 09/08/2010 07:40 AM, Johan wrote:
Hi,
Does anyone know how to make a particular pixel value transparent?
Say
I have a netcdf file with pixel values in the range 0 to 255 and I
don't want to see the 0 values because they represent 'no data'.
Can
this be done?
Have you tried setting the _FillValue for that variable to 0 in the
NetCDF file?
Cheers,
Pete
I've tried changing the GetMap parameters 'bgcolor' and
'transparent'
but they only seem to affect pixels outside the spatial extent of
the
netcdf file, not pixels present in the netcdf file. Are there
perhaps
any configurations inside the netcdf file that can be used which
ncWMS
understands?
Thanks,
Johan
Dr Johan Swinnen
GIS Developer
Navy Hydrography and METOC Branch
p: 02 9359 3130 | f: 02 9359 3120 | w: http://www.metoc.gov.au
<http://www.metoc.gov.au/>
------------------------------------------------------------------------
----
--
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ncwms-users mailing list
address@hidden
<mailto:address@hidden>
https://lists.sourceforge.net/lists/listinfo/ncwms-users
------------------------------------------------------------------------
Plymouth Marine Laboratory
Registered Office:
Prospect Place
The Hoe
Plymouth PL1 3DH
Website: www.pml.ac.uk <http://www.pml.ac.uk> <http://www.pml.ac.uk>
Registered Charity No. 1091222
PML is a company limited by guarantee
registered in England & Wales
company number 4178503
Please think before you print.
------------------------------------------------------------------------
This e-mail, its content and any file attachments are confidential.
If you have received this e-mail in error please do not copy,
disclose
it to any third party or use the contents or attachments in any way.
Please notify the sender by replying to this e-mail or e-mail
address@hidden <mailto:address@hidden> and then delete the
email without making any copies or
using it in any other way.
The content of this message may contain personal views which are not
the
views of Plymouth Marine Laboratory unless specifically stated.
You are reminded that e-mail communications are not secure and may
contain viruses. Plymouth Marine Laboratory accepts no liability for
any
loss or damage which may be caused by viruses.
------------------------------------------------------------------------
------------------------------------------------------------------------
----
--
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ncwms-users mailing list
address@hidden
<mailto:address@hidden>
https://lists.sourceforge.net/lists/listinfo/ncwms-users
------------------------------------------------------------------------
----
--
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ncwms-users mailing list
address@hidden
<mailto:address@hidden>
https://lists.sourceforge.net/lists/listinfo/ncwms-users
------------------------------------------------------------------------
----
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Ncwms-users mailing list
address@hidden
<mailto:address@hidden>
https://lists.sourceforge.net/lists/listinfo/ncwms-users