[Thread Prev][Thread Next][Index]

Re: [ferret_users] data from netcdf file automatically reversed



Thank you Ansley. I do think it's the problem of time coordinate. Actually when I show data:

yes? show da
     currently SET data sets:
    1> ./data.nc  (default)
 name     title                             I         J         K         L
 TIME_COUNTER
          Time axis                        ...       ...       ...       1:389
       (invalid coordinate axis)
 TOTAL_SOIL_CARB
          total soil and litter carbon     1:1       1:1       1:13      1:389

using ncdump -c data.nc

        double time_counter(time_counter) ;
                time_counter:axis = "T" ;
                time_counter:standard_name = "time" ;
                time_counter:units = "seconds since 2005-01-01 00:00:00" ;
                time_counter:calendar = "noleap" ;
                time_counter:title = "Time" ;
                time_counter:long_name = "Time axis" ;
                time_counter:time_origin = " 2005-JAN-01 00:00:00" ;
                time_counter:bounds = "time_counter_bnds" ;
....
 time_counter = 15768000, -78926400, 15768000, 15768000, -78926400,
    -15854400, -47390400, -15854400, -110462400, -78926400, -78926400,
    -47390400, -78926400, -15854400, -110462400, 15768000, 15768000,
    -47390400, -110462400, -47390400, -15854400, 15768000, -15854400,
    -78926400, -110462400, 15768000, -110462400, -15854400, 15768000,
    15768000, -78926400, 15768000, 15768000, 15768000, -78926400, -15854400,
    -47390400, -47390400, -110462400, -110462400, -78926400, 15768000,
    -110462400, 15768000, -47390400, -15854400, 15768000, -110462400,
    -47390400, -110462400, -15854400, -15854400, -15854400, -47390400,
    -15854400, 15768000, -78926400, -78926400, -78926400, -78926400,
    -15854400, -110462400, -78926400, -47390400, 15768000, -15854400,
    -15854400, 15768000, -110462400, -47390400, 15768000, -110462400,
    -110462400, 15768000, -78926400, -47390400, -15854400, 15768000,
    -15854400, 15768000, 15768000, -78926400, -15854400, -47390400, 15768000,
    -47390400, 15768000, -78926400, -15854400, -110462400, -47390400,
    -47390400, -78926400, -15854400, -110462400, -110462400, -47390400,
    -15854400, -110462400, 15768000, 15768000, -110462400, 15768000,
    -15854400, -110462400, -110462400, 15768000, 15768000, -47390400,
    -78926400, 15768000, 15768000, 15768000, 15768000, -78926400, -78926400,
......

notice it says "invalid coordinate axis", so when I make plot, the horizontal axis is not the time varialbe but only index numbers from 1 to 389.
Actually the data.nc is derived by concatenating a series of nc files which are model results forced by randomly circularly using 4 years climate data. (that's
why you see randomly circular same numbers in time_counter value)
maybe I can just use the function samplet to do a resample. but I think your answer is very relevant.

Thank you and cheers,

Chao

2011/5/2 Ansley Manke <Ansley.B.Manke@xxxxxxxx>
Hi Chao,
In your netCDF file, are the time coordinate values decreasing?  If Ferret encounters a file where the coordinates are decreasing instead of increasing, it will reorder the coordinates and the data. 

Look at the result of ncdump -c.  Do the coordinate values in the axis variable time_counter have increasing or decreasing values?

Ansley


On 5/2/2011 8:40 AM, Yue Chao wrote:
Dear all ferret_users,

I am new beginner in ferret and forgive me it's stupid question.
I try to read a variable from a netCDF file and make line plot. when I use ncdump to check the data, it's the right sequence.
from the begining of time, the value of variable increases. but when the data is listed in ferret, the sequence has been automatically
reversed. I guess I have the wrong time axis?  But before this, when I try to do exactly the same thing using the data produced by a
very much similar way, nothing strange happened.

actually the time axis is plainly sequential numbers...
yes? show axis time_counter
 name       axis              # pts   start                end
 TIME_COUNTER                 389 r   1                    389

Thank you if you have any idea, I just want to understand what's going on.

best,

Chao
--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 77 30
Portable Phone (Mobil phone) : (33) 07 60 54  23 71
************************************************************************************




--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 77 30
Portable Phone (Mobil phone) : (33) 07 60 54  23 71
************************************************************************************


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

Privacy Policy | Disclaimer | Accessibility Statement