Hi Robert,
That's not a great error message, is it. tpi is 2*pi. (It's
coming from the underlying gridding package; we'll get that
changed.) It's saying that the first argument in the call to
RECT_TO_CURV has coordinates that run more than 360 degrees
around the earth. The first argument to rect_to_curv needs to
be a variable on a rectilinear grid. Your commands are not
giving the function a rectilinear grid.
Because both data sets are on curvilinear grids, you will need
to either 1) regrid both to a rectilinear grid (with any grid
resolution that you want) and do analysis on that grid, OR,
2) map data from one of the datsets to a rectilinear grid, and
from that grid to the curvilinear grid of the other dataset.
Here's an outline of solution 1). Obviously I am just typing
commands here, so there may be typo's. The computation of the
maps is very slow and will need you to allocate extra memory.
Define any rectilinear grid you want; though higher
resolutions grids will take more time and memory. If the grid
of the satellite data does not cover the whole earth, then
defining the rectilinear grid to cover just the part of the
earth that the data does, will make the computation smaller
and faster.
yes? ! Define a
rectilinear grid and a variable on that
grid.
yes? define
axis/x=1:359:2/units=degrees_east xlon
yes? define
axis/y=-89:89:2/units=degrees_north ylat
yes? let rvar =
x[gx=xlon] + y[gy=ylat]
! Compute the
mapping from the first curvilinear grid to
our rectilinear one
! For the radius, look at the documentation
and decide on a good value
yes? use ./R1009RBRcaak01a.cice.h.2004-01.nc
yes? let radius_model=
1
yes? let
ice_model_mapping = CURV_TO_RECT_MAP(tlon,
tlat, rvar, radius_model)
yes? save/file=ice_model_mapping.nc
ice_model_mapping
!
Compute the mapping from
the second curvilinear
grid to the same
rectilinear one
!
For the
radius, look
at the
documentation
and decide on
a good value
yes?
use ./kwok_icesat.nc (default)
yes? let
radius_sat = 2
yes? let
ice_sat_mapping =
CURV_TO_RECT_MAP(longitude, latitude, rvar,
radius_sat)
yes?
save/file=ice_sat_mapping.nc ice_sat_mapping
Now you can map your curvilinear data
from both sets to the same rectilinear
grid and do computations
yes? cancel
data/all
yes? use
ice_model_mapping.nc
yes? use
R1009RBRcaak01a.cice.h.2004-01.nc
yes? let
model_on_rgrid = CURV_TO_RECT(HI[d=2],
ice_model_mapping[d=1])
yes? use
ice_sat_mapping.nc
yes? use
kwok_icesat.nc
yes? let
ice_sat_masked = H_FM04* MASK ! to apply the
mask from the dataset
yes? let
sat_on_rgrid = CURV_TO_RECT(ice_sat_masked[d=4],
ice_sat_mapping[d=3])
yes? shade/L=1
sat_on_rgrid - sat_on_rgrid
The second alternative would be to
define a mapping from one of the
curvilinear grids to a rectilinear grid,
as above, then call RECT_TO_CURV to put
that data onto the curvilinear grid of the
other variable.
-Ansley
On 3/22/2016 2:18 AM, Osinski, Robert
FORNATL, PL wrote:
Hi,
so I've tried to use rect_to_curv function put a rectilinear
data set on a curvilinear grid but with no success:
let a = rect_to_curv(hi[l=1],tlon,tlat,2)
yes? shade a, tlon, tlat
Bailing out of external function "rect_to_curv":
The range of source grid longitude may be no larger than
tpi
**ERROR: error in external function
and so details of the dataset
yes? sh dat
currently SET data sets:
1> ./R1009RBRcevp01a.cice.h.hi.nc (default)
name title I
J K L M N
TLON T grid center longitude 1:1280 1:720
... ... ... ...
TLAT T grid center latitude 1:1280 1:720
... ... ... ...
ULON U grid center longitude 1:1280 1:720
... ... ... ...
ULAT U grid center latitude 1:1280 1:720
... ... ... ...
TMASK ocean grid mask 1:1280 1:720
... ... ... ...
TAREA area of T grid cells 1:1280 1:720
... ... ... ...
ANGLE angle grid makes with latitude 1:1280 1:720
... ... ... ...
HI grid cell mean ice thickness 1:1280 1:720
... 1:120 ... ...
yes? sh grid hi
GRID GEE2
name axis # pts start end
NI X 1280 r 1
1280
NJ Y 720 r 1 720
normal Z
TIME TIME 120 i 01-FEB-1980 00:00
01-JAN-1990 00:00
normal E
normal F
yes? sh grid tlon
GRID GEE1
name axis # pts start end
NI X 1280 r 1
1280
NJ Y 720 r 1 720
normal Z
normal T
normal E
normal F
thanks,
Robert
From: owner-ferret_users@xxxxxxxx
[owner-ferret_users@xxxxxxxx] on behalf of Ansley C. Manke
[ansley.b.manke@xxxxxxxx]
Hi Robert,
You would need to use the regridding functions to regrid,
say, one of the fields to a rectilinear grid and from there
to the other curvilinear grid; or regrid both of them to the
same rectilinear grid and do your calculations there.
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/CURV-TO-RECT
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/CURV-TO-RECT-MAP
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/RECT-TO-CURV
We do have in the pipeline some development which will make
handling curvilinear grids more seamless, and some
regridding functions which are faster; but the fact remains
that you'd need to get the data onto the same grids before
being able to take differences.
Ansley
On 3/21/2016 3:53 PM, Osinski,
Robert FORNATL, PL wrote:
Dear
ferreters,
I need your help in
interpolating/regridding model outputs onto
satellite measurements. I have model results
of ice thickness distribution on:
sh dat
1>
./R1009RBRcaak01a.cice.h.2004-01.nc
(default)
name title
I J K L
TLON T grid center longitude
1:1280 1:720 ... ...
TLAT T grid center latitude
1:1280 1:720 ... ...
ULON U grid center longitude
1:1280 1:720 ... ...
ULAT U grid center latitude
1:1280 1:720 ... ...
TMASK ocean grid mask
1:1280 1:720 ... ...
HI grid cell mean ice thickness
1:1280 1:720 ... 1:1
and satellite measurements:
yes? sh dat
currently SET data sets:
1> ./kwok_icesat.nc (default)
name title
I J K L
M N
CELL_AREA
area of grid cell on stereograp
1:140 1:140 ... ...
... ...
H_FM04 February-March 2004 sea ice thi
1:140 1:140 ... ...
... ...
LATITUDE latitude
1:140 1:140 ... ...
... ...
LONGITUDE
longitude
1:140 1:140 ... ...
... ...
MASK ocean-land mask
1:140 1:140 ... ...
... ...
I need to have interpolated model's output
onto measurements grid to have possibility
to do some calculations between them for
instance to get distribution of differences
between them. Attached are figures of
modeled and measured ice.
Thanks in advance,
Robert Osinski
NPS,
Monterey, CA
|