Dessey,
In the case of opening netCDF files, you can also use the "order" argument when opening the file. I have to do this occasionally to bypass files that are not fully following conventions. Basically, the usage is something like:
use/order=XYT file.nc
which would force the 3-D variable in file.nc to be viewed in the horizontal and time dimensions. Sometimes these get read in as XYZ by default. If the file has a mix of 2-D and 3-D variables I don't know if this works or not—I haven't tried it in that case.
-Bill
___________________________________________________________________
William I. Gustafson Jr., Ph.D.
Scientist
ATMOSPHERIC SCIENCES AND GLOBAL CHANGE DIVISION
Pacific Northwest National Laboratory
P.O. 999, MSIN K9-30
Richland, WA 99352
Tel: 509-372-6110
William.Gustafson@xxxxxxxx
http://www.pnnl.gov/atmospheric/staff/staff_info.asp?staff_num=5716
http://www.researcherid.com/rid/A-7732-2008
From: dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>>
Reply-To: dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>>
Date: Tuesday, May 14, 2013 6:56 PM
To: Steve Hankin <steven.c.hankin@xxxxxxxx<mailto:steven.c.hankin@xxxxxxxx>>
Cc: samir pokhrel <pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx>>, "ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>" <ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>>
Subject: Re: [ferret_users] How to change the K-index into L-index (time index)
Dear Steve,From: Steve Hankin <steven.c.hankin@xxxxxxxx<mailto:steven.c.hankin@xxxxxxxx>>
Thank you for giving an alternative strategy of my case, and yes it is a netcdf file, an output file from COHERENS simulation.
I'll trying your suggestion and hopefully I could give a summary, right after I succeed using the nc operators as your suggestion.
Thank you very much.
Best regards,
dessy
________________________________
To: dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>>
Cc: samir pokhrel <pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx>>; "ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>" <ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>>
Sent: Tuesday, May 14, 2013 11:41 PM1. define new axis for x, y, and t:
Subject: Re: [ferret_users] How to change the K-index into L-index (time index)
Hi Dessy,
Glad you found a solution.
Is the underlying data in a netCDF file? In most cases when the dimensions of a netCDF file get mapped by Ferret into the wrong orientation, it indicates that the file is lacking some expected CF attributes. In your example it looks like the time axis is either missing or is lacking attributes ('units' or 'axis') to indicate its orientation. An alternative strategy to working around this with Ferret commands would be to use the nc operators (http://nco.sourceforge.net/) to insert the missing attribute(s) into the file.
- Steve
======================================
On 5/14/2013 12:32 AM, dessy berlianty wrote:
Dear Samir,
Thank you for your valuable suggestion.
After trying, following is the step to change index:
* define axis/x=start:end:step xaxisname
* define axis/y=start:end:step yaxisname
* define axis/t=start:end:step taxisname
2. define new grid:
* define grid/x=xaxisname/y=yaxisname/t=taxisname gridname
3. check new grid:
* sh gr gridname
4. let dummy=x[gx=xaxisname]+y[gy=yaxisname]+t[gt=taxisname]
5. check dummy grid:
* sh gr dummy
6. save to nc files:
* save/file="/home/filename.nc" reshape(varname,dummy)
From: samir pokhrel <pokhrelsamir@xxxxxxxxx><mailto:pokhrelsamir@xxxxxxxxx>
I wish my summaries could be useful for those who will need it someday.
Again, thank you very much for your help.
Best regards,
dessy
________________________________
To: dessy berlianty <dessyberlianty@xxxxxxxxx><mailto:dessyberlianty@xxxxxxxxx>
Cc: "ferret_users@xxxxxxxx"<mailto:ferret_users@xxxxxxxx> <ferret_users@xxxxxxxx><mailto:ferret_users@xxxxxxxx>
Sent: Tuesday, May 14, 2013 1:16 PM
Subject: Re: [ferret_users] How to change the K-index into L-index (time index)
Dear Dessy,
You may use reshape function in which one variable can be wrapped in the dimension of the other.
go to following link and see the reshape function
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/XPRESSIONS
regards
Samir
On Tue, May 14, 2013 at 7:54 AM, dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>> wrote:
Dear Ferret Users,
I really need suggestion how to change the K-index into L-index (time index) for the followings dataset:
name title I J K L M N
XOUT longitude 1:186 1:160 ... ... ... ...
YOUT latitude 1:186 1:160 ... ... ... ...
DEPOUT Mean_water_depth 1:186 1:160 ... ... ... ...
TIME Time ... ... 1:673 ... ... ...
UMVEL X-component_of_depth-mean_curre 1:186 1:160 1:673 ... ... ...
VMVEL Y-component_of_depth-mean_curre 1:186 1:160 1:673 ... ... ...
EFLUX2DU X-component_of_depth-integrated 1:186 1:160 1:673 ... ... ...
EFLUX2DV Y-component_of_depth-integrated 1:186 1:160 1:673 ... ... ...
ZETA Surface_elevation 1:186 1:160 1:673 ... ... ...
ETOT2D Vertically_integrated_total_ene 1:186 1:160 1:673 ... ... ...
EDISSIP2D
Vertically_integrated_energy_di 1:186 1:160 1:673 ... ... ...
If I'm not changing the K-index into time index (L), I'll need /transpose command for plotting each variable and Ferret always define the variable data as vertical dimension (not as time series as I wish).
And also I couldn't applying plot/vlog appropriately, even by using transpose. There will be a message as followings:
yes? plot/transpose/i=53/j=87/vlog zeta
**ERROR: value out of legal range: Limits for log axis negative or too small: -1.16 : 1.21
yes? plot/transpose/i=53/j=87/vlog FFTA(zeta)
Bailing out of external function "ffta":
Time axis must be a regular axis
**ERROR: error in external function
I would highly appreciate for any help.
Thank you in advance.
Best wishes,
dessy
---
--
Samir Pokhrel
Climate and Global Modelling Division
Indian Institute of Tropical Meteorology
NCL Post, Pashan
Pune-411008
INDIA