IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 8, 2014, 2:44:35 PM (12 years ago)
Author:
eugene
Message:

i am making image.coords.mosaic and image.parent pointers to the parent (PHU) coord and image strutures; BuildChipMatch sets these values and we do not need to call FindMosaicForImage

Location:
branches/eam_branches/ipp-20140904/Ohana/src/getstar
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/getstar/include/dvoImageOverlaps.h

    r27435 r37378  
    3737int edge_check (double *x1, double *y1, double *x2, double *y2);
    3838double opening_angle (double x1, double y1, double x2, double y2, double x3, double y3);
     39
     40void initMosaicCoords ();
     41void saveMosaicCoords (Coords *input);
  • branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/MatchCoords.c

    r31238 r37378  
    2929    if (!WITH_PHU && !strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue;
    3030    if ( SOLO_PHU &&  strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue;
    31 
    32     /* if any of these images are WRP images, need to find matching DIS */
    33     if (!FindMosaicForImage (dbImages, NdbImages, i)) continue;
    3431
    3532    /* define image corners */
  • branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/MatchImages.c

    r36481 r37378  
    2424  /* for mosaic astrometry, the grid should be w.r.t. the tangent-plane, not chip coords */
    2525  if (!strcmp (&image[0].coords.ctype[4], "-WRP")) {
    26     // if the input image is a mosaic, we need to register that mosaic for the calculations below
    27     if (MOSAIC == NULL) {
    28       fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n");
    29       return NULL;
    30     }
    31     RegisterMosaic (MOSAIC);
    32 
    33     tcoords = MOSAIC[0];
     26    myAssert (image[0].coords.mosaic, "should already have tested this");
     27    tcoords = image[0].coords.mosaic[0];
    3428    tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0;
    3529    tcoords.pc1_1 = tcoords.pc2_2 = 1.0;
     
    7771    if (!WITH_PHU && !strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue;
    7872    if ( SOLO_PHU &&  strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue;
    79 
    80     /* if any of these images are WRP images, need to find matching DIS */
    81     if (!FindMosaicForImage (dbImages, NdbImages, i)) continue;
    8273
    8374    /* define image corners */
  • branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/ReadImageFiles.c

    r36874 r37378  
    4242
    4343  mode = GetFileMode (header);
     44
     45  initMosaicCoords ();
    4446
    4547  /*** load data from a single PHU or a collection of PHU files ***/
  • branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/ReadImageHeader.c

    r21508 r37378  
    11# include "dvoImageOverlaps.h"
     2
     3// for DIS/WRP sets, we need to save the DIS set and supply it to the WRP entries
     4static Coords *mosaic = NULL;
     5
     6void initMosaicCoords () {
     7  mosaic = NULL;
     8}
     9
     10void saveMosaicCoords (Coords *input) {
     11  mosaic = input;
     12}
    213
    314/* read an image header corresponding to a CMF / CMP data block */
     
    4455  /* only load astrometry, NAXIS1,2, and time if this is a MOSAIC_PHU (ctype is ....-DIS) */
    4556  if (!strcmp (&image[0].coords.ctype[4], "-DIS")) {
    46     MOSAIC = &image[0].coords;
     57    saveMosaicCoords (&image[0].coords);
    4758    return (TRUE);
    4859  }
     
    5667  }
    5768  if (!strcmp (&image[0].coords.ctype[4], "-WRP")) {
    58     if (MOSAIC == NULL) {
     69    if (mosaic == NULL) {
    5970      fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n");
    6071      return (FALSE);
    6172    }
    62     RegisterMosaic (MOSAIC);
     73    image[0].coords.mosaic = mosaic;
    6374  } else {
    6475    /* force image to lie in 0-360 range */
  • branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/WriteImages.c

    r27435 r37378  
    55 
    66  int i, N;
    7   int nWRP, newWRP, isWRP;
     7  int isWRP;
    88  FILE *f;
    99
     
    1616  }
    1717
    18   nWRP = -1;
     18  Image *mosaic = NULL;
    1919  isWRP = FALSE;
    2020  for (i = 0; i < Nmatches; i++) {
    21     if (!strcmp (&images[0].coords.ctype[4], "-WRP")) {
    22       if (!FindMosaicForImage (images, Nimages, i)) {
    23         fprintf (stderr, "failed to find matching mosaic\n");
    24         exit (1);
    25       }
     21    N = matches[i];
     22    if (!strcmp (&images[N].coords.ctype[4], "-WRP")) {
    2623      if (isWRP) {
    27         newWRP = GetRegisteredMosaic();
    28         if (newWRP != nWRP) {
     24        if (mosaic != images[N].parent) {
    2925          fprintf (stderr, "only one mosaic allowed in an output file\n");
    3026          exit (1);
    3127        }
    3228      } else {
    33         nWRP = GetRegisteredMosaic();
    34         isWRP = TRUE;
     29        mosaic = images[N].parent;
    3530      }
    3631    }     
     
    3833
    3934  if (isWRP) {
    40     WriteImageFITS (f, &images[nWRP]);
     35    WriteImageFITS (f, mosaic);
    4136  } else {
    4237    // write a blank
Note: See TracChangeset for help on using the changeset viewer.