IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3393


Ignore:
Timestamp:
Mar 7, 2005, 10:21:59 PM (21 years ago)
Author:
eugene
Message:

added mosaic astrometry functions

Location:
trunk/Ohana/src/opihi
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/coords.c

    r2843 r3393  
    11# include "astro.h"
     2
     3enum {NONE, SKY, PIXEL};
    24
    35int coords (int argc, char **argv) {
     
    57  int mode, N;
    68  double X, Y, R, D;
    7   Coords coords;
    8   Buffer *buf;
     9  char *MOSAIC;
     10  Coords coords, moscoords;
     11  Buffer *buf, *mosbuffer;
    912
    10   mode = 0;
     13  MOSAIC = NULL;
     14  if ((N = get_argument (argc, argv, "-mosaic"))) {
     15    remove_argument (N, &argc, argv);
     16    MOSAIC = strcreate (argv[N]);
     17    remove_argument (N, &argc, argv);
     18  }
     19
     20  mode = NONE;
    1121  if ((N = get_argument (argc, argv, "-p"))) {
    1222    remove_argument (N, &argc, argv);
     
    1525    Y = atof(argv[N]);
    1626    remove_argument (N, &argc, argv);
    17     mode = 1;
     27    mode = SKY;
    1828  }
    1929  if ((N = get_argument (argc, argv, "-c"))) {
    20     if (mode == 1) {
    21       fprintf (stderr, "only one of -p or -c can be used\n");
    22       return (FALSE);
    23     }
     30    if (mode == SKY) goto syntax;
    2431    remove_argument (N, &argc, argv);
    2532    R = atof(argv[N]);
     
    2734    D = atof(argv[N]);
    2835    remove_argument (N, &argc, argv);
    29     mode = 2;
     36    mode = PIXEL;
    3037  }
    31   if ((mode == 0) || (argc != 2)) {
    32     fprintf (stderr, "USAGE: coords [buffer] (-c R D) / (-p X Y)\n");
    33     return (FALSE);
    34   }   
     38  if (mode == NONE) goto syntax;
     39  if (argc != 2) goto syntax;
    3540
    36   if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
     41  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) goto escape;
    3742  GetCoords (&coords, &buf[0].header);
     43  if (strcmp(&coords.ctype[4], "-WRP")) {
     44    if (MOSAIC == NULL) {
     45      fprintf (stderr, "must supply mosaic for WRP coords\n");
     46      return (FALSE);
     47    }
     48    if ((mosbuffer = SelectBuffer (MOSAIC, OLDBUFFER, TRUE)) == NULL) goto escape;
     49    GetCoords (&moscoords, &mosbuffer[0].header);
     50    RegisterMosaic (&moscoords);
     51  }
    3852 
    39   if (mode == 1) {
     53  if (mode == SKY) {
    4054    XY_to_RD (&R, &D, X, Y, &coords);
    4155    fprintf (stderr, "%10.6f %10.6f\n", R, D);
    4256    set_variable ("RA", R);
    4357    set_variable ("DEC", D);
     58    return (TRUE);
    4459  }
    4560   
    46   if (mode == 2) {
     61  if (mode == PIXEL) {
    4762    RD_to_XY (&X, &Y, R, D, &coords);
    4863    fprintf (stderr, "%7.2f %7.2f\n", X, Y);
    4964    set_variable ("Xc", X);
    5065    set_variable ("Yc", Y);
     66    return (TRUE);
    5167  }
     68  return (FALSE);
    5269
    53   return (TRUE);
    54 
     70 syntax:
     71  fprintf (stderr, "USAGE: coords [buffer] (-c R D) / (-p X Y)\n");
     72  fprintf (stderr, "only one of -p or -c can be used\n");
     73 escape:
     74  if (MOSAIC != NULL) free (MOSAIC);
     75  return (FALSE);
    5576}
  • trunk/Ohana/src/opihi/cmd.astro/drizzle.c

    r2843 r3393  
    11# include "astro.h"
     2
     3/*** needs mosaic astrometry ***/
    24
    35static double XO, XX, XY;
  • trunk/Ohana/src/opihi/dvo/ImageOps.c

    r2598 r3393  
    99  int *subset;
    1010  int N, n, npts;
    11   double r, d, x[4], y[4], Rmin, Rmax, Rmid;
    12   double X[8], Y[8];
     11  double r, d, X, Y, x[4], y[4], Rmin, Rmax, Rmid;
    1312
    1413  if (RegionSelect) {
     
    1615    Rmax = graph[0].coords.crval1 + 182.0;
    1716    Rmid = 0.5*(Rmin + Rmax);
     17    BuildChipMatch (image, Nimage);
    1818  }
    1919
     
    2222    trange = fabs (trange);
    2323  }
    24   status = InPic = TRUE;
     24
    2525  npts = 200;
    2626  ALLOCATE (subset, int, npts);
     
    2929    if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue;
    3030    if (RegionSelect) {
     31      if (!FindMosaicForImage (image, Nimage, i)) continue;
    3132      /* project this image to screen display coords */
    3233      x[0] = 0;           y[0] = 0;
     
    3435      x[2] = image[i].NX; y[2] = image[i].NY;
    3536      x[3] = 0;           y[3] = image[i].NY;
    36       status = FALSE;
    37       flipped = FALSE;
     37      InPic = flipped = FALSE;
    3838      for (j = 0; j < 4; j++) {
    3939        XY_to_RD (&r, &d, x[j], y[j], &image[i].coords);
    40         while ((j == 0) && (r < Rmin)) { flipped = TRUE; r += 360.0; }
    41         while ((j == 0) && (r > Rmax)) { flipped = TRUE; r -= 360.0; }
    42         if ((j > 0) && flipped) {
    43           while (r < Rmid) r+= 360.0;
    44           while (r > Rmid) r-= 360.0;
     40        /* use same side of 0,360 boundary for all corners */
     41        if ((j == 0) && (r < Rmin)) flipped = TRUE;
     42        if ((j == 0) && (r > Rmax)) flipped = TRUE;
     43        while (flipped && (r < Rmid)) r+= 360.0;
     44        while (flipped && (r > Rmid)) r-= 360.0;
     45        status = RD_to_XY (&X, &Y, r, d, &graph[0].coords);
     46
     47        if (!status) continue;
     48        if (X < graph[0].xmin) continue;
     49        if (X > graph[0].xmax) continue;
     50        if (Y < graph[0].ymin) continue;
     51        if (Y > graph[0].ymax) continue;
     52        subset[n] = i;
     53        n++;
     54        if (n > npts - 1) {
     55          npts += 200;
     56          REALLOCATE (subset, int, npts);
    4557        }
    46         status |= RD_to_XY (&X[2*j], &Y[2*j], r, d, &graph[0].coords);
    47         if (j > 0) {
    48           X[2*j - 1] = X[2*j];
    49           Y[2*j - 1] = Y[2*j];
    50         }
     58        break;
    5159      }
    52       X[7] = X[0];
    53       Y[7] = Y[0];
    54       InPic = FALSE;
    55       for (j = 0; status && (j < 8); j+=2) {
    56         if ((X[j] >= graph[0].xmin) &&
    57             (X[j] <= graph[0].xmax) &&
    58             (Y[j] >= graph[0].ymin) &&
    59             (Y[j] <= graph[0].ymax))
    60           InPic = TRUE;
    61       }
    62     }
    63     if (InPic && status) {
    64       subset[n] = i;
    65       n++;
    66       if (n > npts - 1) {
    67         npts += 200;
    68         REALLOCATE (subset, int, npts);
    69       }
     60      /** we miss any images which surround the region.  we are also
     61          missing the DIS images for which the corners don't touch
     62          the region, but which are needed for WRP images with
     63          corners touching the region **/
    7064    }
    7165  }
  • trunk/Ohana/src/opihi/dvo/LoadImages.c

    r2598 r3393  
    1111  VarConfig ("IMAGE_CATALOG", "%s", filename);
    1212
     13  NIMAGE = 0;
     14  Nimage = 0;
     15  image  = NULL;
     16
    1317  /* check if image datafile exists, get header */
    1418  if (!fits_read_header (filename, &header)) {
    1519    fprintf (stderr, "No available image catalog %s (1)\n", filename);
    16     *Nimage = 0;
    17     return ((Image *) NULL);
     20    return (NULL);
     21  }
     22
     23  fits_scan (&header, "NIMAGES", "%d", 1, &NIMAGE);
     24  if (NIMAGE == 0) {
     25    fprintf (stderr, "no images found\n");
     26    return (NULL);
    1827  }
    1928
     
    2332    fprintf (stderr, "No available image catalog: %s (2)\n", filename);
    2433    free (header.buffer);
    25     *Nimage = 0;
    26     return ((Image *) NULL);
    27   }
    28 
    29   NIMAGE = 0;
    30   fits_scan (&header, "NIMAGES", "%d", 1, &NIMAGE);
    31   if (NIMAGE == 0) {
    32     fprintf (stderr, "no images found\n");
    33     *Nimage = NIMAGE;
    34     fclose (f);
    35     return ((Image *) NULL);
     34    return (NULL);
    3635  }
    3736
     
    4645  *Nimage = nimage;
    4746  return (image);
    48 
    49 
    5047}
    51  
  • trunk/Ohana/src/opihi/dvo/avextract.c

    r2598 r3393  
    6262  if ((vec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) goto escape;
    6363
    64   /* need valid code for some params: */
     64  /* Need valid code for some params: */
    6565  switch (param) {
    6666    case AVE_MAG:
     
    8484    regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions);
    8585    if (!SetImageSelection (param, &graphsky, TRUE)) goto escape;
     86    /* this is not really used by avextract -- no parameters require images */
    8687  } else {
    8788    Nregions = 1;
  • trunk/Ohana/src/opihi/dvo/dvomisc.c

    r2598 r3393  
    7070}
    7171
     72/** this does not seem to be used at the moment */
    7273/* values are ave[i].R, ave[i].D, ave[i].M */
    7374void sort_images (Image *image, int N) {
  • trunk/Ohana/src/opihi/dvo/gimages.c

    r2598 r3393  
    7171  if (!str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
    7272
    73   image = LoadImages (&Nimage);
    74   if (Nimage == 0) {
    75     return (FALSE);
    76   }
     73  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
    7774  image_subset (image, Nimage, &subset, &Nsubset, (Graphdata *) NULL, FALSE, tzero, trange, TimeSelect);
     75  BuildChipMatch (image, Nimage);
    7876
    7977  Nfound = 0;
    8078  for (j = 0; j < Nsubset; j++) {
    8179    i = subset[j];
    82     status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords);
    83     if (!status || (X < 0) || (X > image[i].NX) || (Y < 0) || (Y > image[i].NY)) continue;
    84     XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
    85     Mcal = applyMcal (&image[i], 2048.0, 2048.0);
    86     /* t = TimeValue (image[i].tzero, TimeReference, TimeFormat); */
    87     date = sec_to_date (image[i].tzero);
    8880    if (PhotCodeSelect) {
    8981      if ((code[0].type == PHOT_REF) || (code[0].type == PHOT_DEP)) {
     
    9486      }
    9587    }     
     88    if (!FindMosaicForImage (image, Nimage, i)) continue;
     89
     90    status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords);
     91    if (!status) continue;
     92    if (X < 0) continue;
     93    if (Y < 0) continue;
     94    if (X > image[i].NX) continue;
     95    if (Y > image[i].NY) continue;
     96
     97    Mcal = applyMcal (&image[i], 2048.0, 2048.0);
     98    date = sec_to_date (image[i].tzero);
     99
    96100    if (PixelCoords) {
    97101      fprintf (GetOutfile(), "%3d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n",
    98102               Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].source, 0.001*image[i].secz, 0.001*Mcal, 0.001*image[i].dMcal, image[i].exptime, image[i].code);
    99103    } else {
     104      XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
    100105      fprintf (GetOutfile(), "%3d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n",
    101106               Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].source, 0.001*image[i].secz, 0.001*Mcal, 0.001*image[i].dMcal, image[i].exptime, image[i].code);
  • trunk/Ohana/src/opihi/dvo/images.c

    r2598 r3393  
    6868  }
    6969 
    70   image = LoadImages (&Nimage);
    71   if (Nimage == 0) {
    72     return (TRUE);
    73   }
     70  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
     71  BuildChipMatch (image, Nimage);
    7472
    7573  Rmin = graphmode.coords.crval1 - 180.0;
     
    8583    if (ByName && strcmp (name, image[i].name)) continue;
    8684    if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue;
     85    if (!FindMosaicForImage (image, Nimage, i)) continue;
     86
    8787    /* project this image to screen display coords */
    8888    x[0] = 0;           y[0] = 0;
  • trunk/Ohana/src/opihi/dvo/imdata.c

    r2598 r3393  
    44int imdata (int argc, char **argv) {
    55 
    6   int i, j, k;
     6  int i, j, k, I;
    77  int Nimage, N, NPTS, skip, mode, TimeSelect;
    88  int n, Nregion, Ntregion, TimeFormat;
     
    7474  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
    7575
    76   image = LoadImages (&Nimage);
    77   if (Nimage == 0) {
    78     return (FALSE);
    79   }
     76  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
    8077  image_subset (image, Nimage, &subset, &Nsubset, (Graphdata *) NULL, FALSE, tzero, trange, TimeSelect);
     78  BuildChipMatch (image, Nimage);
    8179  GetTimeFormat (&TimeReference, &TimeFormat);
    8280
     
    8583  ALLOCATE (region, GSCRegion, 1);
    8684  for (i = 0; i < Nsubset; i++) {
    87     tregion = get_regions (&image[subset[i]], &Ntregion);
     85    I = subset[i];
     86    if (!FindMosaicForImage (image, Nimage, I)) continue;
     87    tregion = get_regions (&image[I], &Ntregion);
    8888    REALLOCATE (region, GSCRegion, MAX (1, Nregion + Ntregion));
    8989    for (j = 0; j < Ntregion; j++) {
  • trunk/Ohana/src/opihi/dvo/imdense.c

    r2598 r3393  
    2020  if (!GetGraph (&graphmode, NULL, &Ngraph)) return (FALSE);
    2121
    22   image = LoadImages (&Nimage);
    23   if (Nimage == 0) {
    24     return (FALSE);
    25   }
     22  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
     23  BuildChipMatch (image, Nimage);
    2624
    2725  Rmin = graphmode.coords.crval1 - 182.0;
     
    4240    /* project this image to screen display coords */
    4341    status = FALSE;
     42    if (!FindMosaicForImage (image, Nimage, i)) continue;
    4443    XY_to_RD (&r, &d, x, y, &image[i].coords);
    4544    while (r < Rmin) r += 360.0;
  • trunk/Ohana/src/opihi/dvo/imextract.c

    r2598 r3393  
    9797  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
    9898
    99   image = LoadImages (&Nimage);
    100   if (Nimage == 0) {
    101     return (FALSE);
    102   }
     99  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
    103100  image_subset (image, Nimage, &subset, &Nsubset, &graphsky, RegionSelect, tzero, trange, TimeSelect);
     101  if ((mode == RA) || (mode == DEC)) BuildChipMatch (image, Nimage);
    104102
    105103  GetTimeFormat (&TimeReference, &TimeFormat);
     
    123121    switch (mode) {
    124122    case (RA):
     123      if (!FindMosaicForImage (image, Nimage, j)) continue;
    125124      x = 0.5*image[j].NX;
    126125      y = 0.5*image[j].NY;
     
    129128      break;
    130129    case (DEC):
     130      if (!FindMosaicForImage (image, Nimage, j)) continue;
    131131      x = 0.5*image[j].NX;
    132132      y = 0.5*image[j].NY;
  • trunk/Ohana/src/opihi/dvo/imlist.c

    r2598 r3393  
    6464  }
    6565 
    66   image = LoadImages (&Nimage);
    67   if (Nimage == 0) {
    68     return (FALSE);
    69   }
     66  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
    7067  image_subset (image, Nimage, &subset, &Nsubset, &graphmode, RegionSelect, tzero, trange, TimeSelect);
     68  BuildChipMatch (image, Nimage);
    7169
    7270  GetTimeFormat (&TimeReference, &TimeFormat);
     
    8280      }
    8381    }
     82    if (!FindMosaicForImage (image, Nimage, i)) continue;
    8483    t = TimeValue (image[i].tzero, TimeReference, TimeFormat);
    8584    XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
  • trunk/Ohana/src/opihi/dvo/imphot.c

    r2598 r3393  
    5151  fprintf (stderr, "searching in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
    5252 
    53   image = LoadImages (&Nimage);
    54   if (Nimage == 0) {
    55     return (FALSE);
    56   }
     53  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
    5754  image_subset (image, Nimage, &subset, &Nsubset, (Graphdata *) NULL, FALSE, tzero, trange, TRUE);
    5855
  • trunk/Ohana/src/opihi/dvo/imstats.c

    r2598 r3393  
    3535  }
    3636
    37   image = LoadImages (&Nimage);
    38   if (Nimage == 0) {
    39     return (FALSE);
    40   }
     37  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
     38  BuildChipMatch (image, Nimage);
    4139
    4240  /* assign vector values */
     
    5250    else
    5351      Yvec.elements[i] = 0.001*image[i].dMcal;
     52    if (!FindMosaicForImage (image, Nimage, i)) continue;
    5453    XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
    5554    fprintf (stderr, "%d %8.4f %8.4f %10d %6d  %5.3f %6.3f %6.3f\n",
  • trunk/Ohana/src/opihi/dvo/photometry.c

    r2598 r3393  
    268268  }
    269269
    270   image = LoadImages (&Nimage);
    271   if (Nimage == 0) {
    272     return (FALSE);
    273   }
     270  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
     271  BuildChipMatch (image, Nimage);
    274272  image_subset (image, Nimage, &subset, &Nsubset, graphsky, RegionSelect, tzero, (double) tend - tzero, TimeSelect);
    275 
    276273  sort_image_subset (image, subset, Nsubset);
    277274  return (TRUE);
     
    282279  if (image != NULL) free (image);
    283280  if (subset != NULL) free (subset);
     281  image = NULL;
     282  subset = NULL;
    284283  return;
    285284}
     
    487486
    488487    /* assign value */
     488    value = 0;
    489489    switch (param) {
    490490    case MEAS_MAG: /* magnitudes are already determined above */
     
    531531      dec = average[0].D - measure[i].dD / 360000.0;
    532532      m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source);
    533       if (m == -1) {
    534         value = 0.0;
    535         break;
    536       }
     533      if (m == -1) break;
     534      if (!FindMosaicForImage (image, Nimage, m)) break;
    537535      RD_to_XY (&x, &y, ra, dec, &image[m].coords);
    538536      value = x;
     
    542540      dec = average[0].D - measure[i].dD / 360000.0;
    543541      m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source);
    544       if (m == -1) {
    545         value = 0.0;
    546         break;
    547       }
     542      if (m == -1) break;
     543      if (!FindMosaicForImage (image, Nimage, m)) break;
    548544      RD_to_XY (&x, &y, ra, dec, &image[m].coords);
    549545      value = y;
     
    553549      dec = average[0].D - measure[i].dD / 360000.0;
    554550      m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source);
    555       if (m == -1) {
    556         value = 0.0;
    557         break;
    558       }
     551      if (m == -1) break;
     552      /* this should use the mosaic assoicated with the image */
     553      /* the solution here depends on image.coords having crref1,2 set to match the boresite center */
     554      /* XXX set the mosaic.coords to have a unity WRP transformation in which x,y = ra,dec */
    559555      mosaic.crval1 = image[m].coords.crval1;
    560556      mosaic.crval2 = image[m].coords.crval2;
     
    566562      dec = average[0].D - measure[i].dD / 360000.0;
    567563      m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source);
    568       if (m == -1) {
    569         value = 0.0;
    570         break;
    571       }
     564      if (m == -1) break;
     565      /* same comments as above */
    572566      mosaic.crval1 = image[m].coords.crval1;
    573567      mosaic.crval2 = image[m].coords.crval2;
     
    10081002      TESTMEASURE (measure[j]);
    10091003      SETMAG(M2, measure[j], mode[1]);
    1010       if (use_first)
    1011         n = i;
    1012       else
    1013         n = j;
     1004      n = (use_first) ? i : j;
     1005
    10141006      /* assign value */
     1007      value = 0;
    10151008      switch (param) {
    10161009      case MEAS_MAG: /* magnitudes are already determined above */
     
    10571050      dec = average[0].D - measure[n].dD / 360000.0;
    10581051      m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source);
    1059       if (m == -1) {
    1060         value = 0.0;
    1061         break;
    1062       }
     1052      if (m == -1) break;
     1053      if (!FindMosaicForImage (image, Nimage, m)) break;
    10631054      RD_to_XY (&x, &y, ra, dec, &image[m].coords);
    10641055      value = x;
     
    10681059      dec = average[0].D - measure[n].dD / 360000.0;
    10691060      m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source);
    1070       if (m == -1) {
    1071         value = 0.0;
    1072         break;
    1073       }
     1061      if (m == -1) break;
     1062      if (!FindMosaicForImage (image, Nimage, m)) break;
    10741063      RD_to_XY (&x, &y, ra, dec, &image[m].coords);
    10751064      value = y;
     
    10791068      dec = average[0].D - measure[n].dD / 360000.0;
    10801069      m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source);
    1081       if (m == -1) {
    1082         value = 0.0;
    1083         break;
    1084       }
     1070      if (m == -1) break;
    10851071      mosaic.crval1 = image[m].coords.crval1;
    10861072      mosaic.crval2 = image[m].coords.crval2;
     
    10921078      dec = average[0].D - measure[n].dD / 360000.0;
    10931079      m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source);
    1094       if (m == -1) {
    1095         value = 0.0;
    1096         break;
    1097       }
     1080      if (m == -1) break;
    10981081      mosaic.crval1 = image[m].coords.crval1;
    10991082      mosaic.crval2 = image[m].coords.crval2;
  • trunk/Ohana/src/opihi/dvo/subpix.c

    r2598 r3393  
    120120
    121121  /* load all images, extract those touching Ra, Dec */
    122   image = LoadImages (&Nimage);
     122  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
     123  BuildChipMatch (image, Nimage);
     124
    123125  for (i = 0; i < Nimage; i++) {
     126    if (!FindMosaicForImage (image, Nimage, i)) continue;
    124127    status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords);
    125128    if (!status || (X < 0) || (X > image[i].NX) || (Y < 0) || (Y > image[i].NY)) continue;
     
    137140  for (i = 0; i < Nsub; i++) {
    138141    I = index[i];
     142    if (!FindMosaicForImage (image, Nimage, I)) continue;
    139143    Timage = image[I].tzero;
    140144    for (j = 0; j < Nmeasure; j++) {
Note: See TracChangeset for help on using the changeset viewer.