As promised, I've generic-ified all the kpg1 kaplibs routines that were
generic in ccdpack.
I get the following differences [kaplibs routine is always '-'], and they
look like legitimate fixes for kaplibs that have only been applied to
ccdpack. Now that I have genericified the kaplibs versions all it takes is
a copy to resync kaplibs with ccdpack. Can someone (Peter? Malcolm?
David?) vett these diffs please?
As for the non-generic files, kpg1_asfrm.f has been upgraded in kaplibs
but not ccdpack. I'll send a more complete non-libkpg kpg1 audit in a
follow up email.
Tim
--- kpg1_ainb.gdr 2004-10-01 16:37:27.000000000 -1000
+++ ../../../applications/ccdpack/gen/kpg1_ainb.gen 1997-06-26
23:01:41.000000000 -1000
@@ -201,7 +200,7 @@
* due to rounding), where the average slope is used to interpolate
* rather than the difference in axis values.
IF ( RESID / SLOPE .LT. 0.0D0 ) THEN
- UB = MAX( LBND, MIN( CINDEX + 1, UBND ) )
+ UB = MAX( LBND + 1, MIN( CINDEX + 1, UBND ) )
DIFF = NUM_<T>TOD( AXIS( UB - 1 ) - AXIS( UB ) )
IF ( ABS( DIFF ) .LT. NUM_<T>TOD( VAL__EPS<T> ) ) THEN
DIFF = SLOPE
@@ -221,7 +220,7 @@
* due to rounding), where the average slope is used to interpolate
* rather than the difference in axis values.
ELSE
- LB = MIN( UBND, MAX( CINDEX, LBND ) )
+ LB = MIN( UBND - 1, MAX( CINDEX, LBND ) )
DIFF = NUM_<T>TOD( AXIS( LB + 1 ) - AXIS( LB ) )
IF ( ABS( DIFF ) .LT. NUM_<T>TOD( VAL__EPS<T> ) ) THEN
--- kpg1_iscl.gbdirw 2004-10-01 16:52:56.000000000 -1000
+++ ../../../applications/ccdpack/gen/kpg1_iscl.gen 1997-06-26
23:01:41.000000000 -1000
@@ -33,11 +33,11 @@
* The second dimension of the 2-d arrays.
* INARR( DIM1, DIM2 ) = ? (Given)
* The original, unscaled image data.
-* LOWER = ? (Given)
+* LOWER = DOUBLE PRECISION (Given)
* The data value that specifies the lower image-scaling limit.
* This may be smaller than %UPPER to provide a negative scale
* factor.
-* UPPER = ? (Given)
+* UPPER = DOUBLE PRECISION (Given)
* The data value that specifies the upper image-scaling limit.
* INVERT = LOGICAL (Given)
* True if the image is to be inverted for display.
@@ -69,6 +69,7 @@
* Authors:
* MJC: Malcolm J. Currie (STARLINK)
+* PDRAPER: Peter Draper (STARLINK - University of Durham)
* {enter_new_authors_here}
* History:
@@ -78,6 +79,9 @@
* Made bad value generic.
* 1991 July 23 (MJC):
* Added BADVAL argument.
+* 1993 February 10 (PDRAPER):
+* Fixed bug in inarr addressing (use of K in non-inverting loops).
+* Changed input ranges to DOUBLE PRECISION.
* {enter_further_changes_here}
* Bugs:
@@ -109,7 +113,7 @@
<TYPE>
: INARR( DIM1, DIM2 )
- <TYPE>
+ DOUBLE PRECISION
: LOWER,
: UPPER
@@ -142,8 +146,8 @@
UL = DBLE( VAL__MAXI )
LL = DBLE( VAL__MINI )
- DL = NUM_<T>TOD( LOWER )
- DU = NUM_<T>TOD( UPPER )
+ DL = LOWER
+ DU = UPPER
* Find the scaling factor.
* ========================
@@ -156,8 +160,8 @@
CALL MSG_SETD( 'LOWER', DL )
CALL MSG_SETD( 'UPPER', DU )
CALL ERR_REP( 'KPG1_ISCLX',
- : 'Scaling range, ^LOWER to ^UPPER, is too small to scale '/
- : /'the image.', STATUS )
+ : 'Scaling range, ^LOWER to ^UPPER, is too small to scale '//
+ : 'the image.', STATUS )
GOTO 999
ELSE
SCALE = DBLE( UPPLIM - LOWLIM )/ ( DU - DL )
@@ -197,8 +201,8 @@
* Scale between the limits.
- OUTARR( J, I ) = LOWLIM + MIN( UPPLIM - LOWLIM,
- : MAX( 0, NINT( W ) ) )
+ OUTARR( J, I ) = LOWLIM +
+ : MIN( UPPLIM - LOWLIM, MAX( 0, NINT( W ) ) )
END IF
END IF
[kpg1_ludc - I fixed an uninitialised compiler error in kaplibs. not
ccdpack]
--- kpg1_tdli.gn 2004-10-01 21:27:40.655111600 -1000
+++ ../../../applications/ccdpack/gen/kpg1_tdli.gen 2002-09-05
01:16:07.000000000 -1000
@@ -68,8 +68,6 @@
* The dimensions of the output n-D arrays.
* OUTARR( * ) = ? (Returned)
* The transformed data array.
-* OUTVAR( * ) = ? (Returned)
-* The variance array of the transformed data.
* COIN( OEL, NDIMI ) = DOUBLE PRECISION (Returned)
* Workspace used to store the co-ordinates of a row of points
* in the input arrays.
@@ -157,6 +155,7 @@
* Authors:
* MJC: Malcolm J. Currie (STARLINK)
+* MBT: Mark Taylor (STARLINK)
* {enter_new_authors_here}
* History:
@@ -165,6 +164,8 @@
* 1993 June 23 (MJC):
* Added protection against out-of-bounds indexing, and assigned
* ETSR to powers of two.
+* 2002 September 5 (MBT):
+* Fixed bug; flux value was being ignored.
* {enter_further_changes_here}
* Bugs:
@@ -678,7 +679,7 @@
* Validate that the output element has been computed using sufficient
* weight.
IF ( WSUM .GT. VAL__SMLD ) THEN
- OUTARR( K ) = NUM_DTO<T>( ASUM / WSUM )
+ OUTARR( K ) = NUM_DTO<T>( FLUX * ASUM / WSUM )
ELSE
OUTARR( K ) = VAL__BAD<T>
END IF
@@ -711,7 +712,7 @@
* Validate that the output variance element has been computed using
* sufficient weight.
IF ( WSUM .GT. VAL__SMLD ) THEN
- OUTVAR( K ) = NUM_DTO<T>( ASUM / WSUM )
+ OUTVAR( K ) = NUM_DTO<T>( FLUX * ASUM / WSUM )
ELSE
OUTVAR( K ) = VAL__BAD<T>
END IF
--- kpg1_trbo.gdr 2004-10-01 21:34:57.916637744 -1000
+++ ../../../applications/ccdpack/gen/kpg1_trbo.grd 1997-06-26
23:01:41.000000000 -1000
@@ -117,21 +117,17 @@
* Local Variables:
<TYPE> BOUNDI( MAXPTS, NDF__MXDIM ) ! Input co-ordinates
<TYPE> BOUNDO( MAXPTS, NDF__MXDIM ) ! Output co-ordinates
+ <TYPE> STEP( NDF__MXDIM ) ! Increments of the input co-ordinates
INTEGER EL ! Number of elements in the output array
- LOGICAL END ! True if a new box has been found
- ! or there are no more boxes to sum
INTEGER I ! Loop counter
INTEGER IAXIS ! Loop counter for the axes
INTEGER J ! Loop counter
INTEGER K ! Output-array index
- INTEGER NCIN ! Number of values in the inverse
- ! transformation
- INTEGER NCOUT ! Number of values in the forward
- ! transformation
- INTEGER OFFSET ! Offset within the first dimension
- ! of the output array
- <TYPE> STEP( NDF__MXDIM ) ! Increments of the input co-ordinates
+ INTEGER NCIN ! Number of values in the inverse
transformation
+ INTEGER NCOUT ! Number of values in the forward
transformation
+ INTEGER OFFSET ! Offset within the first dimension of the
output array
INTEGER STRID( NDF__MXDIM ) ! Dimension strides for co-ords array
+ LOGICAL END ! True if a new box has been found or
there are no more boxes to sum
* Internal References:
INCLUDE 'NUM_DEC_CVT' ! NUM declarations for conversions
@@ -181,6 +177,13 @@
* bounds.
DO IAXIS = 1, NDIMI
BOUNDI( 1, IAXIS ) = LBND( IAXIS )
+
+* And also for the other axes.
+ IF ( NDIMI .GT. 1 ) THEN
+ DO I = 2, MAXPTS
+ BOUNDI( I, IAXIS ) = LBND( IAXIS )
+ END DO
+ END IF
END DO
* Compute the strides.
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|