[Thread Prev][Thread Next][Index]
Re: [ferret_users] How to change the K-index into L-index (time index)
Peng,
To my knowledge, this order command is an all-or-nothing forcing of the variables in the file to a given dimension order. If you need to have variable specific differences you would have to map those variables to new grids after the file is opened, similar to what was suggested earlier in this thread. Or, you could rewrite the attributes, etc., in the nc file to conform closer to the COARDS conventions so Ferret can automatically read the file.
-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: Ge Peng - NOAA Affiliate <ge.peng@xxxxxxxx<mailto:ge.peng@xxxxxxxx>>
Date: Friday, May 17, 2013 7:53 AM
To: William Gustafson <William.Gustafson@xxxxxxxx<mailto:William.Gustafson@xxxxxxxx>>
Cc: dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>>, "ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>" <ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>>, Ge Peng - NOAA Affiliate <ge.peng@xxxxxxxx<mailto:ge.peng@xxxxxxxx>>
Subject: Re: [ferret_users] How to change the K-index into L-index (time index)
Looks like a cool way to load data. Is there a way for different variables in one *.nc file?
I have a file that has some of variables in Y, T, .., X (i, j, k, l) and others in X, Y, .., .. (see below).
Anyway I can have them loaded in one coordinate (X, Y, .., T) for all the variables in ferret?
(The file is too big to be attached. I can share it over google doc if interested.)
Thanks,
--- Peng
ferret
NOAA/PMEL TMAP
FERRET v6.65
Linux(gfortran) 2.6.9-89.0.20.ELsmp - 11/30/10
17-May-13 10:42
yes? use Drifter_Monthly_Climatology_AOML.nc
yes? sho data
currently SET data sets:
1> ./Drifter_Monthly_Climatology_AOML.nc (default)
name title I J K L
U Zonal Current 1:159 1:12 ... 1:361
V Meridional Current 1:159 1:12 ... 1:361
SST Sea Surface Temperature 1:159 1:12 ... 1:361
UG Geostrophic Zonal Current 1:159 1:12 ... 1:361
VG Geostrophic Meridional Current 1:159 1:12 ... 1:361
COUNT Sea Surface Temperature 1:361 1:159 ... ...
UE Zonal Current Standard Error 1:361 1:159 ... ...
VE Meridional Current Standard Err 1:361 1:159 ... ...
SSTE Sea Surface Temperature Standar 1:361 1:159 ... ...
UGE Geostrophic Zonal Current Stand 1:361 1:159 ... ...
VGE Geostrophic Meridional Current 1:361 1:159 ... ...
yes?
On Wed, May 15, 2013 at 12:57 PM, Gustafson, William I <william.gustafson@xxxxxxxx<mailto:william.gustafson@xxxxxxxx>> wrote:
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<http://file.nc>
which would force the 3-D variable in file.nc<http://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<tel:509-372-6110>
William.Gustafson@xxxxxxxx<mailto: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><mailto:dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>>>
Reply-To: dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx><mailto: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><mailto:steven.c.hankin@xxxxxxxx<mailto:steven.c.hankin@xxxxxxxx>>>
Cc: samir pokhrel <pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx><mailto:pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx>>>, "ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx><mailto:ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>>" <ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx><mailto:ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>>>
Subject: Re: [ferret_users] How to change the K-index into L-index (time index)
Dear Steve,
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
________________________________
From: Steve Hankin <steven.c.hankin@xxxxxxxx<mailto:steven.c.hankin@xxxxxxxx><mailto:steven.c.hankin@xxxxxxxx<mailto:steven.c.hankin@xxxxxxxx>>>
To: dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx><mailto:dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>>>
Cc: samir pokhrel <pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx><mailto:pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx>>>; "ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx><mailto:ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>>" <ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx><mailto:ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>>>
Sent: Tuesday, May 14, 2013 11:41 PM
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:
1. define new axis for x, y, and t:
* 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<http://filename.nc>" reshape(varname,dummy)
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
________________________________
From: samir pokhrel <pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx>><mailto:pokhrelsamir@xxxxxxxxx<mailto:pokhrelsamir@xxxxxxxxx>>
To: dessy berlianty <dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>><mailto:dessyberlianty@xxxxxxxxx<mailto:dessyberlianty@xxxxxxxxx>>
Cc: "ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>"<mailto:ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>> <ferret_users@xxxxxxxx<mailto:ferret_users@xxxxxxxx>><mailto: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><mailto: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
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement