Re: Do not need to reverse?

From: Yi Wang <yiwang6_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 11 2010 - 13:21:30 MDT

Dear friends,

I see. Thanks a lot.

Best,
Yi

On Fri, Jun 11, 2010 at 1:58 PM, Dennis Shea <shea@ucar.edu> wrote:

> Well,
>
> [1]
> if you open *without* the hdfeos or he2 extensions, then you get the
> meta data (eg, scale_factor, add_offset,..) BUT you do not get the
> coordinates.
>
> [2]
> if you open *with* the file contains the coordinate information
> but no attributes.
>
> This has been called to the attenion on the core NCL developers.
>
> ---
> Please send all questions to ncl-talk.
>
> That way everybody see the questions.
>
> THX
> D
>
>
>
>
>
> On 6/11/10 12:32 PM, Yi Wang wrote:
>
>> Dear Shea and Mary,
>> Thanks a lot for your help. Now the previous question has already been
>> clear. But I have another quick question which is still about the same
>> hdf file.
>> I do not want hard codes, and I just want to get the fill value and
>> units from field attributes by using this:
>> data@_FillValue=data_unscaled@_FillValue
>> <mailto:data@_FillValue=data_unscaled@_FillValue>
>> res@gsnRightString <mailto:res@gsnRightString> = "UNITS: " +
>> data_unscaled@units <mailto:data_unscaled@units>
>>
>> However, I got the warning message:
>> warning:Attempt to reference attribute (_FillValue) which is undefined
>> warning:Attempt to reference attribute (units) which is undefined
>> Could you please tell me how to figure out this problem?
>> The corresponding files are here:
>> MYD08_D3.A2009001.005.2009048010832.hdf:
>>
>> ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/veer/MAP_DATA/files/LAADS/MYD/MYD08_D3/2009/001/MYD08_D3.A2009001.005.2009048010832.hdf
>>
>> Cloud_Fraction_Liquid.ncl: see attachment
>> Thank you so much.
>> Best,
>> Yi
>>
>> On Fri, Jun 11, 2010 at 7:40 AM, Mary Haley <haley@ucar.edu
>> <mailto:haley@ucar.edu>> wrote:
>>
>> Sorry, I didn't see this message, it got buried in my "HDF" folder
>> instead of the "ncl-talk" folder.
>> Please ignore my previous posting on this.
>>
>> --Mary
>>
>>
>> On Jun 10, 2010, at 10:44 PM, Dennis Shea wrote:
>>
>> When you use:
>> data_unscaled=eos_file->Cloud_Fraction_Liquid_mod08
>>
>> you get the meta data *including grid coordinates* attached to
>> the variable. Immediately after the above use
>> printVarSummary(data_nscale)
>>
>> Variable: data_unscaled
>> Type: short
>> Total Size: 129600 bytes
>> 64800 values
>> Number of Dimensions: 2
>> Dimensions and sizes: [YDim_mod08 | 180] x [XDim_mod08 | 360]
>> Coordinates:
>> YDim_mod08: [89.5..-89.5]
>> XDim_mod08: [-179.5..179.5]
>> Number Of Attributes: 3
>> _FillValue : -9999
>> hdfeos_name : Cloud_Fraction_Liquid
>> projection : Geographic
>>
>>
>> You will see coordinate variables
>> YDim_mod08: [89.5..-89.5]
>> XDim_mod08: [-179.5..179.5]
>>
>> ================================
>> When you create a *new* variable (data) via
>> data=data_unscaled*1.0E-4
>> printVarSummary(data)
>>
>> You will see no coordinate information.
>> NCL uses default coordinate whic are south-to-north.
>> Hence your plot.
>>
>> By the way:
>> data@lat1d=eos_file->YDim_mod08
>> data@lon1d=eos_file->XDim_mod08
>>
>> has no meaning to NCL.
>>
>> ======================
>>
>> Attached is working script.
>>
>> =============================
>> Good luck
>>
>> On 6/10/10 5:03 PM, Yi Wang wrote:
>>
>> Dear friends,
>> I have a question. I used Cloud_Fraction_Liquid.ncl (see
>> attachments) to
>> draw the plot for MYD08_D3.A2009001.005.2009048010832.hdf
>> (
>> ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/veer/MAP_DATA/files/LAADS/MYD/MYD08_D3/2009/001/MYD08_D3.A2009001.005.2009048010832.hdf
>> ).
>> I thought I did not need to reverse the plot by using this:
>> lat=lat(::-1) ; use north-to-south latitude ordering
>> But finally the output
>> (MYD08_D3.A2009001.005.2009048010832_Cloud_Fraction_Liquid.pdf
>> in the
>> attachments) looks wrong.
>> The reason I say the output is wrong is that:
>> From the corresponding
>> MYD08_D3.A2009001.005.2009048010832.hdf,
>> you can see:
>> the data in Cloud_Fraction_Liquid field has the first 30
>> rows full of
>> fill value,
>> and the data in YDim field is from 89.5 to -89.5.
>> These probably means the output plot will have blank areas
>> in the north
>> of the earth. But my current output plot (in
>> MYD08_D3.A2009001.005.2009048010832_Cloud_Fraction_Liquid.pdf)
>> has blank
>> areas in the south of the earth.
>> I think it should not be reversed (using the codes like
>> lat=lat(::-1))
>> in the ncl codes, but if not reverse, the plot looks wrong,
>> could you
>> please tell me where came the problem? Thanks a lot.
>> Best,
>> Yi Wang
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>> <Cloud_Fraction_Liquid.ncl>_______________________________________________
>>
>>
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 11 13:21:38 2010

This archive was generated by hypermail 2.1.8 : Wed Jun 16 2010 - 15:28:33 MDT