[Thread Prev][Thread Next][Index]

Re: [ferret_users] Transform 4D to 3D datasets



Hi,
           For changing a given grid to new grid, in general the below
method can be used,
define the target grid as below or use required dimensions from
existing variable...

def axis/x= ...... xax
def axis/y=........yax
def axis/z=........zax
def axis/t=.........tax
let ngrid = x[gx=xax] + y[gt=yax] + z[gz=zax] + t[gt=tax]
let new_var= reshape (old_var, ngrid)
here ngrid can be according to your requirement
for example
let ngrid= x[gx=xax] + y[gy=yax]
or
let ngrid= x[gx=xax] + y[gy=yax] + t[gt=tax]
or any combination
in given instance
the ngrid can be
let ngrid = x[gx=uwnd] + g[gy=uwnd]
let new_u= reshape(uwind,ngrid)
hope this helps..

with best regards,
Sudheer

On Mon, Sep 17, 2012 at 12:59 AM, Verena Lili <verena.prick@xxxxxxxxx> wrote:
> Hi,
>
> I did, but still get the same dimensions 4D,
> Finally it works when i'm using NCO command.
>
> Thanks a lot ;)
>
>
>
> On Sun, Sep 16, 2012 at 9:10 PM, Júnior <juniorphy@xxxxxxxxx> wrote:
>>
>> Hi Verena,
>>
>> You can save 200 hPa U in new netcdf file, like this:
>> Assuming that U at 200 hPa is equal to k=1
>>
>> save/file=u200.nc u[k=1]
>>
>> Then, the new file u200.nc is 3D.
>>
>> Bests,
>>
>> Júnior
>>
>>
>> On Sun, Sep 16, 2012 at 3:29 PM, Verena Lili <verena.prick@xxxxxxxxx>
>> wrote:
>>>
>>> Hi Ferret users,
>>>
>>> I just wonder is there any possible way to change the dimension in my
>>> data from 4D to 3D,
>>> let say i have zonal wind data only at level 200 hPa thus U [time x lev x
>>> lat x lon] and i want to remove
>>> the level dimension inside thus later i just have U [time x lat x lon].
>>> Since it only consist of 1 level, i don't need "level" dimension inside my
>>> data.
>>>
>>> Thanks for your help.
>>>
>>
>>
>>
>> --
>> ------------------------------------------------------------
>> Francisco das Chagas Vasconcelos Júnior
>> Doutorando em Ciências Atmosféricas
>> Grupo de Estudos em Multiescalas - GEM
>> Universidade de São Paulo - USP
>> Instituto de Astronomia, Geofísica e Ciências Atmosféricas - IAG
>>
>



-- 
with best regards

Sudheer

**********************************************************************************
Dr. Sudheer Joseph
Scientist
INDIAN NATIONAL CENTRE FOR OCEAN INFORMATION SERVICES (INCOIS)
MINISTRY OF EARTH SCIENCES, GOVERNMENT OF INDIA
"OCEAN VALLEY" PRAGATHI NAGAR (BO)
OPP.JNTU, NIZAMPET SO
Andhra Pradesh, India. PIN- 500 090.
TEl:+91-40-23044600(R),Tel:+91-9440832534(Mobile)
Tel:+91-40-23886047(O),Fax:+91-40-23892910(O)
E-mail: sudheer.joseph@xxxxxxxxx;  sjo@xxxxxxxxxxxxx.
Web- http://oppamthadathil.tripod.com
           --------------* ---------------
"The ultimate measure of a man is
not where he stands in moments of
comfort and convenience, but where
he stands at times of challenge and
controversy."
                        Martin Luther King, Jr.
"What we have done for ourselves alone dies with us.
What we have done for others and the world remains and is immortal."
- Albert Pines



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement