[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #KZG-517636]: NetCDF Python Mask Values Question



Hi Arturo,

I think I've got it figured out. Just append [:] to ndvi = f["NDVI"], (i.e. 
ndvi = f["NDVI"][:]. I get numbers now for the values array. Hope that solves 
the issue!

Zach


>When I try the subset of data in the example (I used that as an example), I do 
>get masked values where as if I import the netcdf file as a raster to GIS I 
>can see values where python shows masked values. Somebody suggested using the 
>set_auto_maskandscale property to False. Doing that I can see the masked 
>values. They explained netcdf-python masks values that are outside the valid 
>range for that variable.
> 
> 
> 
> -----Original Message-----
> From: Unidata Python Support <address@hidden>
> Sent: Tuesday, June 04, 2019 3:16 PM
> Subject: [netCDF #KZG-517636]: NetCDF Python Mask Values Question
> 
> 
> CAUTION: This email originated from outside of the University. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
> 
> Hi Arturo,
> 
> 
> 
> I downloaded your dataset and tried playing around with it and was able to 
> replicate everything you shared. I do not see anywhere in your subset where 
> the mask is False (i.e. there's an actual value there). Outside of the subset 
> (in the NDVI array), there are indices were the mask is False. Are you 
> expecting data within the subsetted region? More information regarding your 
> issue would be helpful!
> 
> 
> 
> Best regards,
> 
> Zach Bruick
> 
> 
> 
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncei.noaa.gov_data_avhrr-2Dland-2Dnormalized-2Ddifference-2Dvegetation-2Dindex_access_2015_AVHRR-2DLand-5Fv004-5FAVH13C1-5FNOAA-2D19-5F20150102-5Fc20150730112535.nc&d=DwIDaQ&c=H5Iu-V89wgp5zRbL6y0Ptc2lgooFyRqrlrd-0IU1a1U&r=HtzQHFEmA2BtGmNDc-DwxPbZUHPrMw2dGKTDRQvZRM4&m=x09Nrt6vFBaTeqiBUDH2uvT8jk8S_75U7RUYA8XHveA&s=oHcdpqpEVhklYpwSnCY8Ryq7Bbjv82f7n2TJd9dNs1s&e=
> 
> >
> 
> > In the above file many subsets of data appear to be masked but when I 
> > convert files using ArcGIS software there are no mask values.
> 
> >
> 
> > For example doing the following:
> 
> >
> 
> > f = 
> > Dataset(r"E:\AVHRR_New\2015\AVHRR-Land_v004_AVH13C1_NOAA-19_20150102_c20150730112535.nc")
> 
> >
> 
> > ndvi = f["NDVI"]
> 
> >
> 
> > values = ndvi[0,820:823,1150:1153]
> 
> >
> 
> > values
> 
> > Out[5]:
> 
> > masked_array(
> 
> > data=[[--, --, --],
> 
> > [--, --, --],
> 
> > [--, --, --]],
> 
> > mask=[[ True,  True,  True],
> 
> > [ True,  True,  True],
> 
> > [ True,  True,  True]],
> 
> > fill_value=-9999,
> 
> > dtype=float64)
> 
> >
> 
> > However, the same array area in ArcGIS does show values as well as 
> > accessing the same in Matlab. Is this a bug in the python library? I had 
> > never encountered such an issue.
> 
> >
> 
> > Any help would be appreciated
> 
> >
> 
> 
> 
> Ticket Details
> 
> ===================
> 
> Ticket ID: KZG-517636
> 
> Department: Support Python
> 
> Priority: Normal
> 
> Status: Open
> 
> ===================
> 
> NOTE: All email exchanges with Unidata User Support are recorded in the 
> Unidata inquiry tracking system and then made publicly available through the 
> web.  If you do not want to have your interactions made available in this 
> way, you must let us know in each email you send to us.
> 
> 
> 
> 
> 
> 

Ticket Details
===================
Ticket ID: KZG-517636
Department: Support Python
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.