[Thread Prev][Thread Next][Index]

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>
To: dessy berlianty <dessyberlianty@xxxxxxxxx>
Cc: samir pokhrel <pokhrelsamir@xxxxxxxxx>; "ferret_users@xxxxxxxx" <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" 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>
To: dessy berlianty <dessyberlianty@xxxxxxxxx>
Cc: "ferret_users@xxxxxxxx" <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



regards
Samir



On Tue, May 14, 2013 at 7:54 AM, dessy berlianty <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