<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px"><div id="yui_3_16_0_1_1450592720313_18337"><span id="yui_3_16_0_1_1450592720313_18336">Thanks Rick and Dennis for your help..&nbsp;</span></div><div id="yui_3_16_0_1_1450592720313_18337"><span><br></span></div><div id="yui_3_16_0_1_1450592720313_18337" dir="ltr">So the Rf values are now being wriiten properly. &nbsp;how to see the 1st and 2nd records. &nbsp;</div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br></div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; nlat &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;1649<br></div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; nlon &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;4948</div><div id="yui_3_16_0_1_1450592720313_18338" class="">;--------------------------------------------------</div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br id="yui_3_16_0_1_1450592720313_18429" class=""></div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;lat &nbsp; &nbsp; &nbsp; &nbsp; = 59.963614 + ispan(0,nlat-1,1)*0.072771377</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;lat!0 &nbsp; &nbsp; &nbsp; = "latitude"</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;lat@units &nbsp; = "degrees_north"</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printVarSummary(lat)</div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br id="yui_3_16_0_1_1450592720313_18436" class=""></div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;lon &nbsp; &nbsp; &nbsp; &nbsp; = 0.036378335 + ispan(0,nlon-1,1)*0.072756669</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;lon!0 &nbsp; &nbsp; &nbsp; = "longitude"</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;lon@units &nbsp; = "degrees_east"</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printVarSummary(lon)</div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br id="yui_3_16_0_1_1450592720313_18443" class=""></div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br id="yui_3_16_0_1_1450592720313_18446" class=""></div><div id="yui_3_16_0_1_1450592720313_18338" class="">; Reading File-----------------</div><div id="yui_3_16_0_1_1450592720313_18338" class="">rf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;fbindirread("test.bin",0,(/nlat,nlon/),"ubyte")</div><div id="yui_3_16_0_1_1450592720313_18338" class="">; &nbsp;res1 &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;fbindirread("test.bin",1,-1,"float")</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; asciiwrite("rf.txt",rf)</div><div id="yui_3_16_0_1_1450592720313_18338" class="">; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(res1)</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printVarSummary(rf)</div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br id="yui_3_16_0_1_1450592720313_18715" class=""></div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;;rf@_FillValue= 255</div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br id="yui_3_16_0_1_1450592720313_18719" class=""></div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;cmorrf &nbsp; &nbsp; &nbsp; &nbsp;= where(rf.eq.255,255,rf*0.2)</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;asciiwrite("crf.txt",cmorrf)</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;cmorrf@_FillValue &nbsp;= 255</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp;cmorrf@units &nbsp; &nbsp; &nbsp;= "mm"</div><div id="yui_3_16_0_1_1450592720313_18338" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printVarSummary(cmorrf)</div><div id="yui_3_16_0_1_1450592720313_18338" class="" dir="ltr"><br id="yui_3_16_0_1_1450592720313_18727" class=""></div><div id="yui_3_16_0_1_1450592720313_18338" class="">This doc mentions that there are 6 records.&nbsp;<span style="font-family: 'Courier New'; white-space: pre-wrap;" id="yui_3_16_0_1_1450592720313_19192" class="">;; Each file contains 6 records.  The 1st 3 records pertain to the top half</span></div><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_19194" class="">;; of the hour (00-29 minus after the hour) and the last 3 records are for the
;; bottom half of the hour.  Within each group:
;; 
;;   -  the 1st record contains the CMORPH precipitation estimates 
;;   
;;   -  the 2nd record contains the time (in half hour units) since the most
;;      recent microwave pass.  Note that since we do both a forward &amp;
;;        backward interpolation in time, the nearest time may be prior to
;;        the file time stamp or after it.  
;;        
;;   -  the 3rd record contains an ID that tells the satellite from which the last
;;        microwave observation was made which can be interpretted by the following
;;        table (as of the time of the last update of this documentation):
;;        </pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_19194" class=""><br></pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_19194" class="">How should I see the rest of them??</pre> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Monday, 21 December 2015 8:03 PM, Dennis Shea &lt;shea@ucar.edu&gt; wrote:<br></font></div>  <br><br> <div class="y_msg_container">Also ... *you* must read the documentation carefully. The documentation states:<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  "Each direct access record is a 4948 x 1649 CHARACTER*1"<br clear="none"><br clear="none">[1]<br clear="none">You are using 'fbinrecread' which is for fortran sequential records.<br clear="none">You should use 'fbindirread' which is for direct access records.<br clear="none"><br clear="none">[2]<br clear="none">Ypu have 'lat' going from South-to-North. The documentation states the<br clear="none">data are N-&gt;S.<br clear="none"><br clear="none">[3]<br clear="none">Since the max byte is 255, I think unsigned byte type should be used.<br clear="none"><br clear="none"><br clear="none"><a shape="rect" href="http://www.ncl.ucar.edu/Applications/" target="_blank">http://www.ncl.ucar.edu/Applications/</a><br clear="none">Under 'Datasets' ... Click 'High Res Precipitation'<br clear="none"><br clear="none">Minor modifications to existing CMORPH examples resulted in cmorph_4.ncl<br clear="none"><br clear="none"><br clear="none">On Mon, Dec 21, 2015 at 6:46 AM, Rick Brownrigg &lt;<a shape="rect" ymailto="mailto:brownrig@ucar.edu" href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>&gt; wrote:<br clear="none">&gt; Hi,<br clear="none">&gt;<br clear="none">&gt; According to the docs at:<br clear="none">&gt;<br clear="none">&gt; <a shape="rect" href="ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/README.cmorph.8km_30minute" target="_blank">ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/README.cmorph.8km_30minute</a><br clear="none">&gt;<br clear="none">&gt; the data are given as unsigned bytes, not floats. This would explain the<br clear="none">&gt; warning about file size.&nbsp; By the comments in the GRADS definition, you<br clear="none">&gt; multiply the cmorph values by 0.2 to get mm/hr. With that in mind, I *think*<br clear="none">&gt; you need something like (untested!):<br clear="none">&gt;<br clear="none">&gt; cmorrf_ubytes&nbsp;  =&nbsp; &nbsp; fbinrecread("test.bin",0,(/nlat,nlon/),"ubyte")<br clear="none">&gt;<br clear="none">&gt; <a shape="rect" ymailto="mailto:cmorrf_ubytes@_FillValue" href="mailto:cmorrf_ubytes@_FillValue">cmorrf_ubytes@_FillValue</a> = 255B<br clear="none">&gt;<br clear="none">&gt; cmorrf = cmorrf_ubytes * 0.2&nbsp;  ; convert to floats, units are mm/hr<br clear="none">&gt;<br clear="none">&gt;<br clear="none">&gt; As a side note, since its byte data, the setfileoption(...) is superfluous.<br clear="none">&gt;<br clear="none">&gt; Hope that helps..<br clear="none">&gt;<br clear="none">&gt; Rick<br clear="none">&gt;<br clear="none">&gt;<br clear="none">&gt; On Sun, Dec 20, 2015 at 4:39 AM, Geeta Geeta &lt;<a shape="rect" ymailto="mailto:geetag54@yahoo.com" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>&gt; wrote:<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; I have to plot 8km_30minutes resolution CMORPH rainfall.<br clear="none">&gt;&gt; The data is binary format. and has 24 files of each hour.<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; -rw-r--r-- 1 aditya aditya 48955512 Dec&nbsp; 1 19:33<br clear="none">&gt;&gt; CMORPH_8KM-30MIN_2015113021<br clear="none">&gt;&gt; -rw-r--r-- 1 aditya aditya 48955512 Dec&nbsp; 1 19:33<br clear="none">&gt;&gt; CMORPH_8KM-30MIN_2015113022<br clear="none">&gt;&gt; -rw-r--r-- 1 aditya aditya 48955512 Dec&nbsp; 1 19:33<br clear="none">&gt;&gt; CMORPH_8KM-30MIN_2015113023<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; As per the documentation of this data from<br clear="none">&gt;&gt; (<a shape="rect" href="ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/CMORPH_8km-30-minute.ctl" target="_blank">ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/CMORPH_8km-30-minute.ctl</a>)<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; DSET<br clear="none">&gt;&gt; /your-data-set-path/advt-8km-intrp-prim-sat-spat-2lag-2.5+5dovlp8kmIR-%y4%m2%d2%h2<br clear="none">&gt;&gt; OPTIONS yrev big_endian template<br clear="none">&gt;&gt; UNDEF&nbsp; 255<br clear="none">&gt;&gt; TITLE&nbsp; correlation estimates<br clear="none">&gt;&gt; XDEF 4948 LINEAR&nbsp;  0.036378335 0.072756669<br clear="none">&gt;&gt; YDEF 1649 LINEAR -59.963614&nbsp; &nbsp; 0.072771377<br clear="none">&gt;&gt; ZDEF&nbsp;  01 LEVELS 1<br clear="none">&gt;&gt; TDEF 99999&nbsp; LINEAR&nbsp;  00z21dec2002 30mn<br clear="none">&gt;&gt; VARS 3<br clear="none">&gt;&gt; cmorph&nbsp;  1&nbsp; -1,40,1,-1 xxxxxx yyyyy&nbsp; (mult. by 0.2 to get mm/hr units)<br clear="none">&gt;&gt; time&nbsp; &nbsp;  1&nbsp; -1,40,1,-1 xxxxxx yyyyy<br clear="none">&gt;&gt; satid&nbsp; &nbsp; 1&nbsp; -1,40,1,-1 xxxxxx yyyyy<br clear="none">&gt;&gt; ENDVARS<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; there are 3 records, 1st record being the desired parameter.<br clear="none">&gt;&gt; (<a shape="rect" href="ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/README.cmorph.8km_30minute" target="_blank">ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/README.cmorph.8km_30minute</a>).<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; I have to plot each hourly file and then get 24 hrs rainfall for a day.<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; ;;;;;;;Code;<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;&nbsp; print(isbigendian)<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; ; ----Defining for Once -----<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;&nbsp;  wks&nbsp; &nbsp; &nbsp; &nbsp;  = gsn_open_wks("ps","CMO-v1")<br clear="none">&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  gsn_define_colormap(wks,"prcp_2")<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;&nbsp;  nlat&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; 1649<br clear="none">&gt;&gt;&nbsp;  nlon&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; 4948<br clear="none">&gt;&gt; ;--------------------------------------------------<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;&nbsp; lat&nbsp; &nbsp; &nbsp; &nbsp;  = -59.963614 + ispan(0,nlat-1,1)*0.072771377<br clear="none">&gt;&gt; ;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print(lat)<br clear="none">&gt;&gt;&nbsp; lon&nbsp; &nbsp; &nbsp; &nbsp;  = 0.036378335 + ispan(0,nlon-1,1)*0.072756669<br clear="none">&gt;&gt; ;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print(lon)<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setfileoption("bin","ReadByteOrder","BigEndian")<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; ; cmorrf&nbsp;  =&nbsp; &nbsp; fbinrecread("test.bin",0,(/nlat,nlon/),"float")&nbsp; ; print<br clear="none">&gt;&gt; 0th record.<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; cmorrf&nbsp;  =&nbsp; &nbsp; fbinrecread("test.bin",0,-1,"float")&nbsp; ; print 0th record.<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print("Sizeof rf&nbsp; ="+dimsizes(cmorrf))<br clear="none">&gt;&gt; ;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print(cmorrf)<br clear="none">&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  asciiwrite("rf.txt",cmorrf)<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; When I run this,<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; See <a shape="rect" href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/ </a>for more details.<br clear="none">&gt;&gt; (0) False<br clear="none">&gt;&gt; warning:fbinrecread: size specified is greater than record size, filling<br clear="none">&gt;&gt; with missing values<br clear="none">&gt;&gt; (0) Sizeof rf&nbsp; =1649<br clear="none">&gt;&gt; (1) Sizeof rf&nbsp; =4948<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; when I use -1 in line defining cmorphh, I get this output.<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; <a shape="rect" ymailto="mailto:aditya@agniilap" href="mailto:aditya@agniilap">aditya@agniilap</a>:~/geeta/ncl/CMORPH$&nbsp; See <a shape="rect" href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/ </a>for more<br clear="none">&gt;&gt; details.<br clear="none">&gt;&gt; (0) False<br clear="none">&gt;&gt; (0) Sizeof rf&nbsp; =0<br clear="none">&gt;&gt;<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; no rainfall is written to the file.<br clear="none">&gt;&gt; Also the 1st and 2nd&nbsp; records are not being shown.<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; Pls suggest.<br clear="none">&gt;&gt;<br clear="none">&gt;&gt; _______________________________________________<br clear="none">&gt;&gt; ncl-talk mailing list<br clear="none">&gt;&gt; <a shape="rect" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">&gt;&gt; List instructions, subscriber options, unsubscribe:<br clear="none">&gt;&gt; <a shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><div class="yqt8038376422" id="yqtfd76920"><br clear="none">&gt;&gt;<br clear="none">&gt;<br clear="none">&gt;<br clear="none">&gt; _______________________________________________<br clear="none">&gt; ncl-talk mailing list<br clear="none">&gt; <a shape="rect" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">&gt; List instructions, subscriber options, unsubscribe:<br clear="none">&gt; <a shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br clear="none">&gt;<br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>