<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span> Hi </span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>I have correctec the lines 34 and 35. of my file. </span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>1 ;Reading HDF4-SDS files<br> 2 ;*********** Load Libraries ************************************<br> 3 load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br> 4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br> 5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br> 6 ;**************************************************************<br> 7 begin<br> 8 ;***************************************************************<br> 9 ; User Input<br> 10 ;***************************************************************<br> 11 ; INPUT<br>
12 diri = "./" ; input directory<br> 13 fili = "2A12.20100702.71931.7.HDF" ; file<br> 14 var = "latentHeat" ; desired variable<br> 15<br>
16 ; OUTPUT<br> 17 PLOT = True ; create a plot [?]<br> 18 pltDir = "./" ; directory for plot output<br> 19 ;pltName = "2A12.100702.71931.6" ; plot
name<br> 20 pltName = "hdf4sds" ; plot name<br> 21 pltType = "ps" ; ps, pdf, x11, png
[5.2.0] <br> 22 ;***************************************************************<br> 23 ; End User Input<br> 24
;***************************************************************<br> 25 ; Read hdf<br> 26 ;***************************************************************<br> 27<br> 28 f = addfile (diri+fili, "r") ; reading inputfile<br> 29 ;print(f)<br> 30<br> 31 lat = f->Latitude(:,:) ; (scan, pixel)<br> 32 lon = f->Longitude(:,:)<br> 33<br> 34 <a href="mailto:lat@units">lat@units</a> =
"degrees_north" ; add units<br> 35 <a href="mailto:lon@units">lon@units</a> = "degrees_east"<br> 36<br> 37 printMinMax(lat, True)<br> 38 printMinMax(lon, True)<br> 39<br> 40 xs = f->$var$ ; ( scan, pixel, layer )<br> 41 <a href="mailto:xs@_FillValue">xs@_FillValue</a> = inttoshort( -9999 ) ; visually look at file/data<br> 42 <a href="mailto:xs@long_name">xs@long_name</a> = <a
href="mailto:xs@hdf_name">xs@hdf_name</a><br> 43 ;printVarSummary(xs)<br> 44 ;printMinMax(xs, True)<br></span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>Now when I run this </span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size:
16px; font-style: normal; background-color: transparent;"><span>I get following error</span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>bash-3.2$ ncl hdf4sds_6.ncl<br> Copyright (C) 1995-2007 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 5.0.0<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/">http://www.ncl.ucar.edu/</a> for more details.<br>(0)<br>(0) min=-39.1053 max=39.0529<br>(0)<br>(0) min=-179.999 max=180<br>fatal:Either file (f) isn't defined or variable (latentHeat) is not a variable in the file<br>fatal:Execute: Error occurred at or near line 40 in file hdf4sds_6.ncl<br> <br>bash-3.2$<br></span></div><div
style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>I am beginner to NCL. Started a week before as I have to plot the Hydrometeor profile. Kindly guide further.
</span></div><div><span><br></span></div><div> </div><div>Geeta. </div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Tuesday,
2 September 2014 4:28 PM, Geeta Geeta <geetag54@yahoo.com> wrote:<br> </font> </div> <br><br> <div><div id="yiv1562493717"><div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><div><span>Thanks. </span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>I corrected my mistake and this is how the NCL file looks like now. </span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>;Reading HDF4-SDS files<br clear="none">;*********** Load Libraries ************************************<br clear="none">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br clear="none">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br
clear="none">load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br clear="none">;**************************************************************<br clear="none">begin<br clear="none">;***************************************************************<br clear="none">; User Input<br clear="none">;***************************************************************<br clear="none"> ; INPUT<br clear="none"> diri = "./" ; input directory<br clear="none"> fili =
"2A12.20100702.71931.7.HDF" ; file<br clear="none">
var = "latentHeat" ; desired variable<br clear="none">
<br clear="none"> ; OUTPUT<br clear="none"> PLOT = True ; create a plot [?]<br clear="none"> pltDir = "./" ; directory for plot output<br clear="none"> ;pltName = "2A12.100702.71931.6" ; plot name<br clear="none"> pltName =
"hdf4sds" ; plot name<br clear="none"> pltType = "ps" ; ps, pdf, x11, png
[5.2.0] <br clear="none">;***************************************************************<br clear="none">; End User Input<br clear="none">;***************************************************************<br clear="none">; Read
hdf<br clear="none">;***************************************************************<br clear="none"> <br clear="none">"hdf4sds_6.ncl" 188 lines, 6725 charac</span></div><div></div><div> </div><div>I run NCL but got following message. </div><div>bash-3.2$ ncl hdf4sds_6.ncl<br clear="none"> Copyright (C) 1995-2007 - All Rights Reserved<br clear="none"> University
Corporation for Atmospheric Research<br clear="none"> NCAR Command
Language Version 5.0.0<br clear="none"> The use of this software is governed by a License Agreement.<br clear="none"> See <a href="http://www.ncl.ucar.edu/" target="_blank" rel="nofollow" shape="rect">http://www.ncl.ucar.edu/</a> for more details.<br clear="none">fatal:Either file (f) isn't defined or variable (geolocation) is not a variable in the file<br clear="none">fatal:Execute: Error occurred at or near line 31 in file hdf4sds_6.ncl<br clear="none"> <br clear="none">bash-3.2$</div><div><br clear="none"></div><div><br clear="none"></div><div>I am attaching the ncl file for reference. </div><div><br clear="none"></div><div>This is the header information that I extracted using </div><div>bash-3.2$ ncl_filedump 2A12.20100702.71931.7.HDF >header2010</div><div><br clear="none"></div><div>I am attaching the header2010 as well. there is NO geolocation Variable in that. So what I should DO. </div><div><br clear="none"></div><div>Geeta.
</div> <div><br clear="none"><br clear="none"></div><div style="display: block;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div id="yiv1562493717yqtfd56433"><div dir="ltr"> <font face="Arial" size="2"> On Tuesday, 2 September 2014 3:57 PM, Alessandra Giannini <alesall@iri.columbia.edu> wrote:<br clear="none"> </font> </div> <br clear="none"><br clear="none"> <div><br clear="none">Hi Geeta, <br clear="none"><br clear="none">NCL is telling you what may be wrong…<br clear="none"><br clear="none">Either your filename is slightly off: <br clear="none"><br clear="none">in your script you call a file by the name "2A12.20100702.71931.6.HDF", but when you list, you have a file with a 7 at the end, instead of a 6: "2A12.20100702.71931.7.HDF"<br clear="none"><br clear="none">Or there is no variable called "geolocation" in the
file you are reading from.<br clear="none"><br clear="none">What are latitude and longitude called in the file?<br clear="none"><br clear="none">best, alessandra<br clear="none"><br clear="none"><br clear="none"><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">Alessandra Giannini<br clear="none">IRI for Climate and Society - The Earth Institute at Columbia University<br clear="none">P.O. Box 1000, Palisades NY 10964-8000<br clear="none">phone/fax: +1 845 680-4473/4864 - email: <a href="mailto:alesall@iri.columbia.edu" target="_blank" rel="nofollow" shape="rect" ymailto="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a><br clear="none"><br clear="none">On Sep 2, 2014, at 6:21 AM, Geeta Geeta <<a href="mailto:geetag54@yahoo.com" target="_blank" rel="nofollow" shape="rect" ymailto="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>> wrote:<br clear="none"><br clear="none">> Hi .<br clear="none">> I am trying to
plot the data in HDF format using NCL.<br clear="none">> <br clear="none">> I happen to see the ready script available <a href="https://www.ncl.ucar.edu/Applications/Scripts/hdf4sds_6.ncl" target="_blank" rel="nofollow" shape="rect">https://www.ncl.ucar.edu/Applications/Scripts/hdf4sds_6.ncl</a>which reads HDF data.<br clear="none">> <br clear="none">> On my system I downloaded this script and tried to run this but when I run this, following message comes.<br clear="none">> bash-3.2$ ncl hdf4sds_6.ncl<br clear="none">> Copyright (C) 1995-2007 - All Rights Reserved<br clear="none">> University Corporation for Atmospheric Research<br clear="none">> NCAR Command Language Version 5.0.0<br clear="none">> The use of this software is governed by a License Agreement.<br clear="none">> See <a href="http://www.ncl.ucar.edu/" target="_blank" rel="nofollow" shape="rect">http://www.ncl.ucar.edu/</a>for more
details.<br clear="none">> fatal:_NclCreateFile: Requested file does not exist as (./2A12.20100702.71931.6.HDF) or as (./2A12.20100702.71931.6), can't add file<br clear="none">> fatal:Either file (f) isn't defined or variable (geolocation) is not a variable in the file<br clear="none">> fatal:Execute: Error occurred at or near line 31 in file hdf4sds_6.ncl<br clear="none">> <br clear="none">> bash-3.2$ ls -l *HDF*<br clear="none">> -rw-r--r-- 1 model staff 55092053 Sep 01 15:54 2A12.20100702.71931.7.HDF<br clear="none">> -rw-r--r-- 1 model staff 55092079 Aug 12 11:13 2A12.20130523.88390.7.HDF<br clear="none">> -rw-r--r-- 1 model staff 55092085 Aug 12 15:27 2A12.20140602.94247.7.HDF<br clear="none">> bash-3.2$ ls -l *hdf*ncl*<br clear="none">> -rw-r--r-- 1 model
staff
6725 Sep 01 17:01 hdf4sds_6.ncl<br clear="none">> bash-3.2$<br clear="none">> <br clear="none">> The files exist in my directory.<br clear="none">> Can somebody tell me what's mistake???<br clear="none">> Geeta.<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">> List instructions, subscriber options, unsubscribe:<br clear="none">> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" rel="nofollow" shape="rect">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br clear="none"><br clear="none"><br clear="none"></div> </div></div><div id="yiv1562493717yqtfd64452"> </div></div><div id="yiv1562493717yqtfd46026"> </div></div><div id="yiv1562493717yqtfd35497"> </div></div></div></div><br><br></div> </div> </div> </div> </div></body></html>