[ncl-talk] NDVI_mask problem

Md. Jalal Uddin dmjalal90 at gmail.com
Thu May 10 06:00:07 MDT 2018


Thank you for your help. Mary's suggestions are working now. However, I am
getting following errors.

MissingToFillValue option set True, but missing_value attribute and data
variable (ndvi) types differ: not adding virtual _FillValue attribute

I also went to the NCL NDVI examples page (
https://www.ncl.ucar.edu/Applications/ndvi.shtml) and tried to follow
Example 2 that suggested by  Dennis Shea. I got output but received the
same problem.

How could I solve the problem?


On Wed, May 9, 2018 at 11:54 PM, Dennis Shea <shea at ucar.edu> wrote:

> If you go to NCL's Examples page:
>
>    https://www.ncl.ucar.edu/Applications/
>
> Under 'Datasets', click 'NDVI'
>
> There are three examples of differently sourced NDVI data sets.
>
> The 'GIMMS' version is Example 2.
>
> Please read the associated text description and the actual script.
> As noted, the netCDF file is poorly written.
>
>
>
> On Wed, May 9, 2018 at 8:14 AM, Mary Haley <haley at ucar.edu> wrote:
>
>> Hi Jalal,
>>
>> I took a look at one of these NDVI data files, and noticed that the
>> lat/lon coordinate arrays on the file have no attributes, which is not good.
>>
>> These arrays should at least have "units" and "long_name" attributes and
>> units should be something like "degrees_north" and "degrees_east".  For
>> rectilinear data (data with lat/lon coordinate arrays), NCL needs these
>> units to be something that indicates they are in degrees, or otherwise it
>> can't be sure it is plotting the data correctly.
>>
>> It's always important to look at your data when you get errors like
>> this.  You do have:
>>
>> printVarSummary(ndvi)
>>
>> but I also added:
>>
>> printVarSummary(ndvi&lat)
>> printVarSummary(ndvi&lon)
>>
>> in order to look at the lat/lon arrays to see what the units were and you
>> can see there are none:
>>
>> Variable: lat (coordinate)
>> Type: double
>> Total Size: 17280 bytes
>>             2160 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [lat | 2160]
>> Coordinates:
>> Number Of Attributes: 0
>>
>>
>> To fix this, I did this after reading in ndvi:
>>
>>   ndvi           = f->ndvi(0,:,:)
>>   ndvi&lat at units = "degrees_north"    ; Fix the units
>>   ndvi&lon at units = "degrees_east"
>>   printVarSummary(ndvi)
>>
>> I also had to remove the reference to "ndvi at long_name" in a later title
>> string, because ndvi doesn't have a long_name attribute.
>>
>> --Mary
>>
>> On Wed, May 9, 2018 at 3:44 AM, Md. Jalal Uddin <dmjalal90 at gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> I tried to plot gimms ndvi (https://ecocast.ar
>>> c.nasa.gov/data/pub/gimms/3g.v1/) data by masking. I am getting
>>> following errors. I used  copy_VarCoords(ndvi,ndvi_mask) command to fix
>>> it but failed. Please help to solve this problem. Please find my script in
>>> the attachment.
>>>
>>> (0) check_for_y_lat_coord: Warning: Data either does not contain a
>>> valid latitude coordinate array or doesn't contain one at all.
>>> (0) A valid latitude coordinate array should have a 'units' attribute
>>> equal to one of the following values:
>>> (0)     'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
>>> 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
>>> (0) check_for_lon_coord: Warning: Data either does not contain a valid
>>> longitude coordinate array or doesn't contain one at all.
>>> (0) A valid longitude coordinate array should have a 'units' attribute
>>> equal to one of the following values:
>>> (0)     'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
>>> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
>>> (0) check_for_y_lat_coord: Warning: Data either does not contain a
>>> valid latitude coordinate array or doesn't contain one at all.
>>> (0) A valid latitude coordinate array should have a 'units' attribute
>>> equal to one of the following values:
>>> (0)     'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
>>> 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
>>> (0) check_for_lon_coord: Warning: Data either does not contain a valid
>>> longitude coordinate array or doesn't contain one at all.
>>> (0) A valid longitude coordinate array should have a 'units' attribute
>>> equal to one of the following values:
>>> (0)     'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
>>> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
>>> warning:Attempt to reference attribute (long_name) which is undefined
>>>
>>> Cheers,
>>> Jalal
>>> --
>>> *Md. Jalal Uddin*
>>> MSc in Applied Meteorology (English Language)
>>> Nanjing University of Information, Science and Technology, China
>>> Jasmine Jiangsu Government Scholar
>>> Cell: +8613260859092
>>> Office: Beichen Building, School of Geography and Remote Sensing, Room
>>> No. 406
>>>
>>> *AND *
>>> B.Sc. in Disaster Management (Hons.)
>>> Patuakhali Science and Technology University, Bangladesh.
>>> Cell: +8801792052662, +8801838613203
>>> Email: dmjalal90 at gmail.com
>>> Web: www.dmjalal90.weebly.com
>>> Facebook: jalal.hossen.39
>>> LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0
>>> Twitter: dmjalal90
>>> Skype: dmjalal90
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
*Md. Jalal Uddin*
MSc in Applied Meteorology (English Language)
Nanjing University of Information, Science and Technology, China
Jasmine Jiangsu Government Scholar
Cell: +8613260859092
Office: Beichen Building, School of Geography and Remote Sensing, Room No.
406

*AND *
B.Sc. in Disaster Management (Hons.)
Patuakhali Science and Technology University, Bangladesh.
Cell: +8801792052662, +8801838613203
Email: dmjalal90 at gmail.com
Web: www.dmjalal90.weebly.com
Facebook: jalal.hossen.39
LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0
Twitter: dmjalal90
Skype: dmjalal90
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180510/9bf003d6/attachment.html>


More information about the ncl-talk mailing list