<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_7188" dir="ltr"><span id="yui_3_16_0_1_1450592720313_7220">I have to plot 8km_30minutes resolution CMORPH rainfall. </span></div><div id="yui_3_16_0_1_1450592720313_7188" dir="ltr"><span id="yui_3_16_0_1_1450592720313_7225">The data is binary format. and has 24 files of each hour. </span></div><div id="yui_3_16_0_1_1450592720313_7188" dir="ltr" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7273" class=""><div dir="ltr" id="yui_3_16_0_1_1450592720313_7273" class="">-rw-r--r-- 1 aditya aditya 48955512 Dec 1 19:33 CMORPH_8KM-30MIN_2015113021<br></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7273" class="">-rw-r--r-- 1 aditya aditya 48955512 Dec 1 19:33 CMORPH_8KM-30MIN_2015113022</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7273" class="">-rw-r--r-- 1 aditya aditya 48955512 Dec 1 19:33 CMORPH_8KM-30MIN_2015113023</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7325" class=""><br id="yui_3_16_0_1_1450592720313_7327" class=""></div></div><div id="yui_3_16_0_1_1450592720313_7188" dir="ltr">As per the documentation of this data from (ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/CMORPH_8km-30-minute.ctl)</div><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_7373" class="">DSET /your-data-set-path/advt-8km-intrp-prim-sat-spat-2lag-2.5+5dovlp8kmIR-%y4%m2%d2%h2
OPTIONS yrev big_endian template
UNDEF 255
TITLE correlation estimates
XDEF 4948 LINEAR 0.036378335 0.072756669
YDEF 1649 LINEAR -59.963614 0.072771377
ZDEF 01 LEVELS 1
TDEF 99999 LINEAR 00z21dec2002 30mn
VARS 3
cmorph 1 -1,40,1,-1 xxxxxx yyyyy (mult. by 0.2 to get mm/hr units)
time 1 -1,40,1,-1 xxxxxx yyyyy
satid 1 -1,40,1,-1 xxxxxx yyyyy
ENDVARS
</pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_7373" class="">there are 3 records, 1st record being the desired parameter. (ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/README.cmorph.8km_30minute). </pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_7373" class="">I have to plot each hourly file and then get 24 hrs rainfall for a day. </pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_7373" class="">;;;;;;;Code;</pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_7373" class=""> print(isbigendian)
; ----Defining for Once -----
wks = gsn_open_wks("ps","CMO-v1")
gsn_define_colormap(wks,"prcp_2")
nlat = 1649
nlon = 4948
;--------------------------------------------------
lat = -59.963614 + ispan(0,nlat-1,1)*0.072771377
; print(lat)
lon = 0.036378335 + ispan(0,nlon-1,1)*0.072756669
; print(lon)
setfileoption("bin","ReadByteOrder","BigEndian")
; cmorrf = fbinrecread("test.bin",0,(/nlat,nlon/),"float") ; print 0th record. </pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_7373" class=""><br></pre><pre style="word-wrap: break-word;" id="yui_3_16_0_1_1450592720313_7373" class=""><pre id="yui_3_16_0_1_1450592720313_7373" class="" style="word-wrap: break-word;">cmorrf = fbinrecread("test.bin",0,-1,"float") ; print 0th record.</pre>
print("Sizeof rf ="+dimsizes(cmorrf))
; print(cmorrf)
asciiwrite("rf.txt",cmorrf)
</pre><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">When I run this, </div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class=""><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">See http://www.ncl.ucar.edu/ for more details.</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">(0)<span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1450592720313_7658">        </span>False</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">warning:fbinrecread: size specified is greater than record size, filling with missing values</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">(0)<span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1450592720313_7662">        </span>Sizeof rf =1649</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">(1)<span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1450592720313_7665">        </span>Sizeof rf =4948</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">when I use -1 in line defining cmorphh, I get this output. </div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">aditya@agniilap:~/geeta/ncl/CMORPH$ See http://www.ncl.ucar.edu/ for more details.</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">(0)<span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1450592720313_7769">        </span>False</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">(0)<span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1450592720313_7772">        </span>Sizeof rf =0</div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7774" class=""><br id="yui_3_16_0_1_1450592720313_7776" class=""></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class=""><br id="yui_3_16_0_1_1450592720313_7669" class=""></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">no rainfall is written to the file. <br></div></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">Also the 1st and 2nd records are not being shown. </div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1450592720313_7375" class="">Pls suggest. </div></div></body></html>