<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Noelia,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for the additional information. I admit I'm stumped, because it looks like you are doing everything right.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, there's an easier way to fix the longitudes, using the "lonFlip" function. Try this code instead:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><div class="gmail_default" style>;***********************************************************************</div><div class="gmail_default" style>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div class="gmail_default" style>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div class="gmail_default" style>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div class="gmail_default" style>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"</div><div class="gmail_default" style>;************************************************************************</div><div class="gmail_default" style>begin</div><div class="gmail_default" style><br></div><div class="gmail_default" style> ozfil = addfile("/work/users/nof/data/data_new/Ozone/grid1/seasons/Europe/<a href="http://mda8.surfO3.EU.2000.2009.settabs_JJA.nc">mda8.surfO3.EU.2000.2009.settabs_JJA.nc</a>","r")</div><div class="gmail_default" style><br></div><div class="gmail_default" style> wks = gsn_open_wks("X11","test")</div><div class="gmail_default" style> ;gsn_define_colormap(wks,"BlueDarkRed18")</div><div class="gmail_default" style><br></div><div class="gmail_default" style><br></div><div class="gmail_default" style> ;ozone</div><div class="gmail_default" style> oz = ozfil->MDA8_SurfO3</div><div class="gmail_default" style> oz = lonFlip(oz)</div><div class="gmail_default" style><br></div><div class="gmail_default" style> res = True</div><div class="gmail_default" style> res@gsnAddCyclic = False</div><div class="gmail_default" style> res@mpMinLonF = min(oz&lon)</div><div class="gmail_default" style> res@mpMinLatF = min(oz&lat)</div><div class="gmail_default" style> res@mpMaxLonF = max(oz&lon)</div><div class="gmail_default" style> res@mpMaxLatF = max(oz&lat)</div><div class="gmail_default" style><br></div><div class="gmail_default" style><br></div><div class="gmail_default" style> printVarSummary(oz)</div><div class="gmail_default" style> printVarSummary(oz&lat)</div><div class="gmail_default" style> printVarSummary(oz&lon)</div><div class="gmail_default" style> plot = gsn_csm_contour_map(wks,oz(0,:,:),res)</div><div class="gmail_default" style><br></div><div class="gmail_default" style>end</div><div style="font-size:small"><br></div><div style="font-size:small">--Mary</div><div style="font-size:small"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 3:09 AM, Noelia otero <span dir="ltr"><<a href="mailto:noeli1680@gmail.com" target="_blank">noeli1680@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 Mary,<div><br><div>Thanks for your answer. I know that this is a common mistake, but I checked the units and the coordinates array and they seem correct to me. I only changed the longitude values, because they span from 347 to 34, so I changed it to -13 34. This is why I was reattaching all of it, is it wrong?? Otherwise, I am having problems for trying to plot between 347 and 34 lon..<br></div><div><br></div><div>The error that I get :</div><div><br></div><div><div>(0) 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) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:</div><div>(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'</div><div>(0) 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) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:</div><div>(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'</div></div><div><br></div><div>The script is very simple, </div><div><br></div><div>;***********************************************************************</div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"</div><div>;************************************************************************</div><div>begin</div><div><br></div><div> ozfil = addfile("/work/users/nof/data/data_new/Ozone/grid1/seasons/Europe/<a href="http://mda8.surfO3.EU.2000.2009.settabs_JJA.nc" target="_blank">mda8.surfO3.EU.2000.2009.settabs_JJA.nc</a>","r")</div><div><br></div><div> wks = gsn_open_wks("X11","test")</div><div> ;gsn_define_colormap(wks,"BlueDarkRed18")</div><div><br></div><div><br></div><div> ;ozone</div><div> oz = ozfil->MDA8_SurfO3</div><div><br></div><div> ;change lon values -180 180</div><span class=""><div> lon = ozfil ->lon</div><div> lon = where((lon.gt.180).and.(lon.lt.360),lon-360,lon)</div><div> lat = ozfil ->lat</div></span><div> oz&lon = lon</div><div> ; oz&lat = lat ; it might be unnecessary</div><div><br></div><div> res = True</div><div> res@gsnAddCyclic = False</div><div> res@mpMinLonF = min(lon)</div><div> res@mpMinLatF = min(lat)</div><div> res@mpMaxLonF = max(lon)</div><div> res@mpMaxLatF = max(lat)</div><div><br></div><div><br></div><div> printVarSummary(oz)</div></div><div><div> printVarSummary(oz&lat)</div><div> printVarSummary(oz&lon)</div><span class=""><div> plot = gsn_csm_contour_map(wks,oz(0,:,:),res)</div><div><br></div></span><div>end</div></div><div>;******************************************</div><div><br></div><div>The summary of the variables:</div><div>printVarSummary(oz):</div><div><br></div><div><div><span class=""><div>Variable: oz</div><div>Type: double</div><div>Total Size: 13777920 bytes</div><div> 1722240 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes: [time | 920] x [lon | 48] x [lat | 39]</div><div>Coordinates:</div><div> time: [20000601..20090831]</div><div> lon: [ -13.. 34]</div><div> lat: [ 34.. 72]</div><div>Number Of Attributes: 2</div></span><div> units : parts per billion = nmol/mol</div><div> description : Maximum daily 8-hr average (MDA8) of surface ozone (ppb) over Europe from 01/01/2000 - 12/31/2009</div><div><br></div></div></div><div>printVarSummary(lat)</div><div><div>Variable: lat (coordinate)</div><div>Type: double</div><div>Total Size: 312 bytes</div><div> 39 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes: [lat | 39]</div><div>Coordinates:</div><div>Number Of Attributes: 4</div><div> axis : Y</div><div> units : degrees_north</div><div> long_name : latitude</div><div> standard_name : latitude</div></div><div><br></div><div><br></div><div>printVarSummary(lon)</div><div><br></div><div><div>Variable: lon (coordinate)</div><div>Type: double</div><div>Total Size: 384 bytes</div><div> 48 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes: [lon | 48]</div><div>Coordinates:</div><div>Number Of Attributes: 4</div><div> axis : X</div><div> units : degrees_east</div><div> long_name : longitude</div><div> standard_name : longitude</div></div><div><br></div><div><br></div><div><br></div><div>Many thanks in advance for the support,</div><div><br></div><div>Cheers,</div><div><br></div><div>Noelia.</div><div><br></div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2014-09-19 1:07 GMT+02:00 Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Noelia,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">When you continue to have problems with a script, it helps to include any new error messages you are getting.</div><div><br></div></div><div class="gmail_default" style="font-size:small">Also, your "printVarSummary" of "oz" seems to indicate that you have coordinate arrays and the appropriate metadata, so I'm not sure why you are reattaching all of it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please look at your data right before you plot it, and not right before you start adding metadata to it. Also, look at your lat/lon arrays to make sure they look okay.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To look at your data more thoroughly, add these three lines right before you call gsn_csm_contour_plot:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">printVarSummary(oz)</div><div class="gmail_default" style="font-size:small"><div class="gmail_default">printVarSummary(oz&lat)</div><div><div class="gmail_default">printVarSummary(oz&lon)</div></div><div><br></div><div>Make sure the "units" for the lat/lon arrays are correct, and that "oz" has all the correct coordinate information attached.</div><span><font color="#888888"><div><br></div></font></span></div><span><font color="#888888"><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 18, 2014 at 12:43 PM, Noelia otero <span dir="ltr"><<a href="mailto:noeli1680@gmail.com" target="_blank">noeli1680@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,<div><br></div><div><div>Thanks karin, but even with this setting I can't plot. I don't know if this problem might be due to the data..actually, I don't know why this warning..</div><div>Thanks again!</div></div><span><font color="#888888"><div><br></div><div>Noelia.</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-18 11:29 GMT+02:00 Karin Meier-Fleischer <span dir="ltr"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi Noelia,<br>
<br>
maybe you have missed the setting<br>
<br>
<tt> oz&lat = lat</tt><br>
<br>
Hope this helps,<br>
Karin<br>
<br>
<div>Am 18.09.14 10:50, schrieb Noelia
otero:<br>
</div>
<blockquote type="cite"><div><div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have problems to plot one field, and although I have
already dealt with this error, I tried to fix it now in
different ways..but I don't know what I am missing, and I have
no idea what I am doing wrong. The error is always:</div>
<div><br>
</div>
<div><i>"check_for_y_lat_coord: Warning: Data either does not
contain a valid latitude coordinate array or doesn't contain
one at all......"</i></div>
<div><br>
</div>
<div>I would appreciate any suggestion:</div>
<div><br>
</div>
<div>
<div> ;Variable</div>
<div> oz = ozfil->MDA8_SurfO3</div>
<div> printVarSummary(oz)</div>
<div> ; Summary of variable: oz </div>
<div> ;***Type: double</div>
<div> Total Size: 13777920 bytes</div>
<div> 1722240 values</div>
<div> Number of Dimensions: 3</div>
<div> Dimensions and sizes:<span style="white-space:pre-wrap"> </span>[time | 920] x [lon | 48]
x [lat | 39]</div>
<div> Coordinates: </div>
<div> time: [20000601..20090831]</div>
<div> lon: [ 347.. 34]</div>
<div> lat: [ 34.. 72]</div>
<div><br>
</div>
<div> ;change lon values into -180 180</div>
<div> lon = ozfil ->lon</div>
<div> lon =
where((lon.gt.180).and.(lon.lt.360),lon-360,lon)</div>
<div> lat = ozfil ->lat</div>
<div> lon@long_name = "longitude"</div>
<div> lon@units = "degrees_east"</div>
<div> lat@long_name = "latitude"</div>
<div> lat@units = "degrees_north"</div>
<div> oz&lon = lon</div>
<div> printVarSummary(oz)</div>
<div> </div>
<div>Now the summary of oz is:</div>
<div>
<div>Variable: oz</div>
<div>Type: double</div>
<div>Total Size: 13777920 bytes</div>
<div> 1722240 values</div>
<div>Number of Dimensions: 3</div>
<div>Dimensions and sizes:<span style="white-space:pre-wrap"> </span>[time | 920] x [lon |
48] x [lat | 39]</div>
<div>Coordinates: </div>
<div> time: [20000601..20090831]</div>
<div> lon: [ -13.. 34]</div>
<div> lat: [ 34.. 72]</div>
<div>Number Of Attributes: 2</div>
</div>
<div><br>
</div>
<div>ISo, am trying to plot:</div>
<div>plot = gsn_csm_contour_map(wks,oz(0,:,:),res)<br>
</div>
<div><br>
</div>
<div>Any idea about how can I solve this??? </div>
</div>
<div>Thank you in advance,</div>
<div><br>
</div>
<div>Cheers,</div>
<div><br>
</div>
<div><br>
</div>
<div>Noelia.</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Dipl. Geophys. Karin Meier-Fleischer
Visualization
Application Support
Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany
Phone: <a href="tel:%2B49%20%280%2940%20460094%20126" value="+4940460094126" target="_blank">+49 (0)40 460094 126</a>
Fax: <a href="tel:%2B49%20%280%2940%20460094%20270" value="+4940460094270" target="_blank">+49 (0)40 460094 270</a>
E-Mail: <a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>
URL: <a href="http://www.dkrz.de" target="_blank">www.dkrz.de</a>
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
</pre>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>