[Thread Prev][Thread Next][Index]

[ferret_users] Re: [ferret_users] mixing axis



 
Le Mercredi 16 Décembre 2015 13.08 CET, Delclaux Francois <francois.delclaux@xxxxxxxxxxxxxxxxxxx> a écrit: 
 
> Hi Ferret users,
> Sorry for my last mail, but I did not change the object of the mail. So 
> I re-post my question  with a new subject
> 
> I  have a netcdf file with a 3D variable according to the following:

> 
> 1> ./DRAIN.nc (default)
> 
>   name     title                             I         J K         
> L         M         N
>   DR2      Averaged_Soil_Drainage_Flux      1:9       1:13 1:26280   
> ...       ...       ...
>               kg/m2s on grid GJI1 with 1.E+20 for missing data
>               X=0.5E:9.5E  Y=0.5N:13.5N  Z=0.5:26281
>   LAT                                       ...       1:13 ...       
> ...       ...       ...
>               degrees_north on grid GJI2 with 1.E+20 for missing data
>               Y=0.5N:13.5N
>   LON                                       1:9       ... ...       

> ...       ...       ...
>               degrees_east on grid GJI3 with 1.E+20 for missing data
>               X=0.5E:9.5E
>   TIME                                      ...       ... 1:26280   

> ...       ...       ...
>               hours since 2013-01-01 00:00:00 on grid GJI4 with 1.E+20 
> for missing data
>               Z=0.5:26281
> 
> Now I would like to transform this file in a new one DR2   = DR2(x,y,t) 
> where the axes LAT, LON and TIME axis are directly included in the file
> 
> What's the best way for doing that ?


Re,

Dynamic regridding in not enough since there is 
a wrong match for your time dimension indeed.

So you need to use the reshape function as Ryo Furue has suggested.
Here is how it can be done:

!=========================
use RUNOFF.nc

def axis/X/units="degrees_east" lonaxis=lon
def axis/Y/units="degrees_north" lataxis=lat
def axis/T/units="hours"/T0="01-JAN-2013:00:00:00" timeaxis=time   ! seen from a show data/full

let out_grid=x[gx=lonaxis]+y[gy=lataxis]+t[gt=timeaxis]
let r2_reshaped=reshape(r2, out_grid)
!=========================
 
But I would recommend you to correct your netCDF file permanently.
It is much more easier and can be done with:

$ ncrename -Oh -d AXTS,time -d LAT,lat -d LON,lon RUNOFF.nc

Read what is a coordinate variable in the COARDS convention of
the netCDF format. It is a variable with a dimension that has the 
same name and remember this is case sensitive (lon != LON)

Then you can use nicelly ferret.

Regards
Patrick
 
-- 
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
ICMC - IPSL Climate Modelling Centre
--
 




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

Privacy Policy | Disclaimer | Accessibility Statement