<div dir="ltr"><div><div><div><div><div><div><div><div>The NCL equivalent of what you sent is:<br><br> nlat = 180<br> mlon = 360<br> lat = fspan(-89.5,89.5,nlat)<br> lon = fspan(-179.5, 179.5,mlon)<br><br> fili = "2015161_highQc_aot550_eps.dat" ; total size 259200 (= 4*nlat*mlon)<br><br> var1f = fbindirread(fili,0,(/nlat,mlon/),"float")<br> ; or .... these are equivalent in this case<br> var1c = cbinread(fili,(/nlat,mlon/),"float")<br><br>============<br></div>No error messages!! Everything looks great! <br><br>...... NOT .....<br><br></div><div>The golden rule of data processing is ***Look at your data***.<br></div><div><br></div><div>============<br><br></div>Did you try to print the min and max values in IDL?<br></div>Likely, they would be 'nice' numbers.<br><br>Did you try to print the min and max values in NCL?<br></div>If you did, you would see<br><br>(0) min=nan max=nan<br><br>=============<br><br></div>IDL (Matlab too!) recognizes NaN (nan) as values to be ignored. AKA 'missing values'<br><br></div>NCL recognizes the netCDF _FillValue attribute. This can *not* be a NaN.<br><br></div>You *must* change the NaNs to a real number for NCL. <br></div><div>Please read the following.<br></div><div><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/isnan_ieee.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/isnan_ieee.shtml</a><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/replace_ieeenan.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/replace_ieeenan.shtml</a><br><br></div>Add the following at the end of the above. This is one example of how to *Look at your data* !<br><br> nNaN = num(isnan_ieee(var1f)) ; # of NaN values<br> pcNaN = (tofloat(nNaN)/(nlat*mlon))*100 ; % NaN <br> print("nNaN="+nNaN+" pcNaN="+pcNaN+"%")<br><br>(0) nNaN=33395 pcNaN=51.5355% ; 51.5% ... more than half<br><br><div><div><div><div><div><div><div><div> printMinMax(var1f,0) ; BEFORE<br>(0) min=nan max=nan<br><br> if (any(isnan_ieee(var1f))) then<br> value = 1.e20<br> replace_ieeenan (var1f, value, 0)<br> var1f@_FillValue = value<br> end if<br><br> printMinMax(var1f,0) ; AFTER<br><br>min=-0.0499198 max=3.96129<br><br>========<br></div><div>The _FillValue attribute is fundamental to NCL.<br></div><div>Please read the documentation at:<br><br><a href="http://www.ncl.ucar.edu/Document/Manuals/">http://www.ncl.ucar.edu/Document/Manuals/</a><br><br></div><div>Mini-Reference Manual<br><br></div><div>The official Reference manual<br><br><a href="http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#MissingValueAttribute">http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#MissingValueAttribute</a><br><br></div><div>Also, the two DKRZ Manuals at the above site.<br><br>=================<br><br></div><div>Further, the NCL plot code you sent in thye initial email whicj I think you cut and pasted from some example will likely not yield a nice plot.<br><br></div><div>Likely, you will have to use raster mode.<br><br><pre>res@cnFillMode = "RasterFill" ; Raster Mode</pre><br></div><div><br><a href="http://www.ncl.ucar.edu/Applications/raster.shtml">http://www.ncl.ucar.edu/Applications/raster.shtml</a><br></div><div><br><br></div><div><br></div><div><br></div><div><br><br></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 11, 2016 at 9:52 AM, Debasish Hazra <span dir="ltr"><<a href="mailto:debasish.hazra5@gmail.com" target="_blank">debasish.hazra5@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"><div>Thanks Dennis. But it still does no produce any figures. I have attached the script of ncl. Found the following instruction of how to read that in iDL : <br><br><pre style="color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;word-wrap:break-word;white-space:pre-wrap"> res = 1.0 ; 1.0 degree spatial resolution
nlon = ROUND(360./res) ; number of columns (-180,180)
nlat = ROUND(180./res) ; number of rows (-90, 90)
lonFirst = -180+0.5*res ; west boundary (first column)
latFirst = -90+0.5*res ; south boundary (first row)
dailyGriddedAod550 = FLTARR(nlon, nlat)
date = '2015161' ; string in YYYYDDD format
fileName = date+'_highQc_aot550_eps.dat'
OPENR, lun, /GET_LUN, fileName
READU, lun, dailyGriddedAod550
CLOSE, lun
FREE_LUN, lun</pre>Thanks.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Debasish<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 10, 2016 at 4:21 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</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"><div><div><div><div><div><div>Did you look at the size of your file??<br><br>259200 2015161_highQc_aot550_eps.dat<br></div>^^^^^^^<br><br></div>float or integer are 4 bytes<br><br></div>4*180*360 = 259200 so **one** float or integer variable<br></div><div><br></div>You are using<br><br> setfileoption("bin","readbyteorder","littleendian")<br><br> var1 = cbinread("./EPS_HQ/2015161_highQc_aot550_eps.dat",(/2,180,360/),"float")<br> var2 = cbinread("./EPS_HQ/2015161_highQc_aot550_eps.dat",(/2,180,360/),"integer")<br><br></div>For two integer or float variables the size should be: 259200 + 259200 = 518400<br><br></div><div>At the very least, you should have been getting an NCL error message about wrong size.<br><br></div><div><br></div><br><div><br><br><div><div><br><div><div><div><br><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, May 10, 2016 at 12:32 PM, Debasish Hazra <span dir="ltr"><<a href="mailto:debasish.hazra5@gmail.com" target="_blank">debasish.hazra5@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div><div>Hi,<br><br></div>I am trying to read binary data with ncl (v6.3) but not sure whether it is reading it right. Also, it does not produce any plots. Attached are the script presently working on and sample data. Any help on this is well appreciated.<br><br></div>Thanks.<span><font color="#888888"><br></font></span></div><span><font color="#888888">Debasish.<br></font></span></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>