Hi Martin,
I ran into a similar issue recently myself. Putting observations
that have gaps onto a coordinate axis instead treats the gaps as
just extra-large grid cells. The transformation @NRST is perhaps the
one that would most closely do what you want; but if the source
coordinates don't quite match the destination cells it will return
no data.
A next version of Ferret will have an @BIN and @NBIN
transformations. @BIN willtake the source grid points within each
destination grid cell, and do an unweighted average; @NBIN returns
the count of source points in the destination cell.
You might do ok with a mask on the result of @MAX or @MIN, sketched
out as follows:
let var_max = [definition with @MAX]
let mask = if var_max then 1
let var_on_grid = [regridding of variable with @AVE]
let final_var = mask*var_on_grid
-Ansley
On 11/8/2015 5:53 AM, Martin Schmidt
wrote:
Hi,
I am trying to arrange station data into a time series. Each
station file has full 4d coordinates, horizontal and vertical
coordinates are the same, the time axis in the station files has
one time step each.
Concatinating works by opening file after file (in the right
order) and saving to the final file like this
save/append/file=station.nc oxygen
The data are distributed very irregularly, 2-6 data sets within
2-3 days and nothing inbetween for weeks.
Now I want to put the data onto a regular, say a daily time axis.
For the days where I have data I want to get the average over all
data belonging to the special day and a missing value otherwise.
use station.nc
define axis/t=1-jan-2014:31-aug-2015:1/t0=1-jan-2000/unit=days
tnew
let ox_day = oxygen[gt=tnew@ave]
However, this gives constant values for the days but the same
within the gaps. A "shade" looks like displaying the original data
"oxygen" with shade.
Using the @min or @max transformation gives non-missing values
only for the days, where station data are available. This is the
desired behaviour.
@sum and @ngd transformation gives nozero values for each day,
very small but finite for days without station data and of almost
correct size for days with station data. @ngd is not integer - a
little bit below the expected value for days with station data and
almost zero but finite within gaps.
I tried to use the bounds-qualifier. When concatinating the files
I get an error message, but after concatination I can resave the
data with the bounds qualifier as described in the manual. This
does not change the bahaviour.
So my question: what I am doing wrong or is this a bug? How do I
get integer @ngd values - especially exactly zero for days without
data?
Many thanks,
Martin Schmidt
|