<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.. </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. how to see the 1st and 2nd records. </div><div id="yui_3_16_0_1_1450592720313_18338" class=""><br></div><div id="yui_3_16_0_1_1450592720313_18338" class=""> nlat = 1649<br></div><div id="yui_3_16_0_1_1450592720313_18338" class=""> nlon = 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=""> lat = 59.963614 + ispan(0,nlat-1,1)*0.072771377</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> lat!0 = "latitude"</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> lat@units = "degrees_north"</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> 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=""> lon = 0.036378335 + ispan(0,nlon-1,1)*0.072756669</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> lon!0 = "longitude"</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> lon@units = "degrees_east"</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> 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 = fbindirread("test.bin",0,(/nlat,nlon/),"ubyte")</div><div id="yui_3_16_0_1_1450592720313_18338" class="">; res1 = fbindirread("test.bin",1,-1,"float")</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> asciiwrite("rf.txt",rf)</div><div id="yui_3_16_0_1_1450592720313_18338" class="">; print(res1)</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> 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=""> ;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=""> cmorrf = where(rf.eq.255,255,rf*0.2)</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> asciiwrite("crf.txt",cmorrf)</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> cmorrf@_FillValue = 255</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> cmorrf@units = "mm"</div><div id="yui_3_16_0_1_1450592720313_18338" class=""> 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. <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 &
;; 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 <shea@ucar.edu> wrote:<br></font></div> <br><br> <div class="y_msg_container">Also ... *you* must read the documentation carefully. The documentation states:<br clear="none"> "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->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 <<a shape="rect" ymailto="mailto:brownrig@ucar.edu" href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>> wrote:<br clear="none">> Hi,<br clear="none">><br clear="none">> According to the docs at:<br clear="none">><br clear="none">> <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">><br clear="none">> the data are given as unsigned bytes, not floats. This would explain the<br clear="none">> warning about file size. By the comments in the GRADS definition, you<br clear="none">> multiply the cmorph values by 0.2 to get mm/hr. With that in mind, I *think*<br clear="none">> you need something like (untested!):<br clear="none">><br clear="none">> cmorrf_ubytes = fbinrecread("test.bin",0,(/nlat,nlon/),"ubyte")<br clear="none">><br clear="none">> <a shape="rect" ymailto="mailto:cmorrf_ubytes@_FillValue" href="mailto:cmorrf_ubytes@_FillValue">cmorrf_ubytes@_FillValue</a> = 255B<br clear="none">><br clear="none">> cmorrf = cmorrf_ubytes * 0.2 ; convert to floats, units are mm/hr<br clear="none">><br clear="none">><br clear="none">> As a side note, since its byte data, the setfileoption(...) is superfluous.<br clear="none">><br clear="none">> Hope that helps..<br clear="none">><br clear="none">> Rick<br clear="none">><br clear="none">><br clear="none">> On Sun, Dec 20, 2015 at 4:39 AM, Geeta Geeta <<a shape="rect" ymailto="mailto:geetag54@yahoo.com" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>> wrote:<br clear="none">>><br clear="none">>> I have to plot 8km_30minutes resolution CMORPH rainfall.<br clear="none">>> The data is binary format. and has 24 files of each hour.<br clear="none">>><br clear="none">>> -rw-r--r-- 1 aditya aditya 48955512 Dec 1 19:33<br clear="none">>> CMORPH_8KM-30MIN_2015113021<br clear="none">>> -rw-r--r-- 1 aditya aditya 48955512 Dec 1 19:33<br clear="none">>> CMORPH_8KM-30MIN_2015113022<br clear="none">>> -rw-r--r-- 1 aditya aditya 48955512 Dec 1 19:33<br clear="none">>> CMORPH_8KM-30MIN_2015113023<br clear="none">>><br clear="none">>> As per the documentation of this data from<br clear="none">>> (<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">>><br clear="none">>> DSET<br clear="none">>> /your-data-set-path/advt-8km-intrp-prim-sat-spat-2lag-2.5+5dovlp8kmIR-%y4%m2%d2%h2<br clear="none">>> OPTIONS yrev big_endian template<br clear="none">>> UNDEF 255<br clear="none">>> TITLE correlation estimates<br clear="none">>> XDEF 4948 LINEAR 0.036378335 0.072756669<br clear="none">>> YDEF 1649 LINEAR -59.963614 0.072771377<br clear="none">>> ZDEF 01 LEVELS 1<br clear="none">>> TDEF 99999 LINEAR 00z21dec2002 30mn<br clear="none">>> VARS 3<br clear="none">>> cmorph 1 -1,40,1,-1 xxxxxx yyyyy (mult. by 0.2 to get mm/hr units)<br clear="none">>> time 1 -1,40,1,-1 xxxxxx yyyyy<br clear="none">>> satid 1 -1,40,1,-1 xxxxxx yyyyy<br clear="none">>> ENDVARS<br clear="none">>><br clear="none">>> there are 3 records, 1st record being the desired parameter.<br clear="none">>> (<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">>><br clear="none">>> I have to plot each hourly file and then get 24 hrs rainfall for a day.<br clear="none">>><br clear="none">>> ;;;;;;;Code;<br clear="none">>><br clear="none">>> print(isbigendian)<br clear="none">>><br clear="none">>> ; ----Defining for Once -----<br clear="none">>><br clear="none">>> wks = gsn_open_wks("ps","CMO-v1")<br clear="none">>> gsn_define_colormap(wks,"prcp_2")<br clear="none">>><br clear="none">>> nlat = 1649<br clear="none">>> nlon = 4948<br clear="none">>> ;--------------------------------------------------<br clear="none">>><br clear="none">>> lat = -59.963614 + ispan(0,nlat-1,1)*0.072771377<br clear="none">>> ; print(lat)<br clear="none">>> lon = 0.036378335 + ispan(0,nlon-1,1)*0.072756669<br clear="none">>> ; print(lon)<br clear="none">>><br clear="none">>> setfileoption("bin","ReadByteOrder","BigEndian")<br clear="none">>><br clear="none">>> ; cmorrf = fbinrecread("test.bin",0,(/nlat,nlon/),"float") ; print<br clear="none">>> 0th record.<br clear="none">>><br clear="none">>><br clear="none">>> cmorrf = fbinrecread("test.bin",0,-1,"float") ; print 0th record.<br clear="none">>><br clear="none">>> print("Sizeof rf ="+dimsizes(cmorrf))<br clear="none">>> ; print(cmorrf)<br clear="none">>> asciiwrite("rf.txt",cmorrf)<br clear="none">>><br clear="none">>> When I run this,<br clear="none">>><br clear="none">>> See <a shape="rect" href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/ </a>for more details.<br clear="none">>> (0) False<br clear="none">>> warning:fbinrecread: size specified is greater than record size, filling<br clear="none">>> with missing values<br clear="none">>> (0) Sizeof rf =1649<br clear="none">>> (1) Sizeof rf =4948<br clear="none">>><br clear="none">>> when I use -1 in line defining cmorphh, I get this output.<br clear="none">>><br clear="none">>> <a shape="rect" ymailto="mailto:aditya@agniilap" href="mailto:aditya@agniilap">aditya@agniilap</a>:~/geeta/ncl/CMORPH$ See <a shape="rect" href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/ </a>for more<br clear="none">>> details.<br clear="none">>> (0) False<br clear="none">>> (0) Sizeof rf =0<br clear="none">>><br clear="none">>><br clear="none">>> no rainfall is written to the file.<br clear="none">>> Also the 1st and 2nd records are not being shown.<br clear="none">>><br clear="none">>> Pls suggest.<br clear="none">>><br clear="none">>> _______________________________________________<br clear="none">>> ncl-talk mailing list<br clear="none">>> <a shape="rect" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">>> List instructions, subscriber options, unsubscribe:<br clear="none">>> <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">>><br clear="none">><br clear="none">><br clear="none">> _______________________________________________<br clear="none">> ncl-talk mailing list<br clear="none">> <a shape="rect" ymailto="mailto:ncl-talk@ucar.edu" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">> List instructions, subscriber options, unsubscribe:<br clear="none">> <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">><br clear="none"></div><br><br></div> </div> </div> </div></div></body></html>