<div dir="ltr"><div><div><div><div><div><div>I don't think people have time to look at code that has been heavily commented. <br></div><div>You should send clean minimal scripts that illustrate the problem(s).<br></div><div>*Out time is valuable too!*<br></div><div><br></div><div>I think you asked about TRMM HDF files before. These A* TRMM files have issues. For example, no _FillValue or missing_value attribute associated with the data. It becomes *your* responsibility to address these file/variable issues. <br><br>My guess is that the A25 file is somewhat analogous to the A12 file at<br><br><a href="http://www.ncl.ucar.edu/Applications/HDF.shtml">http://www.ncl.ucar.edu/Applications/HDF.shtml</a><br><a href="http://www.ncl.ucar.edu/Applications/Scripts/hdf4sds_6.ncl">hdf4sds_6.ncl</a><br><br><br>A quick scan of your code .... ***LOOK*** at the outputs as you go along. <br><br></div><div><br>---<br></div><div>[1] I have no idea why ypu are using so many temporary variables. <br></div><div><br> Z_short = hdf4_file->correctZFactor<br> printVarSummary(Z_short)<br> printMinMax(Z_short,0) <br><br></div><div> Z_short@_FillValue = toshort(-9999) ; _FillValue must match the variable type<br></div><div> Z_short = where(Z_short.lt.0, Z_short@_FillValue, Z_short)<br> printMinMax(Z_short,0)<br><br> Z_fnl = Z_short/(Z_short@scale_factor) ; same type as typeof(Z_short@scale_factor) <br> printVarSummary(Z_fnl)<br> printMinMax(Z_fnl,0)<br><br> copy_VarCoords(Z_short, Z_fnl) ; add meta data<br> Z_fnl@long_name = Z_short@hdf_name<br> Z_fnl@units = Z_short@units<br> printVarSummary(Z_fnl) ; 3D; (:,:,:)<br> printMinMax(Z_fnl,0)<br><br></div><div><br><br></div>[2] Why are you using a double 'do loop' ?<br><br> do NS = 0, Total_Nscan-1<br> do NP = 0, Total_Npix-1 <br><br></div> Why not the dim_max_n or dim_max_n_Wrap? Faster, cleaner, clearer !<br> <a target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_max_n.shtml">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Built-in/dim_max_<wbr>n.shtml</a><br> <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/dim_max_n_Wrap.shtml">http://www.ncl.ucar.edu/Document/Functions/Contributed/dim_max_n_Wrap.shtml</a><br><br> max_Z = dim_max_n_Wrap(Z_fnl,2) ; Z_fnl(0,1,2) <== dimension numbers, 2 is level<br></div> printVarSummary(max_Z) ; (:,:)<br></div> printMinMax(max_Z, 0)<br><br></div></div><div><div><div><div> <wbr> <br>[3] <br></div><div>Using your settings<br><br></div><div> maz_Z@lat2d = latitude<br></div><div> maz_Z@lon2d = longitude <br><br>; graphics<br><br> WKS_maxZ = gsn_open_wks("png","maxZ")<br><br> max_Z@lat2d = latitude<br> max_Z@lon2d = longitude<br><br> PLOT_maxZ = gsn_csm_contour_map(WKS_maxZ,max_Z,False) ; global<br><br> res = True<br> res@mpMinLatF = 5.000<br> res@mpMaxLatF = 20.0<br> res@mpMinLonF = 72.0<br> res@mpMaxLonF = 84.0<br><br> res@gsnDraw = True ; default is True<br> res@gsnFrame = True ; default is True<br><br> res@cnFillOn = True<br> res@cnLevelSelectionMode = "ExplicitLevels"<br> res@cnLevels = (/4,12,20,28,36,44,52/)<br> PLOT_maxZ = gsn_csm_contour_map(WKS_maxZ,max_Z,res)<br><br></div><div><br><div><br><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 20, 2016 at 9:30 AM, Geeta Geeta <span dir="ltr"><<a href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288"><span id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9476">Hi all. </span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span>I am using orbital data. One of the variables that I am interested in is Reflectivity (Z) which is 3 dim (Nscan,Npix,Nlevel). </span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span>Nscan =0,9247, </span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span>Npix = 0, 48</span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span>Nlevel = 0,79. </span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span><br></span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span>I have found out the maximum value of Z at each pixel ie. Max Z is the maximum value amongst 80 levels. This variable in my code is named as max_Z. </span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span><br></span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span>Now this variable is one dimensional, I need a 2 dim plot. I am attaching one of the sample plot of Z at level 64. </span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span><br></span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span>I got this error. </span></div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12741"> 453152 values</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12742">Number of Dimensions: 2</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12743">Dimensions and sizes:<span style="white-space:pre-wrap" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12744">        </span>[9248] x [49]</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12745">Coordinates: </div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12746">Number Of Attributes: 1</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12747"> _FillValue :<span style="white-space:pre-wrap" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12748">        </span>-9999</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12749"><br id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12750"></div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12751">Variable: Z_fnl_le170_removd</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12752">Type: double</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12753">Total Size: 3625216 bytes</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12754"> 453152 values</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12755">Number of Dimensions: 2</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12756">Dimensions and sizes:<span style="white-space:pre-wrap" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12757">        </span>[9248] x [49]</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12758">Coordinates: </div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12759">Number Of Attributes: 1</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12760"> _FillValue :<span style="white-space:pre-wrap" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12761">        </span>-9999</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12762">(0)<span style="white-space:pre-wrap" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12763">        </span> </div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12764">(0)<span style="white-space:pre-wrap" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12765">        </span>min=0 max=52.05</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12766">fatal:Variable (max_Z) has (1) dimensions can not write to dimension (1)</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12767">fatal:["Execute.c":8578]:<wbr>Execute: Error occurred at or near line 109 in file 2a25.080324.proj.v1.ncl</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12768"><br id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12769"></div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12768"><br></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"></div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12770">aditya@agniilap:~/geeta/ncl/<wbr>ReadHDF-2A2</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12770"><br></div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12770">How to go about making 2 dim plot. </div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21233">(0) NS 9247 20max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21234">(0) NS 9247 21max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21235">(0) NS 9247 22max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21236">(0) NS 9247 23max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21237">(0) NS 9247 24max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21238">(0) NS 9247 25max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21239">(0) NS 9247 26max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21240">(0) NS 9247 27max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21241">(0) NS 9247 28max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21242">(0) NS 9247 29max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21243">(0) NS 9247 30max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21244">(0) NS 9247 31max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21245">(0) NS 9247 32max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21246">(0) NS 9247 33max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21247">(0) NS 9247 34max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21248">(0) NS 9247 35max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21249">(0) NS 9247 36max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21250">(0) NS 9247 37max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21251">(0) NS 9247 38max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21252">(0) NS 9247 39max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21253">(0) NS 9247 40max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21254">(0) NS 9247 41max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21255">(0) NS 9247 42max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21256">(0) NS 9247 43max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21257">(0) NS 9247 44max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21258">(0) NS 9247 45max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21259">(0) NS 9247 46max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21260">(0) NS 9247 47max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21261">(0) NS 9247 48max_Z is = 0</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21262">(0) Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21263">warning:create: Bad HLU id passed to create, ignoring it</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21264">^M</div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21265"><br id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_21266"></div><div dir="ltr" id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_12770">It would be very kind of you to suggest. </div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_19404">I am attaching the output when I run this code on my system. Kindly suggest</span></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9288" dir="ltr"><span> </span></div><div></div><div id="m_4935966058159441661yui_3_16_0_ym19_1_1479630463985_9395"> </div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>