<div dir="ltr"><div><div><div><div><div><div>Hi Geeta, <br><br>[1]<br></div>The examples from which you downloaded a script ar not meant to be codes that you change file names and or variables and they will work. Rather, they are guides to creating a script that can do what you need.<br>
<br>[2]<br></div>As has been stated many times on ncl-talk:<br><br> The most important rule of data processing to **Look at the data**.<br><br></div>ncl_filedump foo.hdf | less<br><br></div>ncl_filedump foo.hdf.he2 | less ..... (read as HDF-EOS file)<br>
<br></div>This means look at all variable names/units, etc.<br></div>Also, what coordinates are on the file.<br><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 2, 2014 at 8:50 AM, H. Joe Lee <span dir="ltr"><<a href="mailto:hyoklee@hdfgroup.org" target="_blank">hyoklee@hdfgroup.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Geeta!<br>
<br>
I am sorry but I misunderstood your problem.<br>
<br>
I think you can match dimensions utilizing "clusterNumber" variable<br>
for "ncluster" dimension and "freezingHeightIndex" variable for<br>
"findex" dimension. They contain index values that can be used for<br>
subsetting "cluster" variable.<br>
<div class="im HOEnZb"><br>
<br>
--<br>
Save the Earth. Save Earth data in HDF-EOS. Save Big data in HDF.<br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">On Tue, Sep 2, 2014 at 8:47 AM, H. Joe Lee <<a href="mailto:hyoklee@hdfgroup.org">hyoklee@hdfgroup.org</a>> wrote:<br>
> Hi, Geeta!<br>
><br>
> 2A12 product doesn't contain "graupel" variable.<br>
><br>
> Please download a correct product that has grapple variable like 2B31 product:<br>
><br>
> <a href="http://disc.sci.gsfc.nasa.gov/precipitation/documentation/TRMM_README/TRMM_2B31_readme.shtml" target="_blank">http://disc.sci.gsfc.nasa.gov/precipitation/documentation/TRMM_README/TRMM_2B31_readme.shtml</a><br>
><br>
><br>
><br>
> By the way, a complete 2A12 version 7 NCL example is available here:<br>
><br>
> <a href="http://hdfeos.org/zoo/index_openGESDISC_Examples.php#TRMM" target="_blank">http://hdfeos.org/zoo/index_openGESDISC_Examples.php#TRMM</a><br>
><br>
> --<br>
> Save the Earth. Save Earth data in HDF-EOS. Save Big data in HDF.<br>
><br>
><br>
> On Tue, Sep 2, 2014 at 6:27 AM, Geeta Geeta <<a href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>> wrote:<br>
>> I want to plot the GRAUPEL WATER CONTENT at a LAT/LON with height. So Y axis<br>
>> will be the HEIGHT and on X axis it will Graupel<br>
>> But the document of 2A12<br>
>> (<a href="http://pps.gsfc.nasa.gov/Documents/filespec.TRMM.V7.pdf)%20says" target="_blank">http://pps.gsfc.nasa.gov/Documents/filespec.TRMM.V7.pdf)%20says</a> that The<br>
>> information ablout this variable is CONTAINED in the two variables (Pg 119)<br>
>> 7.5 2A12 - TMI Profiling 119<br>
>><br>
>><br>
>> S = species(1-6)<br>
>><br>
>> 1 = cloud water content<br>
>><br>
>> 2 = rain water content<br>
>><br>
>> 3 = cloud ice content<br>
>><br>
>> 4 = snow water content<br>
>><br>
>> 5 = graupel water content<br>
>><br>
>> 6 = latent heat<br>
>><br>
>> F = freezingHeightIndex<br>
>><br>
>> C = clusterNumber<br>
>><br>
>> In a Fortran program,<br>
>><br>
>> Profile Value = clusterScale * cluster(S,F,L,C)<br>
>><br>
>> In a C program,<br>
>><br>
>> Profile Value = clusterScale * cluster[C-1][L-1][F-1][S-1]<br>
>><br>
>> The two variables CLUSTER SCALE<br>
>> float clusterScale ( nscan, npixel, nspecies )<br>
>> hdf_name : clusterScale<br>
>><br>
>> AND CLUSTER<br>
>> float cluster ( ncluster, nlayer, nfindex, nspecies )<br>
>> hdf_name : cluster<br>
>><br>
>><br>
>> are of different dimensions.<br>
>> I donot know how to proceed further with this.<br>
>><br>
>> Geeta.<br>
>><br>
>><br>
>> On Tuesday, 2 September 2014 4:45 PM, Alessandra Giannini<br>
>> <<a href="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a>> wrote:<br>
>><br>
>><br>
>><br>
>> you need to continue to edit your script to adapt to your specific need…<br>
>> What is the variable that you want to plot? If it's not called "latentHeat"<br>
>> what is it called?<br>
>> Then substitute just like you did for lat and lon…<br>
>><br>
>><br>
>><br>
>><br>
>> On Sep 2, 2014, at 7:10 AM, Geeta Geeta <<a href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>> wrote:<br>
>><br>
>>> Hi<br>
>>> I have correctec the lines 34 and 35. of my file.<br>
>>><br>
>>> 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<br>
>>> output<br>
>>> 19 ;pltName = "2A12.100702.71931.6" ; plot name<br>
>>> 20 pltName = "hdf4sds" ; plot name<br>
>>> 21 pltType = "ps" ; ps, pdf, x11, png<br>
>>> [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 lat@units = "degrees_north" ; add units<br>
>>> 35 lon@units = "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 xs@_FillValue = inttoshort( -9999 ) ; visually look at<br>
>>> file/data<br>
>>> 42 xs@long_name = xs@hdf_name<br>
>>> 43 ;printVarSummary(xs)<br>
>>> 44 ;printMinMax(xs, True)<br>
>>><br>
>>><br>
>>> Now when I run this<br>
>>> I get following error<br>
>>> 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/for" target="_blank">http://www.ncl.ucar.edu/for</a> more details.<br>
>><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<br>
>>> 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>
>>><br>
>>> I am beginner to NCL. Started a week before as I have to plot the<br>
>>> Hydrometeor profile. Kindly guide further.<br>
>>><br>
>>><br>
>>> Geeta.<br>
>>><br>
>>><br>
>>> On Tuesday, 2 September 2014 4:28 PM, Geeta Geeta <<a href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>><br>
>>> wrote:<br>
>>><br>
>>><br>
>>> Thanks.<br>
>>> I corrected my mistake and this is how the NCL file looks like now.<br>
>>> ;Reading HDF4-SDS files<br>
>>> ;*********** Load Libraries ************************************<br>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
>>> ;**************************************************************<br>
>>> begin<br>
>>> ;***************************************************************<br>
>>> ; User Input<br>
>>> ;***************************************************************<br>
>>> ; INPUT<br>
>>> diri = "./" ; input directory<br>
>>> fili = "2A12.20100702.71931.7.HDF" ; file<br>
>>> var = "latentHeat" ; desired variable<br>
>>><br>
>>> ; OUTPUT<br>
>>> PLOT = True ; create a plot [?]<br>
>>> pltDir = "./" ; directory for plot output<br>
>>> ;pltName = "2A12.100702.71931.6" ; plot name<br>
>>> pltName = "hdf4sds" ; plot name<br>
>>> pltType = "ps" ; ps, pdf, x11, png [5.2.0]<br>
>>> ;***************************************************************<br>
>>> ; End User Input<br>
>>> ;***************************************************************<br>
>>> ; Read hdf<br>
>>> ;***************************************************************<br>
>>><br>
>>> "hdf4sds_6.ncl" 188 lines, 6725 charac<br>
>>><br>
>>> I run NCL but got following message.<br>
>>> 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/for" target="_blank">http://www.ncl.ucar.edu/for</a> more details.<br>
>><br>
>>> fatal:Either file (f) isn't defined or variable (geolocation) is not a<br>
>>> variable in the file<br>
>>> fatal:Execute: Error occurred at or near line 31 in file hdf4sds_6.ncl<br>
>>><br>
>>> bash-3.2$<br>
>>><br>
>>><br>
>>> I am attaching the ncl file for reference.<br>
>>><br>
>>> This is the header information that I extracted using<br>
>>> bash-3.2$ ncl_filedump 2A12.20100702.71931.7.HDF >header2010<br>
>>><br>
>>> I am attaching the header2010 as well. there is NO geolocation Variable in<br>
>>> that. So what I should DO.<br>
>>><br>
>>> Geeta.<br>
>>><br>
>>><br>
>>> On Tuesday, 2 September 2014 3:57 PM, Alessandra Giannini<br>
>>> <<a href="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a>> wrote:<br>
>>><br>
>>><br>
>>><br>
>>> Hi Geeta,<br>
>>><br>
>>> NCL is telling you what may be wrong…<br>
>>><br>
>>> Either your filename is slightly off:<br>
>>><br>
>>> in your script you call a file by the name "2A12.20100702.71931.6.HDF",<br>
>>> but when you list, you have a file with a 7 at the end, instead of a 6:<br>
>>> "2A12.20100702.71931.7.HDF"<br>
>>><br>
>>> Or there is no variable called "geolocation" in the file you are reading<br>
>>> from.<br>
>>><br>
>>> What are latitude and longitude called in the file?<br>
>>><br>
>>> best, alessandra<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Alessandra Giannini<br>
>>> IRI for Climate and Society - The Earth Institute at Columbia University<br>
>>> P.O. Box 1000, Palisades NY 10964-8000<br>
>>> phone/fax: +1 845 680-4473/4864 - email: <a href="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a><br>
>>><br>
>>> On Sep 2, 2014, at 6:21 AM, Geeta Geeta <<a href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>> wrote:<br>
>>><br>
>>> > Hi .<br>
>>> > I am trying to plot the data in HDF format using NCL.<br>
>>> ><br>
>>> > I happen to see the ready script available<br>
>>> > <a href="https://www.ncl.ucar.edu/Applications/Scripts/hdf4sds_6.nclwhichreads" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/hdf4sds_6.nclwhichreads</a> HDF<br>
>>> > data.<br>
>><br>
>>> ><br>
>>> > On my system I downloaded this script and tried to run this but when I<br>
>>> > run this, following message comes.<br>
>>> > 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/formore" target="_blank">http://www.ncl.ucar.edu/formore</a> details.<br>
>><br>
>>> > fatal:_NclCreateFile: Requested file does not exist as<br>
>>> > (./2A12.20100702.71931.6.HDF) or as (./2A12.20100702.71931.6), can't add<br>
>>> > file<br>
>>> > fatal:Either file (f) isn't defined or variable (geolocation) is not a<br>
>>> > variable in the file<br>
>>> > fatal:Execute: Error occurred at or near line 31 in file hdf4sds_6.ncl<br>
>>> ><br>
>>> > bash-3.2$ ls -l *HDF*<br>
>>> > -rw-r--r-- 1 model staff 55092053 Sep 01 15:54<br>
>>> > 2A12.20100702.71931.7.HDF<br>
>>> > -rw-r--r-- 1 model staff 55092079 Aug 12 11:13<br>
>>> > 2A12.20130523.88390.7.HDF<br>
>>> > -rw-r--r-- 1 model staff 55092085 Aug 12 15:27<br>
>>> > 2A12.20140602.94247.7.HDF<br>
>>> > bash-3.2$ ls -l *hdf*ncl*<br>
>>> > -rw-r--r-- 1 model staff 6725 Sep 01 17:01 hdf4sds_6.ncl<br>
>>> > bash-3.2$<br>
>>> ><br>
>>> > The files exist in my directory.<br>
>>> > Can somebody tell me what's mistake???<br>
>>> > Geeta.<br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > ncl-talk mailing list<br>
>>> > List instructions, subscriber options, unsubscribe:<br>
>>> > <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>>><br>
>>><br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> ncl-talk mailing list<br>
>> List instructions, subscriber options, unsubscribe:<br>
>> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>><br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</div></div></blockquote></div><br></div>