<div dir="ltr"><div>e384tile1.dat ==> 589832 bytes</div><div><br></div><div>(589832/4) = 147458 values [real or integer]<br></div><div><br></div><div>Since the division is exact, I speculate this is a 'flat' binary file. <br></div><div>likely written via a fortran direct access or (say) C</div><div>as opposed to a binary file written by a fortran sequential write (fortran's default) which adds an <br></div><div>INTEGER*4 byte count <i>at the beginning and end of each unformatted</i><b><i> </i>sequential record</b> <br></div><div>during an unformatted<b> sequential WRITE.</b></div><div><b><br></b></div><div>I have tried assorted permutations of the following:</div><div><br></div><div> nlat = 384<br> mlon = 384<br><br> setfileoption("bin","readbyteorder","littleendian")<br> ;setfileoption("bin","readbyteorder","bigendian")<br> d1 = fbindirread("./e384tile1.dat",0,(/nlat,mlon/),"float")<br> printMinMax(d1,0)<br> UNDEF = -999.0<br> d1 = where(d1.gt.1e10,UNDEF,d1)<br> printMinMax(d1,0)<br> ; d1 = fbindirread("./e384tile1.dat",0,(/nlat,mlon/),"integer")<br><br> printVarSummary(d1)<br> printMinMax(d1,0)</div><div>====<br></div><div> Nothing makes sense.<br></div><br><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 16, 2021 at 2:57 AM Debasish Hazra via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div>Trying to read binary file and trying to extract lat-lon info for tile file (binary file in C384 grid). Used the following to read it :</div><div> nlat = 384<br> mlon = 384<br><br> setfileoption("bin","readbyteorder","littleendian")<br> d1 = fbinrecread("./e384tile1.dat",0,-1,"float")<br><br> printVarSummary(d1)<br> UNDEF = -999.0<br><br> finarr = onedtond(d1(1:), (/nlat,mlon/))<br> finarr@_FillValue = UNDEF ;<br> printVarSummary(finarr)<br> printMinMax(finarr,0)</div><div><br></div><div>How to extract lat-lon bounds for that file ? Any help<br></div><div>Thanks</div><div>Debasish<br></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>