[Thread Prev][Thread Next][Index]
Re: [ferret_users] Interpolation problem
Hi,
I read your question more closely and my answer was too simplistic. Your
data has a whole batch of data at a single date, lon, lat, time, depth,
then another bath at the same date, lon, lat and a new depth. (It would
be helpful to describe your data in the message in addition to including
it). So I think that's what you are doing with this mask.
Note that the mask you defined has a value of 1 for many repeated values
near the start of the list. If you want to get the locations where depth
changes, just something like this will work:
let mask = if dep[ddf] NE 0 then 1
but perhaps you have something else in mind. Assuming the mask picks out
non-repeating values of dep, then continuing after the definitions in
your script, I would do this:
let masked_dep = dep*mask
let masked_tem = tem*mask
let masked_sa = sa*mask
! Compress gaps out of these variables
let depths = compressk(masked_dep)
let temp = compressk(masked_tem)
let salt = compressk(masked_sa)
! Number of vaid data in the variable
let nz = `depths[z=@ngd]`
! The data are on the depth axis defined by the depth variable in the data:
define axis/z/units=meters zaxis_in = depths[k=1:`nz`]
let salt_in = salt[gz=zaxis_in@ASN]
let temp_in = temp[gz=zaxis_in@ASN]
! now define the axis you want, with increments of 0.5 meters
! Instead of zmax as defined, you'll want that value, rounded up to the
next 0.5 meters.
let zmax = `depths[z=@max]` ! want to round this up to the nearest 0.5
define axis/z=0:`zmax`:0.5/units=meters z05
! Regrid the input data to that axis.
! These commands could have /UNITS= and /TITLE= to define
self-documenting variables.
! You could choose a different regridding transformation, such as @AVE.
let salinity = salt_in[gz=z05]
let temperature = temp_in[gz=z05]
On 12/4/2012 2:17 AM, Akshay Hegde wrote:
Hi ! experts...
I am trying to interpolate my data file....
pls have a look on data file...
I need temperature and salinity value with a bin size of 0.5 meter..
define axis/z=1:377:1 zax
define grid/z=zax mygrid
columns/skip=1/delim="\t,\b"/type="numeric,numeric,numeric,numeric,numeric,numeric,numeric"/grid=mygrid
ctd001_ins1_04-08-07_1100.out
let date =v1
let time =v2
let lon =v3
let lat =v4
let dep = v5
let tem = v6
let sa = v7
let mask = if dep[z=@ddf] eq dep[z=@ddb] then 1
list mask, dep,tem,sa
till here I could able to do...how can I get temp, sal value with bin
size of 0.5
Thanks in advance...
Akshay
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement