<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The problem is that the "oz" array is ordered time x lon x lat, and it needs to be time x lat x lon in order for NCL to be able to plot it. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, your data has NaNs in it, so I used replace_ieeenan to fix these.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please see attached.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 8:26 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><div>Sure, I put the data in your ftp, in incoming, it is a file with the name <b><a href="http://mda8.surfO3.EU.2000.2009.settabs_JJA.nc" target="_blank">mda8.surfO3.EU.2000.2009.settabs_JJA.nc</a></b></div><div><br></div><div>I am using the 6.2.0 ncl version and Debian 3.2.60-1+deb7u1 x86_64 GNU/Linux for the system.</div><div><br></div><div>Again, thanks a lot for the help.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Noelia</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2014-09-19 16:04 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">You're right about lonFlip, sorry about that.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Can you provide your data on our ftp so I can take a look? You can give me the information offline if you don't want to share it on ncl-talk:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP" target="_blank">http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP</a><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 7:59 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><div><div>Thanks for the suggestion (I had the idea that lonFlip only works for global longitudes). </div><div>Unfortunately, when I try to use lonFlip, the ncl process stops and I receive the message:</div><div><br></div><div><i>(0) lonflip: longitude dimension size must be even: mlon=39</i></div><div><br></div><div>I don't understand much the message.</div><div><br></div><div>Many thanks again,</div></div><div><br></div><div>Noelia.</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-19 15:02 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">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"><span><div class="gmail_default">;***********************************************************************</div><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"</div><div class="gmail_default">;************************************************************************</div><div class="gmail_default">begin</div><div class="gmail_default"><br></div><div class="gmail_default"> 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 class="gmail_default"><br></div><div class="gmail_default"> wks = gsn_open_wks("X11","test")</div><div class="gmail_default"> ;gsn_define_colormap(wks,"BlueDarkRed18")</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"> ;ozone</div><div class="gmail_default"> oz = ozfil->MDA8_SurfO3</div></span><div class="gmail_default"> oz = lonFlip(oz)</div><span><div class="gmail_default"><br></div><div class="gmail_default"> res = True</div><div class="gmail_default"> res@gsnAddCyclic = False</div></span><div class="gmail_default"> res@mpMinLonF = min(oz&lon)</div><div class="gmail_default"> res@mpMinLatF = min(oz&lat)</div><div class="gmail_default"> res@mpMaxLonF = max(oz&lon)</div><div class="gmail_default"> res@mpMaxLatF = max(oz&lat)</div><span><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"> printVarSummary(oz)</div><div class="gmail_default"> printVarSummary(oz&lat)</div><div class="gmail_default"> printVarSummary(oz&lon)</div><div class="gmail_default"> plot = gsn_csm_contour_map(wks,oz(0,:,:),res)</div><div class="gmail_default"><br></div><div class="gmail_default">end</div><div style="font-size:small"><br></div></span><span><font color="#888888"><div style="font-size:small">--Mary</div><div style="font-size:small"><br></div></font></span></div></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><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><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><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><div><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>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>