OK, that's definitely the cause of the problem.
If you define the xpts, ypts sample locations in the same units as
the gridded variable, then the samplexy function will work. It does
not depend on anything having units of longitude and latitude.
On 9/6/2016 8:47 AM, 'Sara Sari' via
_OAR PMEL Ferret Users wrote:
Dear
Ansley,
This is what I
tried to say...
I attached the result of shade/L=1/K=1
temp, xout, yout.
as you can see x
and y are in km not in lat and long! starting from 0 to
386000 m (for 193pts with deltx=2000m) and 176000m for y
(for 87pts with delty = 2000 m).
That's why none of
your scripts work for me.
The xpts, ypts in my example were simply
numbers that I made up. They are longitude and
latitude values that exist in the coordinate
variables of the example dataset.
Try this. For your dataset, making a map plot
in the XY direction:
yes?
shade/L=1/K=1 temp, xout, yout
Are the plot axes labeled with Longitude and
Latitude numbers, with degrees?
Then you had these definitions.
yes?
let xlon = -80+(I[I=1:10]-1)
yes?
LET slope=0.5
yes? LET ylat = 41 +
slope*(i[i=1:10] -1)/2
Continuing
with the plot you drew above, try:
yes? plot/vs/thick xlon, ylat
Are those points drawn on the plot? If they do
not, then try the definition with let xlon
= 360-80+(I[I=1:10]-1)
If all of this works, now try the same things at
some other depth levels, for instance /K=5, /K=10.
There will be some missing data of course as you go
down in depth, but there need to be some data at the
sample locations for several depths in order for the
sampling to work.
On
8/26/2016 3:37 PM, Sara Sari wrote:
Hi.
I
checked all time steps. The problem is not
with time step.
Could
you please explain from where those numbers
for x and y came? According to what factor? I
mean these:
let xpts =
{180.57,182.1,188.3,199.1, 201.3, 203.1}
yes? let ypts = {-9, -8, -6,
-2, -3, -4}
Are these just random lat and
long in the field of study?i mean random
points coordinates?
On Fri, Aug 26, 2016 at 4:13 PM, Ansley
C. Manke
Sometimes
there is not data at all time steps. Is
there data in timestep 1 of the data?
shade/l=1 temp[x=1:193,y=1:87]
If
that is blank, look at other time steps.
On
8/25/2016 10:57 AM, 'Sara Sari' via
_OARPMEL Ferret Users wrote:
Hi and thank you,
I followed your
comment:
use rhoneG_1.tsout3N
yes? show grid temp
GRID GIE4
name axis #
pts start end
XDIM X
193 r 1 193
YDIM Y
87 r 1 87
ZDIM Z
25 r 1 25
TDIM T
7 r 1 7
normal E
normal F
yes? list xout[j=2]
VARIABLE :
longitude (degrees_east)
FILENAME :
rhoneG_1.tsout3N
SUBSET : 193
points (X)
Y : 2
2
2
1 / 1: -83.46
2 / 2: -83.44
3 / 3: -83.41
4 / 4: -83.39
5 / 5: -83.37
6 / 6: -83.34
7 / 7: -83.32
8 / 8: -83.29
9 / 9: -83.27
10 / 10: -83.25
11 / 11: -83.22
12 / 12: -83.20
13 / 13: -83.17
14 / 14: -83.15
15 / 15: -83.13
16 / 16: -83.10
17 / 17: -83.08
18 / 18: -83.05
19 / 19: -83.03
20 / 20: -83.01
21 / 21: -82.98
22 / 22: -82.96
23 / 23: -82.93
24 / 24: -82.91
25 / 25: -82.89
26 / 26: -82.86
27 / 27: -82.84
28 / 28: -82.81
29 / 29: -82.79
30 / 30: -82.77
31 / 31: -82.74
32 / 32: -82.72
33 / 33: -82.69
34 / 34: -82.67
35 / 35: -82.65
36 / 36: -82.62
37 / 37: -82.60
38 / 38: -82.57
39 / 39: -82.55
40 / 40: -82.53
41 / 41: -82.50
42 / 42: -82.48
43 / 43: -82.45
44 / 44: -82.43
45 / 45: -82.41
46 / 46: -82.38
47 / 47: -82.36
48 / 48: -82.33
49 / 49: -82.31
50 / 50: -82.29
51 / 51: -82.26
52 / 52: -82.24
53 / 53: -82.21
54 / 54: -82.19
55 / 55: -82.17
56 / 56: -82.14
57 / 57: -82.12
58 / 58: -82.09
59 / 59: -82.07
60 / 60: -82.05
61 / 61: -82.02
62 / 62: -82.00
63 / 63: -81.97
64 / 64: -81.95
65 / 65: -81.93
66 / 66: -81.90
67 / 67: -81.88
68 / 68: -81.85
69 / 69: -81.83
70 / 70: -81.81
71 / 71: -81.78
72 / 72: -81.76
73 / 73: -81.73
74 / 74: -81.71
75 / 75: -81.69
76 / 76: -81.66
77 / 77: -81.64
78 / 78: -81.61
79 / 79: -81.59
80 / 80: -81.57
81 / 81: -81.54
82 / 82: -81.52
83 / 83: -81.49
84 / 84: -81.47
85 / 85: -81.45
86 / 86: -81.42
87 / 87: -81.40
88 / 88: -81.37
89 / 89: -81.35
90 / 90: -81.33
91 / 91: -81.30
92 / 92: -81.28
93 / 93: -81.25
94 / 94: -81.23
95 / 95: -81.21
96 / 96: -81.18
97 / 97: -81.16
98 / 98: -81.13
99 / 99: -81.11
100 / 100: -81.09
101 / 101: -81.06
102 / 102: -81.04
103 / 103: -81.01
104 / 104: -80.99
105 / 105: -80.97
106 / 106: -80.94
107 / 107: -80.92
108 / 108: -80.89
109 / 109: -80.87
110 / 110: -80.85
111 / 111: -80.82
112 / 112: -80.80
113 / 113: -80.77
114 / 114: -80.75
115 / 115: -80.73
116 / 116: -80.70
117 / 117: -80.68
118 / 118: -80.65
119 / 119: -80.63
120 / 120: -80.61
121 / 121: -80.58
122 / 122: -80.56
123 / 123: -80.53
124 / 124: -80.51
125 / 125: -80.49
126 / 126: -80.46
127 / 127: -80.44
128 / 128: -80.41
129 / 129: -80.39
130 / 130: -80.37
131 / 131: -80.34
132 / 132: -80.32
133 / 133: -80.29
134 / 134: -80.27
135 / 135: -80.25
136 / 136: -80.22
137 / 137: -80.20
138 / 138: -80.17
139 / 139: -80.15
140 / 140: -80.13
141 / 141: -80.10
142 / 142: -80.08
143 / 143: -80.05
144 / 144: -80.03
145 / 145: -80.01
146 / 146: -79.98
147 / 147: -79.96
148 / 148: -79.93
149 / 149: -79.91
150 / 150: -79.89
151 / 151: -79.86
152 / 152: -79.84
153 / 153: -79.81
154 / 154: -79.79
155 / 155: -79.77
156 / 156: -79.74
157 / 157: -79.72
158 / 158: -79.69
159 / 159: -79.67
160 / 160: -79.65
161 / 161: -79.62
162 / 162: -79.60
163 / 163: -79.57
164 / 164: -79.55
165 / 165: -79.53
166 / 166: -79.50
167 / 167: -79.48
168 / 168: -79.45
169 / 169: -79.43
170 / 170: -79.41
171 / 171: -79.38
172 / 172: -79.36
173 / 173: -79.33
174 / 174: -79.31
175 / 175: -79.29
176 / 176: -79.26
177 / 177: -79.24
178 / 178: -79.21
179 / 179: -79.19
180 / 180: -79.17
181 / 181: -79.14
182 / 182: -79.12
183 / 183: -79.09
184 / 184: -79.07
185 / 185: -79.05
186 / 186: -79.02
187 / 187: -79.00
188 / 188: -78.97
189 / 189: -78.95
190 / 190: -78.93
191 / 191: -78.90
192 / 192: -78.88
193 / 193: -78.85
yes? list yout[i=2]
VARIABLE : latitude
(degrees_north)
FILENAME :
rhoneG_1.tsout3N
SUBSET : 87
points (Y)
X : 2
2
2
1 / 1: 41.34
2 / 2: 41.36
3 / 3: 41.38
4 / 4: 41.40
5 / 5: 41.42
6 / 6: 41.43
7 / 7: 41.45
8 / 8: 41.47
9 / 9: 41.49
10 / 10: 41.51
11 / 11: 41.52
12 / 12: 41.54
13 / 13: 41.56
14 / 14: 41.58
15 / 15: 41.60
16 / 16: 41.61
17 / 17: 41.63
18 / 18: 41.65
19 / 19: 41.67
20 / 20: 41.69
21 / 21: 41.70
22 / 22: 41.72
23 / 23: 41.74
24 / 24: 41.76
25 / 25: 41.78
26 / 26: 41.79
27 / 27: 41.81
28 / 28: 41.83
29 / 29: 41.85
30 / 30: 41.87
31 / 31: 41.88
32 / 32: 41.90
33 / 33: 41.92
34 / 34: 41.94
35 / 35: 41.96
36 / 36: 41.97
37 / 37: 41.99
38 / 38: 42.01
39 / 39: 42.03
40 / 40: 42.05
41 / 41: 42.06
42 / 42: 42.08
43 / 43: 42.10
44 / 44: 42.12
45 / 45: 42.14
46 / 46: 42.15
47 / 47: 42.17
48 / 48: 42.19
49 / 49: 42.21
50 / 50: 42.23
51 / 51: 42.24
52 / 52: 42.26
53 / 53: 42.28
54 / 54: 42.30
55 / 55: 42.32
56 / 56: 42.33
57 / 57: 42.35
58 / 58: 42.37
59 / 59: 42.39
60 / 60: 42.41
61 / 61: 42.42
62 / 62: 42.44
63 / 63: 42.46
64 / 64: 42.48
65 / 65: 42.50
66 / 66: 42.51
67 / 67: 42.53
68 / 68: 42.55
69 / 69: 42.57
70 / 70: 42.59
71 / 71: 42.60
72 / 72: 42.62
73 / 73: 42.64
74 / 74: 42.66
75 / 75: 42.68
76 / 76: 42.69
77 / 77: 42.71
78 / 78: 42.73
79 / 79: 42.75
80 / 80: 42.77
81 / 81: 42.78
82 / 82: 42.80
83 / 83: 42.82
84 / 84: 42.84
85 / 85: 42.86
86 / 86: 42.88
87 / 87: 42.89
yes? let xpts =
{-83.10,-82.29,-80.16}
yes? yes? let ypts =
{41.87,41.87,42.10}
yes? yes? let sampled_temp =
SAMPLEXY_CURV(temp, yout, xout,
xpts, ypts)
yes? yes? shade/L=1 sampled_temp
yes? list /L=1 sampled_temp
It gave me : "NO VALID
DATA"
please see the
attached file.
I
don't know what to do else...
Regards,
Sara
Hi Sara,
For your example, you
need to use almost the
same commands you were
trying with SAMPLEXY,
but with extra arguments
to give the
samplexy_curv function
the longitude and
latitude curvilinear
coordinate variables.
Here's an example.
yes? use
model_data.nc
yes? show
data
currently SET
data sets:
1>
./model_data.nc
(default)
name
title
I J
K L
M N
GEOLAT
geographical
latitude 1:360
1:200 ...
... ...
...
GEOLON
geographical
longitude 1:360
1:200 ...
... ...
...
THETAO
Potential
Temperature
1:360 1:200
1:50 1:1200
... ...
yes?
let xpts =
{180.57,182.1,188.3,199.1,
201.3, 203.1}
yes?
let ypts = {-9, -8,
-6, -2, -3, -4}
yes? let
sampled_thetao =
SAMPLEXY_CURV(thetao,
geolon, geolat,
xpts, ypts)
yes?
shade/L=1 sampled_thetao
On
8/21/2016 11:31 AM,
'Sara Sari' via _OAR
PMEL Ferret Users
wrote:
Hi,
I read and
applied the
scripts
mentioned in
SAMPLEXY_CURVE,
but it didn't
give me the
result that I
wanted. it
didn't give
any temp on
bathymetry at
all. could
you please
give me a
complete
script that I
need to get a
plot like the
one in
SAMPLEXY
sample(samplexy-curve
doesn't have
any sample
plot)... I
really tried
many scripts
that are
brought in
documentation
but with no
success.
Thank
you,
Sara
Hi,
Your
dataset looks
as if it has a
Curvilinear
Grid. Going
back to where
you showed the
result of
"show data":
yes?
use
rhoneG_1.tsout3N
yes?
sh d
name
title
I J
K
L
M N
XOUT
X-coordinate
1:193
1:87
... ...
...
...
YOUT
Y-coordinate
1:193
1:87
... ...
...
...
ZOUT
Z-coordinate
1:193
1:87
1:25 ...
...
...
TEMP
Temperature
1:193
1:87
1:25 1:7
...
...
It looks as if
the variables
XOUT and YOUT
contain the
coordinates.
Have a look at
the
documentation
for
Curvilinear
grids. For
this data, you
would use the
SAMPLEXY_CURV
function.
ansley
On
8/17/2016 7:13
PM, Sara Sari
wrote:
Thank you very
much Ansley,
you are right, I
get "NO Valid
Data".
seems that I
didn't get the
samplexy
script in the
userguide very
well.
but one more
thing:
the example that
you provided
for 4D, is
according to
the lat and
long
but please look
at my grid:
yes? sh grid temp
GRID GIE4
name axis
#
pts start
end
XDIM X
193 r 1
193
YDIM Y
87 r 1
87
ZDIM Z
25 r 1
25
TDIM T
7 r 1
7
normal E
normal F
it doesn't have
any lat or
long and is
just
points....
what should I
write to xlon
and ylat then?
best,
Sara
Hello,
When
you're running
your script,
at the time
you see the
error
**ERROR:
required
program
command has
not been
given: SET
DATA_SET
Right then, type
in
yes?
show data
Is the dataset
still listed?
It should show
your data, and
should say
(default) in
the line that
lists the path
and name of
the dataset.
In your script
you could move
the "use"
command to
just before
the "LET
slanttemp"
command.
In your
script, the
index i is
used in two
different
ways. You are
using it as an
index to
define the
sample points
xlon and ylat,
and it is also
an a index of
the grid of
the variable
temp. Then
when you go to
evaluate the
variable, the
range of i is
ambiguous.
This issue is
described in
the Users List
under
"Grid-Changing
Functions",
see the link
from the documentation
of SAMPLEXY.
For
grid-changing
functions, we
need to give
the an index
range or
coordinate
range for all
of the
arguments,
based on the
grid of each
argument. You
did that with
temp[x=1:193,y=1:87]. It's also best to do it with xlon and ylat.
[ define xlon
and ylat ]
yes? use
rhoneG_1.tsout3N
yes? LET
slanttemp =
samplexy(temp[x=1:193,y=1:87],xlon[i=1:10],ylat[j=1:10])
Finally, the
SAMPLEXY
function in
current Ferret
versions does
not handle
modulo
longitude
operations
when there is
a sub-range in
longitudes.
This is
something that
we recently
discovered,
and the
behavior will
be fixed in
future
versions, so
that if the
points are
known to be
longitudes and
latitudes,
things will
work without
any
adjustment.
For now,
though, this
means that if
the grid of
your variable
TEMP has
longitude
defined as
x=0:360, and
you define
xlon in the
range -80 to
-71, then it
will not find
an answer, but
will give you
a plot that
just says No
Valid Data.
So instead,
make sure the
xpts are in
the same range
as the
longitude
coordinates in
the file.
Here is a file
with 4-D data,
yes?
use
ocean_atlas_temp
yes? sh
dat
currently SET
data sets:
1>
/home/users/tmap/ferret/linux/fer_dsets/data/ocean_atlas_subset.nc
(default)
name
title I J K
L
M N
TEMP
Temperature 1:180 1:90 1:19 1:12
... ...
yes? show
grid temp
GRID
GHA1
name
axis # pts start end
subset
XAX_SUBSET
LONGITUDE 180mr 20.5E 18.5E(378.5)
full
YAX_SUBSET
LATITUDE 90 r 89.5S 88.5N full
ZAXLEVIT19
DEPTH
(m)
19 i-
0
1000 full
TIME
TIME 12mr 16-JAN 06:00 16-DEC 01:20 full
So this
dataset has
its longitudes
in 20:380. If
I give
SAMPLEXY
points with
xlon=-80:-71,
it will not
return an
answer, but if
I define the
points this
way, it's
fine.
yes?
let/units=degrees_east xlon = 360-80+(i[i=1:10]-1)
yes?
LET slope=0.5
yes?
LET/units=degrees_north ylat = 41 + slope*(i[i=1:10] -1)/2
yes? LET
slanttemp =
samplexy(temp[x=1:193,y=1:87],xlon[i=1:10],ylat[j=1:10])
On
8/17/2016
12:27 PM,
'Sara Sari'
via _OAR PMEL
Ferret Users
wrote:
So
could you give
me a solution
for this
problem?
Thnx
On Wed,
Aug 17, 2016
at 1:34 AM,
'Sara Sari'
via _OAR PMEL
Ferret Users
I use version
V6.93
I
forgot to say
that I don't
use spherical
coordinate, I
just have 194
*87 pts with
resolution of
2km. so is
that possible
that as I
don't work
with lat and
longitude so
this causes
the problem?
regards,
Sara
thank you Russ,
Here is the
complete
script:
use
rhoneG_1.tsout3N
yes?
sh d
name
title
I
J
K
L M
N
XOUT
X-coordinate
1:193
1:87 ...
...
...
...
YOUT
Y-coordinate
1:193
1:87 ...
...
...
...
ZOUT
Z-coordinate
1:193
1:87 1:25
...
... ...
TEMP
Temperature
1:193
1:87 1:25
1:7
... ...
yes?
let xlon =
-80+(I[I=1:10]-1)
yes?
LET slope=0.5
yes?
LET ylat = 41
+
slope*(i[i=1:10]
-1)/2
yes?
PLOT/VS/LINE/SYM=27 xlon,ylat
yes?
GO land
yes?
LET slanttemp
=
samplexy(temp[x=1:193,y=1:87],xlon,ylat)
yes?
fill/vlimits=1:25/l=1 slanttemp
**ERROR:
required
program
command has
not been
given: SET
DATA_SET
even after adding
l=1 I still
get the same
error.
Hi Sara,
It looks like
you haven't
loaded the
data set. What
does SHOW DATA
return before
and after the
GO LAND
command?
However, you
aren't showing
us the
complete
script so it's
impossible to
tell what is
going on. As
it stands
there should
be an error
issued for
trying to
create a
fill/shade
plot with a 3
dimensional
data set as
"slanttemp"
has been
sampled along
the line but
also has depth
and time axes.
The command
should be
something like
fill/l=1
slanttemp
unless you
have set
regions
elsewhere.
Russ
On 16/08/16
11:31, 'Sara
Sari' via _OAR
PMEL Ferret
Users wrote:
Hi
ferret users,
I'm
trying to plot
temp on
bathymetry on
Lake Erie,
Here
is my data:
name
title
I
J
K
L M
N
XOUT
X-coordinate
1:193
1:87 ...
...
...
...
YOUT
Y-coordinate
1:193
1:87 ...
...
...
...
ZOUT
Z-coordinate
1:193
1:87 1:25
...
... ...
TEMP
Temperature
1:193
1:87 1:25
1:7
... ...
My
area lies
between
-84:-78(long)
and 41:42
(lat)
I
use samplexy
script:
yes?
let xlon =
-80+(I[I=1:10]-1)
yes?
LET slope=0.5
yes?
LET ylat = 41
+
slope*(i[i=1:10]
-1)/2
yes?
PLOT/VS/LINE/SYM=27 xlon,ylat
yes?
GO land
yes?
LET slanttemp
=
samplexy(temp[x=1:193,y=1:87],xlon,ylat)
yes?
fill/vlimits=1:25 slanttemp
**ERROR:
required
program
command has
not been
given: SET
DATA_SET
I don't get this
error. and one
more thing: is
my script ok?
I mean in one
part using x
and y points
and in the
other using
lat and long?
Thank you,
Sara
|