Fwd: how to handle varying variable name in list of grib files

From: samir pokhrel <samir_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 23 2013 - 00:15:24 MDT

Dear Gibies,

Thats awesome, it worked. This will be great help to other new ncl users as
well.

Thanks again

Samir

On Tue, Jul 23, 2013 at 11:15 AM, gibies george <gibies@tropmet.res.in>wrote:

> Samirji,
>
> Time unit can be the same as
>
> time@units = "hours since 2013-01-01 00:00:00"
>
> and time array can be given explicitly as
>
> time=(/3,6,9,12,15,18,21,24,
> 30,36,42,48, 54,60,66,72, 78,84,90,96, 102,108,114,120,
> 132,144,156,168
> 192,216/)
>
> Am I right Dr David Brown ?
>
>
> On 23 July 2013 10:58, samir pokhrel <samir@tropmet.res.in> wrote:
>
>> Hi David,
>>
>> As you know that my files has 25 time step (first 3 hour, then 6 hour
>> then 12 hour and lastly 24 hour). In general whenever we assign time it has
>> fixed interval (viz. hourly or daily or monthly and so on) so in that case
>> we can easily assign time units (e.g for hourly data) by
>>
>> time@units = "hours since 2013-01-01 00:00:00"
>>
>> On the similar line how can we assign hour units of 3hr, 6hr, 12hr and 24
>> hr together in a variable, so that the variable first 8 record should have
>> 3 hour interval, next 16 record should have 6 hour interval, next 4 record
>> should have 12 hour interval and lastly 2 record should have 24 hour
>> interval.
>>
>> I hope now I am clear.
>>
>> Thanking you
>>
>> Samir
>>
>>
>>
>> On Tue, Jul 23, 2013 at 1:10 AM, David Brown <dbrown@ucar.edu> wrote:
>>
>>> Hi Samir,
>>> I am not sure I understand the question about irregular time intervals.
>>> Can you give an example of what you need to do specifically?
>>> -dave
>>>
>>> On Jul 21, 2013, at 11:54 PM, samir pokhrel <samir@tropmet.res.in>
>>> wrote:
>>>
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: samir pokhrel <pokhrelsamir@gmail.com>
>>> Date: Mon, Jul 22, 2013 at 11:22 AM
>>> Subject: Re: how to handle varying variable name in list of
>>> grib files
>>> To: David Brown <dbrown@ucar.edu>
>>> Cc: ncl-talk@ucar.edu, "Sabeerali C. T." <sabeer@tropmet.res.in>, Rajib
>>> Chattopadhyay <rajib@tropmet.res.in>, "M.Mahakur" <
>>> mmahakur@tropmet.res.in>, "Mukho.Parthasarthy" <mpartha@tropmet.res.in>
>>>
>>>
>>> Thats Great David,
>>>
>>> Its working fine. Thanks a lot for your such a efficient solution.
>>> Regarding my second query do you have any idea to assign time with
>>> irregular intervals?
>>>
>>> Thanks again
>>>
>>> Samir
>>>
>>>
>>> On Fri, Jul 19, 2013 at 11:46 PM, David Brown <dbrown@ucar.edu> wrote:
>>>
>>>> Hi Samir,
>>>> There is a setfileoption that allows you to strip off the time period
>>>> suffixes and treat these variables as the same. It is a True/False logical
>>>> type option called TimePeriodSuffix.
>>>>
>>>> setfileoption("grb","TimePeriodSuffix",False)
>>>>
>>>> will cause all these variable names to be shortened
>>>> to "PRATE_4_SFC_ave", allowing them to be concatenated into a single
>>>> variable using addfiles. The forecast_time dimension should then contain
>>>> the varying intervals starting from the initial time for each element. Of
>>>> course it will be up to you to decide how to deal with the varying length
>>>> of the averaging period.
>>>> -dave
>>>>
>>>>
>>>> On Jul 19, 2013, at 5:57 AM, samir pokhrel <samir@tropmet.res.in>
>>>> wrote:
>>>>
>>>> Dear NCL users,
>>>>
>>>> I have a series of daily forecast (in grib2 format) from GFS T574 of
>>>> varying hours
>>>>
>>>> the first day forcast has 3 hour intervals (6 files)
>>>> the 2nd to 5th day forecast has 6 hour intervals (4 files each day for
>>>> 4 days = total 16 files)
>>>> the 6th day forecast has 12 hour intervals (i.e 2 files)
>>>> and the 7th (last) day forecast has 24 hour interval (i.e 1 file)
>>>>
>>>> so total I have 25 forecast file of one day
>>>>
>>>> I am reading all this file together using addfiles and also adding the
>>>> extra time dimension using setfileoption
>>>>
>>>> it is working fine with all other variable (viz. wind, temp etc),
>>>> however in case of precipitaion the variable name varies in each file so I
>>>> am not able to retrieve it
>>>>
>>>> Now I am having following two queries on these data
>>>>
>>>> First Query
>>>>
>>>> 1) How to handle same variable with different name in different files
>>>> so I can club them all together for further analysis
>>>>
>>>> File Name Variable Name
>>>> gfs.t00z.pgrbf03.grb PRATE_4_SFC_ave3h
>>>> gfs.t00z.pgrbf06.grb PRATE_4_SFC_ave6h
>>>> gfs.t00z.pgrbf09.grb PRATE_4_SFC_ave9h
>>>> gfs.t00z.pgrbf12.grb PRATE_4_SFC_ave12h
>>>> gfs.t00z.pgrbf18.grb PRATE_4_SFC_ave18h
>>>> gfs.t00z.pgrbf24.grb PRATE_4_SFC_ave24h
>>>> gfs.t00z.pgrbf30.grb PRATE_4_SFC_ave6h
>>>> gfs.t00z.pgrbf36.grb PRATE_4_SFC_ave12h
>>>> gfs.t00z.pgrbf42.grb PRATE_4_SFC_ave18h
>>>> gfs.t00z.pgrbf48.grb PRATE_4_SFC_ave24h
>>>> gfs.t00z.pgrbf54.grb PRATE_4_SFC_ave6h
>>>> gfs.t00z.pgrbf60.grb PRATE_4_SFC_ave12h
>>>> gfs.t00z.pgrbf66.grb PRATE_4_SFC_ave18h
>>>> gfs.t00z.pgrbf72.grb PRATE_4_SFC_ave24h
>>>> gfs.t00z.pgrbf78.grb PRATE_4_SFC_ave6h
>>>> gfs.t00z.pgrbf84.grb PRATE_4_SFC_ave12h
>>>> gfs.t00z.pgrbf90.grb PRATE_4_SFC_ave18h
>>>> gfs.t00z.pgrbf96.grb PRATE_4_SFC_ave24h
>>>> gfs.t00z.pgrbf102.grb PRATE_4_SFC_ave6h
>>>> gfs.t00z.pgrbf108.grb PRATE_4_SFC_ave12h
>>>> gfs.t00z.pgrbf114.grb PRATE_4_SFC_ave18h
>>>> gfs.t00z.pgrbf120.grb PRATE_4_SFC_ave24h
>>>> gfs.t00z.pgrbf132.grb PRATE_4_SFC_ave12h
>>>> gfs.t00z.pgrbf144.grb PRATE_4_SFC_ave24h
>>>> gfs.t00z.pgrbf168.grb PRATE_4_SFC_ave24h
>>>>
>>>>
>>>> Second Query
>>>>
>>>> 2) How to put time value of irregular interval in the clubbed variable
>>>> of all 25 files together
>>>>
>>>> Hope I am clear enough to make you all understand the issues.
>>>>
>>>> Thanks you all in advance.
>>>>
>>>> Regards
>>>>
>>>> Samir Pokhrel
>>>> Climate and Global Modelling Division
>>>> Indian Institute of Tropical Meteorology
>>>> NCL Post, Pashan
>>>> Pune-411008
>>>> INDIA _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Samir Pokhrel
>>> Climate and Global Modelling Division
>>> Indian Institute of Tropical Meteorology
>>> NCL Post, Pashan
>>> Pune-411008
>>> INDIA
>>>
>>> --
>>> Samir Pokhrel
>>> Climate and Global Modelling Division
>>> Indian Institute of Tropical Meteorology
>>> NCL Post, Pashan
>>> Pune-411008
>>> INDIA
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>> --
>>> Samir Pokhrel
>>> Climate and Global Modelling Division
>>> Indian Institute of Tropical Meteorology
>>> NCL Post, Pashan
>>> Pune-411008
>>> INDIA <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
>>
>>
>
>
> --
> *Gibies George,
> CSIR-Senior Research Fellow,*
> *Program for Model development and seasonal prediction,
> Climate and Global Modelling Division,
> Indian Institute of Tropical Meteorology,
> Dr. Homi Bhabha Road,
> NCL (P. O.), Pashan,
> Pune 411008, India.
> Tel. Off. +912025904423*
> *Mobile : +919028523910
> +919881707796
> *
>
> *http://sites.google.com/site/gibiesge/*
>
>
> Every 3000 pages cost a tree; please do not print this e-mail unless you
> really need.
>
> *SAVE TREES, SAVE MOTHER EARTH*
>
>

-- 
Samir Pokhrel
Climate and Global Modelling Division
Indian Institute of Tropical Meteorology
NCL Post, Pashan
Pune-411008
INDIA
-- 
Samir Pokhrel
Climate and Global Modelling Division
Indian Institute of Tropical Meteorology
NCL Post, Pashan
Pune-411008
INDIA

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 23 00:15:34 2013

This archive was generated by hypermail 2.1.8 : Thu Jul 25 2013 - 21:02:42 MDT