[Thread Prev][Thread Next][Index]

Re: [ferret_users] conform variables and how to catch common sizes of region

On 12/13/2010 8:01 AM, Patrick.Brockmann@xxxxxx wrote:
Hi all,

Is there a way to catch common sizes of region
between variables ?

Here is an example and its error message.

yes? use piControl2_18000101_23391231_1M_tops.nc
yes? use piControl2_18000101_20491231_1M_topl.nc
yes? let A=tops+topl
yes? list A[i=30,j=40]
 **ERROR: inconsistent sizes of data regions: T axis
          TOPL[D=2] has 3000 points (L=0001:3000)
          _expression_ has 6480 points (L=0001:6480)

Hi Patrick,

It seems like the issue is not just about "sizes";  it is about the coordinate ranges and values.  Theses two time axes could cover different time ranges and could potentially have different resolutions or offsets in their time coordinates.  Even if you did not suffer the error above, this _expression_ should give you an "ambiguous coordinates" error message.  (I don't see how the syntax can work as-is, unless the _1M_topl.nc dataset contains both tops and topl variables.   Doesn't the _expression_ need to be "let A=tops[d=1]+topl"?)

The easy answer is to arbitrarily say that one of the two variables -- say whatever is from the first dataset that gets initialized -- is the authoritative time range. Then you can say
let A=tops+topl[gt=tops[d=1]]
and your problem should be solved.

What is the "right" solution?  My guess is that in the situation above there is a region of time over which the two axes overlap perfectly (have identical time step coordinates).   If so then the "right" solution might look something like this:
use piControl2_18000101_23391231_1M_tops.nc
use piControl2_18000101_20491231_1M_topl.nc
DEFINE AXIS/OVERLAP/T tnew = tops[d=1], topl[d=2]
let A=tops[D=1,gt=tnew]+topl[gt=tnew]
This command could only be implemented with code changes in Ferret.  But I expect that you could achieve the desired goal by creating a grid-changing external function that performed the sum.  The function would create the new time, overlap-region axis.

	- Steve

P.S.  Could also implement variations on this theme such as
    DEFINE AXIS/SUPERSET/T tnew = tops[d=1], topl[d=2]

How useful would these be?

I understand perfectly that the 2 components of the variable A
are not conform but how to get the result of this error to process
their common size of region on T axis, here L=0001:3000
and then be able to do for example
yes? save/l=0001:3000 A

Note that I research the most general way to do this and
so I cannot "simply" get lend from topl and tops and calculate
the minimum because variable A may be the combinaison of n variables.

Let me know If I have been clear enough and if there is
a workaround I have missed.


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement