IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6887 for trunk/stac/src/stac.h


Ignore:
Timestamp:
Apr 18, 2006, 12:20:45 PM (20 years ago)
Author:
Paul Price
Message:

Updating to use psLib rel11. Main problem was that vector and array lengths ('n' element) are no longer set to equal the number of allocated values ('nalloc' element) when allocated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/stac.h

    r5743 r6887  
    1919// Read the input files and return an array of images
    2020psArray *stacReadImages(psArray **headers, // The image headers, to be returned
    21                         psArray *filenames // The file names of the images
     21                        psArray *filenames // The file names of the images
    2222    );
    2323
     
    3838// Calculate the error images
    3939psArray *stacErrorImages(psArray *inputs, // Array of input images
    40                          float gain,    // Gain, in e/ADU
    41                          float rn       // Read noise, in e
     40                         float gain,    // Gain, in e/ADU
     41                         float rn       // Read noise, in e
    4242    );
    4343
     
    4747
    4848// Transform input images, return success
    49 bool stacTransform(psArray **outputs,   // Transformed images for output
    50                    psArray **outErrors, // Transformed error images for output
    51                    const psArray *images, // Array of images to be transformed
    52                    const psArray *maps, // Array of polynomials that do the transformation
    53                    const psArray *errors, // Array of error images to be transformed
    54                    const psArray *masks, // Masks of input images
    55                    const psImage *region, // Region of interest for transformation
    56                    const psVector *scales, // Relative scales
    57                    const psVector *offsets, // Relative offsets
    58                    int outnx, int outny // Size of output images
     49bool stacTransform(psArray **outputs,   // Transformed images for output
     50                   psArray **outErrors, // Transformed error images for output
     51                   const psArray *images, // Array of images to be transformed
     52                   const psArray *maps, // Array of polynomials that do the transformation
     53                   const psArray *errors, // Array of error images to be transformed
     54                   const psArray *masks, // Masks of input images
     55                   const psImage *region, // Region of interest for transformation
     56                   const psVector *scales, // Relative scales
     57                   const psVector *offsets, // Relative offsets
     58                   int outnx, int outny // Size of output images
    5959    );
    6060
     
    6868// Print out the problem
    6969void stacMemoryProblem(const psMemBlock* ptr, ///< the pointer to the problematic memory block.
    70                        const char *file, ///< the file in which the problem originated
    71                        psS32 lineno     ///< the line number in which the problem originated
     70                       const char *file, ///< the file in which the problem originated
     71                       psS32 lineno     ///< the line number in which the problem originated
    7272    );
    7373
     
    8181
    8282// Get the mean for a bunch of values
    83 float stacCombineMean(psVector *values, // Values for which to take the mean
    84                       psVector *errors, // Errors in the values
    85                       psVector *masks   // Masks for the values, 0 = don't use, 1 = use
     83float stacCombineMean(psVector *values, // Values for which to take the mean
     84                      psVector *errors, // Errors in the values
     85                      psVector *masks   // Masks for the values, 0 = don't use, 1 = use
    8686    );
    8787
    8888// Get the median for a bunch of values
    8989float stacCombineMedian(psVector *values, // Values for which to take the median
    90                         psVector *errors, // Errors in the values
    91                         psVector *masks // Masks for the values, 0 = don't use, 1 = use
     90                        psVector *errors, // Errors in the values
     91                        psVector *masks // Masks for the values, 0 = don't use, 1 = use
    9292    );
    9393
    9494// Combine the transformed images
    95 bool stacCombine(psImage **combined,    // The combined image for output
    96                  psArray **rejected,    // Array of rejection masks
    97                  psArray *images,       // Array of transformed images
    98                  psArray *errors,       // Array of transformed error images
    99                  int nReject,           // Number of rejection iterations
    100                  psImage *region,       // Region to combine
    101                  psVector *saturated,   // Saturation limits for each image
    102                  psVector *bad,         // Bad pixel limits for each image
    103                  float reject           // Rejection (k-sigma)
     95bool stacCombine(psImage **combined,    // The combined image for output
     96                 psArray **rejected,    // Array of rejection masks
     97                 psArray *images,       // Array of transformed images
     98                 psArray *errors,       // Array of transformed error images
     99                 int nReject,           // Number of rejection iterations
     100                 psImage *region,       // Region to combine
     101                 psVector *saturated,   // Saturation limits for each image
     102                 psVector *bad,         // Bad pixel limits for each image
     103                 float reject           // Rejection (k-sigma)
    104104    );
    105105
     
    110110// Invert an array of maps
    111111psArray *stacInvertMaps(const psArray *maps, // Array of maps to invert
    112                         int outnx, int outny // Size of output image
     112                        int outnx, int outny // Size of output image
    113113    );
    114114
     
    118118
    119119// Return the relative gradient for a given pixel
    120 float stacGradient(psImage *image,      // Input for which to measure the gradient
    121                    int x, int y         // Coordinates at which to measure the gradient
     120float stacGradient(psImage *image,      // Input for which to measure the gradient
     121                   int x, int y         // Coordinates at which to measure the gradient
    122122    );
    123123
    124124// Transform the rejection masks back to the source frame
    125 psArray *stacRejection(psArray *inputs, // Input images
    126                        psArray *rejected, // Rejected images
    127                        psArray *regions, // Regions of interest
    128                        psArray *maps,   // Maps from input to transformed image
    129                        psArray *inverseMaps, // Maps from transformed to input image
    130                        float frac,      // Fraction of pixel rejected before looking more carefully
    131                        float grad,      // Gradient limit for rejection
    132                        psArray *names   // Names of original images (only for writing out when TESTING)
     125psArray *stacRejection(psArray *inputs, // Input images
     126                       psArray *rejected, // Rejected images
     127                       psArray *regions, // Regions of interest
     128                       psArray *maps,   // Maps from input to transformed image
     129                       psArray *inverseMaps, // Maps from transformed to input image
     130                       float frac,      // Fraction of pixel rejected before looking more carefully
     131                       float grad,      // Gradient limit for rejection
     132                       psArray *names   // Names of original images (only for writing out when TESTING)
    133133    );
    134134
     
    139139// Returns the change in x' and y' for a change in x and y of 1
    140140bool stacPlaneTransformDeriv(psPlane *out, // Output derivative, assumed already allocated
    141                              psPlaneTransform *transform, // The transform for which to obtain the derivative
    142                              psPlane *in // The position at which to obtain the derivative
     141                             psPlaneTransform *transform, // The transform for which to obtain the derivative
     142                             psPlane *in // The position at which to obtain the derivative
    143143    );
    144144
     
    146146// Basically, uses derivatives of the transformation to work out what pixels in the source might be of interest
    147147psImage *stacAreaOfInterest(psImage *mask, // Mask that is to be used to determine the area of interest
    148                             psPlaneTransform *map, // Map from the mask to the area of interest
    149                             int nxOut, int nyOut // Size of the area of interest
     148                            psPlaneTransform *map, // Map from the mask to the area of interest
     149                            int nxOut, int nyOut // Size of the area of interest
    150150    );
    151151
     
    155155
    156156// Calculate the size of the output image
    157 bool stacSize(int *outnx, int *outny,   // Size of output image (returned)
    158               float *xMapDiff, float *yMapDiff, // Difference applied to maps
    159               const psArray *images,    // Input images
    160               psArray *maps             // Transformation maps
     157bool stacSize(int *outnx, int *outny,   // Size of output image (returned)
     158              float *xMapDiff, float *yMapDiff, // Difference applied to maps
     159              const psVector *xSizes,   // Sizes of images in x
     160              const psVector *ySizes,   // Sizes of images in y
     161              psArray *maps             // Transformation maps
    161162    );
    162163
     
    167168// Calculate the background in an image
    168169float stacBackground(const psImage *image, // Image for which to get the background
    169                      int sample         // Sample in increments of this value
     170                     int sample         // Sample in increments of this value
    170171    );
    171172
    172173
    173174// Calculate the relative scales and offsets between the images
    174 bool stacScales(psVector **scalesPtr,   // Scales to return
    175                 psVector **offsetsPtr,  // Offsets to return
    176                 const psArray *images,  // Images on which to measure the scales and offsets
    177                 const char *starFile,   // File containing coordinates to photometer
    178                 const char *starMapFile, // Map for coodinates to the common output frame
    179                 float xMapDiff, float yMapDiff, // Difference from the map to apply (due to size difference)
    180                 float aper              // Aperture to use for photometry (radius)
     175bool stacScales(psVector **scalesPtr,   // Scales to return
     176                psVector **offsetsPtr,  // Offsets to return
     177                const psArray *images,  // Images on which to measure the scales and offsets
     178                const char *starFile,   // File containing coordinates to photometer
     179                const char *starMapFile, // Map for coodinates to the common output frame
     180                float xMapDiff, float yMapDiff, // Difference from the map to apply (due to size difference)
     181                float aper              // Aperture to use for photometry (radius)
    181182    );
    182183
    183184// Rescale images
    184 bool stacRescale(psArray *images,       // Images to rescale
    185                  psArray *errImages,    // Variance images to rescale
    186                  const psImage *mask,   // Mask indicating which pixels to scale
    187                 const psVector *scales,// Scales for images
    188                 const psVector *offsets // Offsets for images
     185bool stacRescale(psArray *images,       // Images to rescale
     186                 psArray *errImages,    // Variance images to rescale
     187                 const psImage *mask,   // Mask indicating which pixels to scale
     188                const psVector *scales,// Scales for images
     189                const psVector *offsets // Offsets for images
    189190    );
    190191
     
    196197
    197198// Write map out
    198 bool stacWriteMap(const char *mapName,  // Filename to write to
    199                   psPlaneTransform *map // Map to write
     199bool stacWriteMap(const char *mapName,  // Filename to write to
     200                  psPlaneTransform *map // Map to write
    200201    );
    201202
    202203// Write multiple maps
    203204bool stacWriteMaps(const psArray *names, // Filenames of the input images (will add ".map")
    204                    const psArray *maps  // Maps to write
     205                   const psArray *maps  // Maps to write
    205206    );
    206207
Note: See TracChangeset for help on using the changeset viewer.