<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Jalal,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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.<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It's always important to look at your data when you get errors like this. You do have:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">printVarSummary(ndvi)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">but I also added:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">printVarSummary(ndvi&lat)</div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">printVarSummary(ndvi&lon)</div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">in order to look at the lat/lon arrays to see what the units were and you can see there are none:</div><div class="gmail_default" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><div class="gmail_default">Variable: lat (coordinate)</div><div class="gmail_default">Type: double</div><div class="gmail_default">Total Size: 17280 bytes</div><div class="gmail_default"> 2160 values</div><div class="gmail_default">Number of Dimensions: 1</div><div class="gmail_default">Dimensions and sizes:<span style="white-space:pre"> </span>[lat | 2160]</div><div class="gmail_default">Coordinates: </div><div class="gmail_default">Number Of Attributes: 0</div><div class="gmail_default"><br></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To fix this, I did this after reading in ndvi:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace"> ndvi = f->ndvi(0,:,:)</font></div><div class="gmail_default"><font face="monospace, monospace"> ndvi&lat@units = "degrees_north" ; Fix the units</font></div><div class="gmail_default"><font face="monospace, monospace"> ndvi&lon@units = "degrees_east"</font></div><div class="gmail_default"><font face="monospace, monospace"> printVarSummary(ndvi)</font></div><div class="gmail_default"><br>I also had to remove the reference to "ndvi@long_name" in a later title string, because ndvi doesn't have a long_name attribute.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 9, 2018 at 3:44 AM, Md. Jalal Uddin <span dir="ltr"><<a href="mailto:dmjalal90@gmail.com" target="_blank">dmjalal90@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I tried to plot gimms ndvi (<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><a href="https://ecocast.arc.nasa.gov/data/pub/gimms/3g.v1/" target="_blank">https://ecocast.<wbr>arc.nasa.gov/data/pub/gimms/<wbr>3g.v1/</a>) </span>data by masking. I am getting following errors. I used <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">copy_VarCoords(ndvi,ndvi_mask) command to fix it but failed. Please help to solve this problem. Please find my script in the attachment.</span></div><div><br></div><div><div>(0)<span style="white-space:pre-wrap"> </span>check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.</div><div>(0)<span style="white-space:pre-wrap"> </span>A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: </div><div>(0)<span style="white-space:pre-wrap"> </span> 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'</div><div>(0)<span style="white-space:pre-wrap"> </span>check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.</div><div>(0)<span style="white-space:pre-wrap"> </span>A valid longitude coordinate array should have a 'units' attribute equal to one of the following values: </div><div>(0)<span style="white-space:pre-wrap"> </span> 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'</div><div>(0)<span style="white-space:pre-wrap"> </span>check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.</div><div>(0)<span style="white-space:pre-wrap"> </span>A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: </div><div>(0)<span style="white-space:pre-wrap"> </span> 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'</div><div>(0)<span style="white-space:pre-wrap"> </span>check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.</div><div>(0)<span style="white-space:pre-wrap"> </span>A valid longitude coordinate array should have a 'units' attribute equal to one of the following values: </div><div>(0)<span style="white-space:pre-wrap"> </span> 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'</div><div>warning:Attempt to reference attribute (long_name) which is undefined</div><div><br></div><div>Cheers,</div><div>Jalal</div>-- <br><div class="m_-8868263182315960922gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font color="#000000" size="2"><b>Md. Jalal Uddin</b></font></div><div dir="ltr">MSc in Applied Meteorology (English Language)<br>Nanjing University of Information, Science and Technology, China</div><div dir="ltr">Jasmine Jiangsu Government Scholar<br>Cell: +8613260859092</div><div>Office: Beichen Building, School of Geography and Remote Sensing, Room No. 406</div><div dir="ltr"><font color="#000000" style="background-color:rgb(255,255,255)"><b><br></b></font></div><div dir="ltr"><font color="#000000" style="background-color:rgb(255,255,255)"><b>AND </b></font></div><div dir="ltr">B.Sc. in Disaster Management (Hons.) </div><div dir="ltr">Patuakhali Science and Technology University, Bangladesh.<br>Cell: +8801792052662, +8801838613203 </div><div dir="ltr"><font size="2">Email:<b> </b><a href="mailto:dmjalal90@gmail.com" target="_blank">dmjalal90@gmail.com</a><br>Web: <a href="http://www.dmjalal90.weebly.com" target="_blank">www.dmjalal90.weebly.com</a> <br>Facebook: jalal.hossen.39 <br>LinkedIn: <a href="https://bd.linkedin.com/in/md-jalal-uddin-80a026b0" target="_blank">https://bd.linkedin.com/in/md-<wbr>jalal-uddin-80a026b0</a> <br>Twitter: dmjalal90 <br>Skype: dmjalal90</font><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>