On Mon, 19 Sep 2005, David Berry wrote:
>> Something like:
>>
>> ARR_xTOx( USEBAD, NDIMS, DIMS, LBND, UBND, INARR, OUTARR, IERR, NERR,
>> STATUS)
>>
>> (with USEBAD, IERR and NERR simply there to match the prm interface for
>> VEC_). Then if LBND is all ones and UBND == DIMS then this is a vec_
>> copy, else it's a manual copy of a subarray (it's actually a VEC_
>> copy if the first NDIMS-1 dims match DIMS).
>
> Sounds good to me. The only other suggestion may be to replace the DIMS
> argument by a LBND_IN/UBND_IN pair since otherwise the LBND(_OUT)/UBND(_OUT)
> values would need to be supplied in GRID indicies rather than PIXEL
> indices. I know its not a big deal to convert backwards and forwards
> between GRID and PIXEL, but it is at least an annoyance and introduces
> scope for bugs.
>
But then don't I have to address a negative index in a fortran array?
OUTARR(-1, -20) = INARR(-1, -20)
looks a bit dangerous to me.... [I realise that I have to trust the caller
tha NDIMS is actually within the declared bounds of the array...]
I was intending LBND/UBND to be the array indices (GRID coordinates) of
both the input and output, not a mapping from one region of the input to a
different region in the output. Feel free to convince me of complexity
though.
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|