next up previous 196
Next: Replacing calls to E02CBF
Up: Two-dimensional Interpolation and Fitting
Previous: Replacing calls to E02DAF


Replacing calls to E02SAF

It has been found in tests that the following code examples adequately replace calls to E02SAF.

*  Local Variables:
      INTEGER  ISTAT                   ! Status
      INTEGER  MD                      ! Mode
      INTEGER  NDP                     ! Grid points
      INTEGER  NCP                     ! Not used
      INTEGER  NOP                     ! Size of returned array
      INTEGER  IWK(2500)               ! Workspace    
      REAL     WK(640)                 ! Workspace
      REAL     XD(80),YD(80),ZD(80)    ! Surface data
      REAL     XI(1),YI(1)             ! Extrap points
      REAL     ZI(1,1)                 ! Results 


*   Set the error flag default values.
      ISTAT=0
      STATUS=0
 
*   Set mode and the grid positions (for PDA_IDBVIP).
      MD= 1
      NCP=2
      NOP=1
               
*   Call interpolation subroutine.      
      CALL PDA_IDBVIP(MD,NCP,NDP,XD,YD,ZD,NOP,XI,YI, 
     :                ZI,IWK,WK,ISTAT,STATUS)

In the example shown, the value of the interpolated surface at XI(1),YI(1) is returned in the variable ZI(1,1). The surface is constructed using co-ordinate information from the arrays of XD() and YD(), and surface values contained in the array ZD(). The number of data points available to define the surface is NDP.

If several values are required from locations within the irregular grid, the mode variable MD should for the first point be set to 1 but may subsequently be 2. This significantly increases the execution speed. The size of the work arrays is determined by the size of the grid required.

Alternatively, the routine PDA_IDSFFT may be used thus:

      INTEGER  ISTAT                   ! Status
      INTEGER  MD                      ! Mode
      INTEGER  NDP                     ! Grid points
      INTEGER  NCP                     ! Not used
      INTEGER  NXI,NYI                 ! Output gird size
      INTEGER  IWK(2500)               ! Workspace    
      REAL     XD(80),YD(80),ZD(80)    ! Surface data
      REAL     XI(1),YI(1)             ! Extrap points
      REAL     ZI(1,1)                 ! Results 
      REAL     WK(640)                 ! Workspace

*   Set the error flag default values.
      ISTAT=0
      STATUS=0
 
*   Set up the grid positions.
      NXI=1
      NYI=1             

*   Set mode and the grid positions (for PDA_IDBVIP).
      MD= 1
      NCP=2

*         Call the surface fitting subroutine.
            CALL PDA_IDSFFT(MD,NCP,NDP,XD,YD,ZD,
     :                      NXI,NYI,XI,YI,ZI,IWK, 
     :                      WK,ISTAT,STATUS)

In the example shown the surface is constructed from the irregular grid information contained in arrays XD()/YD() (location) and ZD() (surface value). Interpolated values calculated from the fitted surface are returned in the ZI() array at the co-ordinates specified by the data in the XI() and YI() arrays.

If several values are required from locations within the irregular grid, the mode variable MD should for the first point be set to 1 but may subsequently be 2. This significantly increases the execution speed. The size of the work arrays is determined by the size of the grid required.


next up previous 196
Next: Replacing calls to E02CBF
Up: Two-dimensional Interpolation and Fitting
Previous: Replacing calls to E02DAF

PDA [1ex
Starlink User Note 194
H. Meyerdierks, D. Berry, P. W. Draper, G. Privett, M. Currie
12th October 2005
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council