Hi all,
I'm getting an error, trying to use the external function
SCAT2GRIDGAUSS_ZT in ferret v6.62.
I have some chlorophyll profiles from HOT as ASCII and want to
put them on a depth-time grid for further processing and
plotting. My ferret script so far:
SET
DATA/SKIP=2/FORMAT=DELIMITED/TYPE=" numeric , text, text,
numeric, numeric"/VAR=nr,date,time,dbar,chla
hplc_chla_noinvalid.txt
let mm=STRFLOAT(SUBSTRING(date[d=1],0,2))
let dd=STRFLOAT(SUBSTRING(date[d=1],3,2))
let yy=STRFLOAT(SUBSTRING(date,5,2))
let year=IF yy GT 50 THEN yy + 1900 ELSE yy + 2000
let date_new= DAYS1900(year, mm, dd) - DAYS1900(1988, 01, 01)
Overview:
yes? sho dat
currently SET
data sets:
1>
./hplc_chla_noinvalid.txt (default)
name
title I J
K L
NR
NR 1:20480 ...
... ...
DATE
DATE 1:20480 ...
... ...
TIME
TIME 1:20480 ...
... ...
DBAR
DBAR 1:20480 ...
... ...
CHLA
CHLA 1:20480 ...
... ...
yes? list
date_new[i=1:5]
VARIABLE
: DAYS1900(YEAR, MM, DD) - DAYS1900(1988, 01, 01)
FILENAME
: hplc_chla_noinvalid.txt
SUBSET
: 5 points (X)
1 / 1: 337.0
2 / 2: 337.0
3 / 3: 337.0
4 / 4: 337.0
5 / 5: 337.0
yes? list dbar[i=1:5]
VARIABLE
: DBAR
FILENAME
: hplc_chla_noinvalid.txt
SUBSET
: 5 points (X)
1 / 1: 2.10
2 / 2: 22.80
3 / 3: 48.60
4 / 4: 73.00
5 / 5: 98.20
yes? list chla[i=1:5]
VARIABLE
: CHLA
FILENAME
: hplc_chla_noinvalid.txt
SUBSET
: 5 points (X)
1 / 1: 23.0
2 / 2: 34.0
3 / 3: 55.0
4 / 4: 56.0
5 / 5: 135.0
Trying to use SCAT2GRIDGAUSS_XY works:
define
axis/x=0:300:1/units=meters xax
define axis/y=300:400:1 yax
let chla_reg =
scat2gridgauss_xy(dbar[i=1:5],date_new[i=1:5],chla[i=1:5],x[gx=xax],y[gy=yax],1.,1.,1.,0)
shade chla_reg
SCAT2GRIDGAUSS_ZT doesn't:
define
axis/t=300:400:1 tax
define axis/z=0:300:1 zax
let chla_reg =
scat2gridgauss_zt(dbar[i=1:5],date_new[i=1:5],chla[i=1:5],z[gz=zax],t[gt=tax],1.,1.,1.,0)
shade chla_reg
Bailing out of external function "scat2gridgauss_zt":
output axes must be REGULARLY spaced
**ERROR: error in external function
But I don't know why. The output axes are regularly...
sho
ax/all
name axis # pts start
end
PSXT LONGITUDE 160mr 130.5E
70.5W
PSXU LONGITUDE 160mr 131E
70W
PSYT LATITUDE 100 i 28.836S
48.567N
PSYU LATITUDE 100 i 27.672S
50N
PSZT DEPTH (m) 27 i- 5
3824
PSZW DEPTH (m) 27 i- 10
4149
ABSTRACT 9999999 r 1
10000000
EZ 20480 r 1
20480
ZPRESS DEPTH (m) 2284 i- 1.9
257.4
YAX Y 101 r 300
400
XAX X (METERS) 301 r 0
300
TAX T 101 r 300
400
ZAX Z 301 r 0
300
It doesn't matter how I define the t-axis (using
t="startdate":"enddate":step ; using to="01-JAN-1988" ; using
different calendar=... also doesn't help).
Any suggestions appreciated.
Thank you,
Bastian Kern