IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19897


Ignore:
Timestamp:
Oct 4, 2008, 6:13:08 AM (18 years ago)
Author:
eugene
Message:

working on grid for non-mosaic

Location:
trunk/Ohana/src/relphot
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relphot/doc/notes.txt

    r9633 r19897  
     1
     22008.09.20
     3
     4  I am working on the flat-field correction analysis.  This is
     5  currently triggered by the -grid flag.  This analysis needs to
     6  require a single camera.
     7
     8  * need to define the relationship between image and ccdnum
     9    (currently it uses as regex, effectively, to match the ccdnum to
     10    the number portion of the photcode).  make an explicit entry in
     11    the dvo.config table.
     12   
     13  * clean up the output files (make the output files have names
     14    supplied by the user, etc)
     15
     16  * I use the string MOSAICNAME to determine the relationship between
     17    chips.  this allows me to do the relphot grid process on mosaic
     18    images for which I don't have bilevel astrometry, but where we do,
     19    we could link the mosaic together via the mosaic reference image.
     20    Maybe this is a future upgrade.
     21
     22  * I think mosaic name can be replaced with camera name: we need to
     23    supply CAMERA in any case, and the photcodes have names of the
     24    form CAMERA.XXX.  This is all very ad hoc, but can be effective
     25    for the near term. 
    126
    2272006.10.17
  • trunk/Ohana/src/relphot/include/relphot.h

    r17419 r19897  
    6060
    6161int    VERBOSE;
     62int    MOSAIC_ZEROPT;
    6263
    6364int    NLOOP;
  • trunk/Ohana/src/relphot/src/ConfigInit.c

    r12332 r19897  
    5050  GetConfig (config, "RELPHOT_GRID_BINNING",   "%d",  0, &RELPHOT_GRID_BINNING);
    5151  GetConfig (config, "CAMERA_CONFIG",          "%s",  0, CameraConfig);
     52  GetConfig (config, "MOSAICNAME",             "%s",  0, MOSAICNAME);
    5253
    5354  if (*CATMODE == 0) strcpy (CATMODE, "RAW");
  • trunk/Ohana/src/relphot/src/ImageOps.c

    r17201 r19897  
    6767  free (mlist);
    6868}
     69
     70/* **** use this to mimic the Mosaic version ***/
     71# if (0)
     72void initImageGrid (Image *image, int Nimage) {
     73
     74  /* find max dR, dD range for all mosaics */
     75  /* define mosaic.coords to cover dR, dD */
     76  /* send results to initGridBins */
     77
     78  int i, j, m, NX, NY;
     79  int dXmax, dYmax;
     80  double dS, dX, dY;
     81  double R, D, Rmin, Rmax, Dmin, Dmax;
     82  double Mcal, dMcal, Xm;
     83
     84  dXmax = dYmax = 0.0;
     85  for (i = 0; i < Nmosaic; i++) {
     86    Dmin = Rmin =  360.0;
     87    Dmax = Rmax = -360.0;
     88    dS = 0.0;
     89    Mcal = dMcal = Xm = 0;
     90    for (j = 0; j < Nimlist[i]; j++) {
     91      m = imlist[i][j];
     92      NX = image[m].NX;
     93      NY = image[m].NY;
     94      dS += hypot (image[m].coords.cdelt1*image[m].coords.pc1_1, image[m].coords.cdelt1*image[m].coords.pc2_1);
     95      XY_to_RD (&R, &D, 0.0, 0.0, &image[m].coords);
     96      Rmin = MIN (Rmin, R);
     97      Rmax = MAX (Rmax, R);
     98      Dmin = MIN (Dmin, D);
     99      Dmax = MAX (Dmax, D);
     100      XY_to_RD (&R, &D, (double) NX, 0.0, &image[m].coords);
     101      Rmin = MIN (Rmin, R);
     102      Rmax = MAX (Rmax, R);
     103      Dmin = MIN (Dmin, D);
     104      Dmax = MAX (Dmax, D);
     105      XY_to_RD (&R, &D, (double) NX, (double) NY, &image[m].coords);
     106      Rmin = MIN (Rmin, R);
     107      Rmax = MAX (Rmax, R);
     108      Dmin = MIN (Dmin, D);
     109      Dmax = MAX (Dmax, D);
     110      XY_to_RD (&R, &D, 0.0, (double) NY, &image[m].coords);
     111      Rmin = MIN (Rmin, R);
     112      Rmax = MAX (Rmax, R);
     113      Dmin = MIN (Dmin, D);
     114      Dmax = MAX (Dmax, D);
     115      Mcal  += image[m].Mcal;
     116      dMcal += image[m].dMcal;
     117      Xm    += image[m].Xm;
     118      /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */
     119      image[m].Mcal  = 0.0;
     120      image[m].dMcal = NAN;
     121      image[m].Xm    = NAN_S_SHORT;
     122    }
     123    dS /= Nimlist[i];
     124    strcpy (mosaic[i].coords.ctype, "RA---TAN");
     125    mosaic[i].coords.crval1 = Rmin;
     126    mosaic[i].coords.crval2 = Dmin;
     127    mosaic[i].coords.crpix1 = 0.0;
     128    mosaic[i].coords.crpix2 = 0.0;
     129    mosaic[i].coords.cdelt1 = dS;
     130    mosaic[i].coords.cdelt2 = dS;
     131    mosaic[i].coords.pc1_1  = 1.0;
     132    mosaic[i].coords.pc2_2  = 1.0;
     133    mosaic[i].coords.pc1_2  = 0.0;
     134    mosaic[i].coords.pc2_1  = 0.0;
     135    RD_to_XY (&dX, &dY, Rmax, Dmax, &mosaic[i].coords);
     136
     137    mosaic[i].Mcal  = Mcal / Nimlist[i];
     138    mosaic[i].dMcal = dMcal / Nimlist[i];
     139    mosaic[i].Xm    = Xm / Nimlist[i];
     140  }
     141  if (!USE_GRID) return;
     142
     143  dXmax = MAX (dXmax, dX);
     144  dYmax = MAX (dYmax, dY);
     145  initGrid (dXmax, dYmax);
     146  return;
     147}
     148# endif
    69149
    70150/* select all image equivalent to the current photcode */
  • trunk/Ohana/src/relphot/src/MosaicOps.c

    r17201 r19897  
    2222  char *pname;
    2323
    24   if (!MOSAICNAME[0]) return;
     24  if (!MOSAIC_ZEROPT) return;
    2525
    2626  Nmosaic = 0;
     
    173173  Image *image;
    174174
    175   if (!MOSAICNAME[0]) return;
     175  if (!MOSAIC_ZEROPT) return;
    176176
    177177  image = getimages (&Nimage);
     
    194194
    195195  /* measure -> mosaic */
    196   if (!MOSAICNAME[0]) return;
     196  if (!MOSAIC_ZEROPT) return;
     197
    197198  ALLOCATE (bin, int *, Ncatalog);
    198199  for (i = 0; i < Ncatalog; i++) {
     
    220221
    221222  /* measure -> mosaic */
    222   if (!MOSAICNAME[0]) return;
     223  if (!MOSAIC_ZEROPT) return;
     224
    223225  for (i = 0; i < Ncatalog; i++) {
    224226    free (bin[i]);
     
    241243  int i, j, ecode;
    242244
    243   if (!MOSAICNAME[0]) return (FALSE);
     245  if (!MOSAIC_ZEROPT) return (FALSE);
     246
    244247  for (i = 0; i < Ncatalog; i++) {
    245248    for (j = 0; j < catalog[i].Nmeasure; j++) {
     
    298301  float value;
    299302
    300   if (!MOSAICNAME[0]) return (0);
     303  if (!MOSAIC_ZEROPT) return (0);
     304
    301305  i = bin[cat][meas];
    302306  if (i == -1) return (NAN);
     
    315319  Image *image;
    316320
    317   if (!MOSAICNAME[0]) return (FALSE);
     321  if (!MOSAIC_ZEROPT) return (FALSE);
    318322
    319323  image = getimages (&N);
     
    401405
    402406  bzero (&stats, sizeof (StatType));
    403   if (!MOSAICNAME[0]) return (stats);
     407  if (!MOSAIC_ZEROPT) return (stats);
    404408
    405409  ALLOCATE (list, double, Nmosaic);
     
    427431
    428432  bzero (&stats, sizeof (StatType));
    429   if (!MOSAICNAME[0]) return (stats);
     433  if (!MOSAIC_ZEROPT) return (stats);
    430434
    431435  ALLOCATE (list, double, Nmosaic);
     
    455459
    456460  bzero (&stats, sizeof (StatType));
    457   if (!MOSAICNAME[0]) return (stats);
     461  if (!MOSAIC_ZEROPT) return (stats);
    458462
    459463  ALLOCATE (list, double, Nmosaic);
     
    497501
    498502  bzero (&stats, sizeof (StatType));
    499   if (!MOSAICNAME[0]) return (stats);
     503  if (!MOSAIC_ZEROPT) return (stats);
    500504
    501505  ALLOCATE (list, double, Nmosaic);
     
    525529  StatType stats;
    526530
    527   if (!MOSAICNAME[0]) return;
     531  if (!MOSAIC_ZEROPT) return;
    528532
    529533  if (VERBOSE) fprintf (stderr, "marking poor mosaics\n");
     
    576580  Graphdata graphdata;
    577581
    578   if (!MOSAICNAME[0]) return;
     582  if (!MOSAIC_ZEROPT) return;
    579583
    580584  image = getimages (&Nimage);
     
    619623  Graphdata graphdata;
    620624
    621   if (!MOSAICNAME[0]) return;
     625  if (!MOSAIC_ZEROPT) return;
    622626
    623627  ALLOCATE (xlist, double, Nmosaic);
  • trunk/Ohana/src/relphot/src/args.c

    r17242 r19897  
    117117  }
    118118
    119   /* group images by mosaic, find Mmos */
    120   MOSAICNAME[0] = 0;
     119  /* XXX this argument used to do two things: specify the camera name and tell the analysis to
     120     calculate a common zero point for a single mosaic.  I've moved the MOSAICNAME concept into the
     121     config system, but need to use this argument to specify that the mosaic zeropoints should be
     122     calculated. */
     123  MOSAIC_ZEROPT = FALSE;
    121124  if ((N = get_argument (argc, argv, "-mosaic"))) {
    122125    remove_argument (N, &argc, argv);
    123     strcpy (MOSAICNAME, argv[N]);
    124     remove_argument (N, &argc, argv);
     126    MOSAIC_ZEROPT = TRUE;
    125127  }
    126128
     
    135137    remove_argument (N, &argc, argv);
    136138    USE_GRID = TRUE;
    137     if (!MOSAICNAME[0]) {
    138       fprintf (stderr, "-grid is only valid with -mosaic\n");
    139       exit (2);
    140     }
    141139  }
    142140
Note: See TracChangeset for help on using the changeset viewer.