Hi,
Thanks for the example file. Ferret has some tools to deal with this
kind of profile data. As you found, if we just point to the data, it's
on a grid that doesn't make sense:
yes? USE argo2900623_prof.nc
yes? SHOW GRID temp
GRID GAI4
name axis # pts start end
N_LEVELS X 48 r 1 48
N_PROF Y 35 r 1 35
normal Z
normal T
The attributes in the file don't give Ferret enough information to know
that N_LEVELS should be a Z axis and N_PROF should be a T axis. We can
use the /ORDER qualifier to force the correct directions to be used:
yes? CANCEL DATA/ALL
yes? USE/ORDER=ZT
yes? SHOW GRID temp
GRID GAI4
name axis # pts start end
normal X
normal Y
N_LEVELS Z 48 r 1 48
N_PROF T 35 r 1 35
Now, we'd like to use the variable JULD to define a time axis. In
files like this, sometimes the times are not in monotonically
increasing order, and so we would need to sort them. I'll come back to
this. In this file, the times are monotonically increasing, so we can
just use them as is.
! this gives us the units and time origin.
yes? LIST juld.units
"days since 1950-01-01 00:00:00 UTC"
! Define a time axis based on JULD
yes? DEFINE AXIS/T/T0="1-jan-1950:00:00"/UNITS=days tday = juld
! Also define a new Z axis. This is ocean data, so it should
! be increasing downwards. First define zz, a variable
containing
! the levels, then define an axis from that variable.
yes? LET zz = z[gz=temp]
yes? DEFINE AXIS/Z/UNITS=levels/DEPTH zlev = zz
! Now define a new variable on these corrected axes,
! using the @ASN transformation to just put them onto
! the new axes. Keep the units and title from TEMP.
yes? LET/UNITS="`temp,RETURN=units`"/\
TITLE="`temp,RETURN=title`" \
temperature = temp[GZ=zlev@ASN, GT=tday@ASN]
! Now the variable is on the correct ZT grid,
! For example, we can do these things:
yes? plot/L=1 temperature
yes? shade temperature
If the JULD variable were not monotonic, we would need to SORT the
variable JULD, and use the result to both define the new time axis and
also to reorder TEMP in T before assigning it to the new T axis.
Ansley
Chan Joo Jang wrote:
Hi Ferr users,
I got ARGO float data files from http://www.usgodae.org/cgi-bin/argo_select.pl
.
(One of those nc files is attached for your reference.)
Using some functions such as RESHAPE, I tried to change original axis
(n_prof, n_levels) to (time, depth) of TEMP (temperature), without any
success.
In other words, I want to have TEMP(julian day, pres) instead of
TEMP(n_prof, n_levels). All informations for julian day(juld) and depth
(pres) are in the nc files.
Any ideas or suggestions would be welcome.
oceanboy
=======
PS) Some parts of ncdump output are as follows:
netcdf 2900623_prof {
dimensions:
DATE_TIME = 14 ;
STRING256 = 256 ;
STRING64 = 64 ;
STRING32 = 32 ;
STRING16 = 16 ;
STRING8 = 8 ;
STRING4 = 4 ;
STRING2 = 2 ;
N_PROF = 35 ;
N_PARAM = 3 ;
N_LEVELS = 48 ;
N_CALIB = 1 ;
N_HISTORY = UNLIMITED ; // (0 currently)
variables:
float PRES(N_PROF, N_LEVELS) ;
PRES:long_name = "SEA PRESSURE" ;
PRES:_FillValue = 99999.f ;
PRES:units = "decibar" ;
PRES:valid_min = 0.f ;
PRES:valid_max = 12000.f ;
PRES:comment = "In situ measurement, sea surface = 0" ;
PRES:C_format = "%7.1f" ;
PRES:FORTRAN_format = "F7.1" ;
PRES:resolution = 0.1f ;
float TEMP(N_PROF, N_LEVELS) ;
TEMP:long_name = "SEA TEMPERATURE IN SITU ITS-90 SCALE" ;
TEMP:_FillValue = 99999.f ;
TEMP:units = "degree_Celsius" ;
TEMP:valid_min = -2.f ;
TEMP:valid_max = 40.f ;
TEMP:comment = "In situ measurement" ;
TEMP:C_format = "%9.3f" ;
TEMP:FORTRAN_format = "F9.3" ;
TEMP:resolution = 0.001f ;
------------------------------------------------
Currently at Dep. of Oceanography,
Texas A&M Univ
Chan Joo Jang, Ph.D., researcher
Korea Ocean Research and Development Institute
1270 Sa2-dong, SangRok-gu, Ansan 426-744, Korea
Tel: +82-31-400-6317 Fax: +82-31-408-5827
cjjang@xxxxxxxxxxx,
http://ogcm.kordi.re.kr
------------------------------------------------
|