<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_1450805026332_3152"><span id="yui_3_16_0_1_1450805026332_3200">thanks again Denis for helping me. </span></div><div id="yui_3_16_0_1_1450805026332_3152"><span><br></span></div><div id="yui_3_16_0_1_1450805026332_3152" dir="ltr"><span id="yui_3_16_0_1_1450805026332_3351">I was able to plot the Rf after some failed attempts. I did take help from the Example 4 but didn't go line by line. I am attaching script and figure. </span></div><div id="yui_3_16_0_1_1450805026332_3152" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1450805026332_3152" dir="ltr"><span>Kindly clarify my doubt reg the 2nd record. </span></div><div id="yui_3_16_0_1_1450805026332_3152" dir="ltr">I extracted the 2nd record by the </div><div id="yui_3_16_0_1_1450805026332_3152" dir="ltr" class="">rec1 = fbindirread(diri+fili,1,(/ntim,nlat,nlon/),"ubyte")</div><div id="yui_3_16_0_1_1450805026332_3152" dir="ltr" class=""> printMinMax(rec1,True)</div><div dir="ltr" id="yui_3_16_0_1_1450805026332_3410" class="">it prints the following. </div><div dir="ltr" id="yui_3_16_0_1_1450805026332_3410" class=""> </div><div></div><div id="yui_3_16_0_1_1450805026332_3405"> (0)<span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1450805026332_3532">        </span>min=0 max=255</div><div dir="ltr" id="yui_3_16_0_1_1450805026332_3534" class="">the 2nd record is the time of the satellite pass. but I am not able to get that. </div><div class="signature" id="yui_3_16_0_1_1450805026332_3522"><br></div> <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 11:57 PM, Dennis Shea <shea@ucar.edu> wrote:<br></font></div> <br><br> <div class="y_msg_container">This is offline.<br clear="none"><br clear="none">Hello,<br clear="none"><br clear="none">ncl-talk likes to help BUT we do expect people to read the documentation.<br clear="none">We expect people to do their own debugging. After an honest attempt,<br clear="none">send clear concise code ... no commented out code.<br clear="none"><br clear="none">Our time is valuable also. We have our own jobs to do. Debugging other<br clear="none">people's code is time consuming.<br clear="none">We answer on a volunteer basis. We are not paid to answer.<br clear="none"><br clear="none">Use print statements to see what is happening.<br clear="none"><br clear="none">Good Luck<br clear="none"><br clear="none"><br clear="none"><div class="yqt7482910420" id="yqtfd81934"><br clear="none">On Mon, Dec 21, 2015 at 10:33 AM, Geeta Geeta <<a shape="rect" ymailto="mailto:geetag54@yahoo.com" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>> wrote:<br clear="none">> Thanks Rick and Dennis for your help..<br clear="none">><br clear="none">> So the Rf values are now being wriiten properly. how to see the 1st and 2nd<br clear="none">> records.<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">> lat!0 = "latitude"<br clear="none">> <a shape="rect" ymailto="mailto:lat@units" href="mailto:lat@units">lat@units</a> = "degrees_north"<br clear="none">> printVarSummary(lat)<br clear="none">><br clear="none">> lon = 0.036378335 + ispan(0,nlon-1,1)*0.072756669<br clear="none">> lon!0 = "longitude"<br clear="none">> <a shape="rect" ymailto="mailto:lon@units" href="mailto:lon@units">lon@units</a> = "degrees_east"<br clear="none">> printVarSummary(lon)<br clear="none">><br clear="none">><br clear="none">> ; Reading File-----------------<br clear="none">> rf = fbindirread("test.bin",0,(/nlat,nlon/),"ubyte")<br clear="none">> ; res1 = fbindirread("test.bin",1,-1,"float")<br clear="none">> asciiwrite("rf.txt",rf)<br clear="none">> ; print(res1)<br clear="none">> printVarSummary(rf)<br clear="none">><br clear="none">> ;<a shape="rect" ymailto="mailto:rf@_FillValue" href="mailto:rf@_FillValue">rf@_FillValue</a>= 255<br clear="none">><br clear="none">> cmorrf = where(rf.eq.255,255,rf*0.2)<br clear="none">> asciiwrite("crf.txt",cmorrf)<br clear="none">> <a shape="rect" ymailto="mailto:cmorrf@_FillValue" href="mailto:cmorrf@_FillValue">cmorrf@_FillValue</a> = 255<br clear="none">> <a shape="rect" ymailto="mailto:cmorrf@units" href="mailto:cmorrf@units">cmorrf@units</a> = "mm"<br clear="none">> printVarSummary(cmorrf)<br clear="none">><br clear="none">> This doc mentions that there are 6 records. ;; Each file contains 6 records.<br clear="none">> The 1st 3 records pertain to the top half<br clear="none">><br clear="none">> ;; of the hour (00-29 minus after the hour) and the last 3 records are for<br clear="none">> the<br clear="none">> ;; bottom half of the hour. Within each group:<br clear="none">> ;;<br clear="none">> ;; - the 1st record contains the CMORPH precipitation estimates<br clear="none">> ;;<br clear="none">> ;; - the 2nd record contains the time (in half hour units) since the most<br clear="none">> ;; recent microwave pass. Note that since we do both a forward &<br clear="none">> ;; backward interpolation in time, the nearest time may be prior to<br clear="none">> ;; the file time stamp or after it.<br clear="none">> ;;<br clear="none">> ;; - the 3rd record contains an ID that tells the satellite from which<br clear="none">> the last<br clear="none">> ;; microwave observation was made which can be interpretted by the<br clear="none">> following<br clear="none">> ;; table (as of the time of the last update of this documentation):<br clear="none">> ;;<br clear="none">><br clear="none">><br clear="none">> How should I see the rest of them??<br clear="none">><br clear="none">><br clear="none">><br clear="none">> On Monday, 21 December 2015 8:03 PM, Dennis Shea <<a shape="rect" ymailto="mailto:shea@ucar.edu" href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br clear="none">><br clear="none">><br clear="none">> Also ... *you* must read the documentation carefully. The documentation<br clear="none">> 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">>><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<br clear="none">>> *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<br clear="none">>> 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">>>><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">>>><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">>>><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<br clear="none">>>> 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><br clear="none">><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">><br clear="none">><br clear="none"></div><br><br></div> </div> </div> </div></div></body></html>