IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40414 for trunk


Ignore:
Timestamp:
May 1, 2018, 4:28:02 PM (8 years ago)
Author:
eugene
Message:

update objects after stack fit

Location:
trunk/Ohana/src/relastro
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relastro/include/relastro.h

    r40382 r40414  
    3333typedef enum {OP_NONE, OP_IMAGES, OP_HIGH_SPEED, OP_MERGE_SOURCE, OP_UPDATE_OBJECTS, OP_UPDATE_OFFSETS, OP_LOAD_OBJECTS, OP_HPM, OP_PARALLEL_REGIONS, OP_PARALLEL_IMAGES, OP_REPAIR_STACKS, OP_REPAIR_WARPS, OP_REPAIR_OBJECT_ID} RelastroOp;
    3434
    35 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, SET_CHIPS, TARGET_MOSAICS} FitTarget;
     35typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, SET_CHIPS, SET_STACKS, TARGET_MOSAICS} FitTarget;
    3636
    3737typedef enum {
  • trunk/Ohana/src/relastro/src/BrightCatalog.c

    r40291 r40414  
    364364    gfits_define_bintable_column (&theader, "D", "DEC",      "dec",                        "degrees", 1.0, 0.0);
    365365    gfits_define_bintable_column (&theader, "E", "MAG_SYS",  "magnitude (sys)",             NULL,    1.0, 0.0);
    366     gfits_define_bintable_column (&theader, "E", "MAG_CAL",  "magnitude (cal)",             NULL,    1.0, 0.0);
     366    gfits_define_bintable_column (&theader, "E", "MCAL_PSF", "magnitude (cal)",             NULL,    1.0, 0.0);
     367    gfits_define_bintable_column (&theader, "E", "MCAL_APER","magnitude (cal)",             NULL,    1.0, 0.0);
    367368    gfits_define_bintable_column (&theader, "E", "MAG_ERR",  "magnitude (err)",             NULL,    1.0, 0.0);
    368369    gfits_define_bintable_column (&theader, "E", "AIRMASS",  "airmass",                     NULL,    1.0, 0.0);
  • trunk/Ohana/src/relastro/src/UpdateMeasures.c

    r40291 r40414  
    4747      }
    4848
    49       off_t im = getImageByID (measureT->imageID);
     49      Average *average = &catalog[i].average[measureB->averef];
     50      int FOUND_TEST = FALSE;
     51      FOUND_TEST |= (average[0].objID == OBJ_ID_SRC) && (average[0].catID == CAT_ID_SRC);
     52      FOUND_TEST |= (average[0].objID == OBJ_ID_DST) && (average[0].catID == CAT_ID_DST);
     53      if (FOUND_TEST) {
     54        fprintf (stderr, "found test object\n");
     55      }
     56
     57      // we need this below but cannot declare it after the label update_this_measure:
     58      off_t im;
     59
     60      // we have a few options to include/exclude specific types of measurements
     61      if (UPDATE_ALL_MEASURE) goto update_this_measure;
     62      if (isGPC1chip (measureT->photcode)  && UPDATE_PS1_CHIP_MEASURE) goto update_this_measure;
     63      if (isGPC1stack (measureT->photcode) && UPDATE_PS1_STACK_MEASURE) goto update_this_measure;
     64      if (isHSCchip (measureT->photcode)   && UPDATE_HSC_MEASURE) goto update_this_measure;
     65      if (isCFHchip (measureT->photcode)   && UPDATE_CFH_MEASURE) goto update_this_measure;
     66      continue; // skip all others
     67
     68      update_this_measure:
     69      im = getImageByID (measureT->imageID);
    5070      if (im < 0) continue; // detections without imageIDs are not associated with a known image (eg, refs)
    5171
     
    114134      }
    115135
    116       // XXX this stuff is rather hackish, added to do GSC/HSC/Megacam astrometry
    117 
    118       // only modify the chip coordinates
    119       if (UPDATE_ALL_MEASURE) {
    120         measureT->R = R;
    121         measureT->D = D;
    122         if (measureB) {
    123           measureB->R = R;
    124           measureB->D = D;
    125         }
    126         goto set_measure_done;
     136      // modify the measure coordinates
     137      measureT->R = R;
     138      measureT->D = D;
     139      if (measureB) {
     140        measureB->R = R;
     141        measureB->D = D;
    127142      }
    128       // only modify the chip coordinates
    129       if (UPDATE_PS1_STACK_MEASURE && isGPC1stack (measureT->photcode)) {
    130         measureT->R = R;
    131         measureT->D = D;
    132         if (measureB) {
    133           measureB->R = R;
    134           measureB->D = D;
    135         }
    136         goto set_measure_done;
    137       }
    138       // only modify the chip coordinates
    139       if (UPDATE_PS1_CHIP_MEASURE && isGPC1chip (measureT->photcode)) {
    140         measureT->R = R;
    141         measureT->D = D;
    142         if (measureB) {
    143           measureB->R = R;
    144           measureB->D = D;
    145         }
    146         goto set_measure_done;
    147       }
    148       // only modify the chip coordinates
    149       if (UPDATE_HSC_MEASURE && isHSCchip (measureT->photcode)) {
    150         measureT->R = R;
    151         measureT->D = D;
    152         if (measureB) {
    153           measureB->R = R;
    154           measureB->D = D;
    155         }
    156         goto set_measure_done;
    157       }
    158       // only modify the chip coordinates
    159       if (UPDATE_CFH_MEASURE && isCFHchip (measureT->photcode)) {
    160         measureT->R = R;
    161         measureT->D = D;
    162         if (measureB) {
    163           measureB->R = R;
    164           measureB->D = D;
    165         }
    166         goto set_measure_done;
    167       }
    168     set_measure_done:
    169       continue; // XXX this line is needed only to support the label above
    170143    }
    171144    if (VERBOSE) fprintf (stderr, "%s : Noff ori RA %d ( %d %d %d ), Noff ori DEC %d ( %d %d %d )\n", catalog[i].filename, NoffRAori, NoffRAchip, NoffRAstack, NoffRAwarp, NoffDECori, NoffDECchip, NoffDECstack, NoffDECwarp);
  • trunk/Ohana/src/relastro/src/UpdateObjects.c

    r39926 r40414  
    127127  int k;
    128128
     129  // we need to chose to do something here...
     130  int valid = UPDATE_ALL_MEASURE;
     131  valid |= UPDATE_PS1_CHIP_MEASURE;
     132  valid |= UPDATE_HSC_MEASURE;
     133  valid |= UPDATE_CFH_MEASURE;
     134  if (!valid) return FALSE;
     135
    129136  /* calculate the average value of R,D for a single star */
    130 
    131137  FitAstromResult fitPos, fitPM, fitPar;
    132138  FitAstromResultInit (&fitPos);
     
    583589  int status;
    584590
     591  // we need to chose to do something here...
     592  if (!UPDATE_PS1_STACK_MEASURE) return FALSE;
     593
    585594  // set the default values
    586595  average[0].Rstk  = NAN; // RA in degrees
     
    794803    Npoints++;
    795804
     805    // NOTE: if 'isStack' is true, we will never see these photcode values
    796806    hasGAIA  =  (measure[k].photcode == 1030);
    797807    has2MASS = ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013));
     
    808818  }
    809819 
    810   // XXX flag measurements from stars with 2MASS
    811   for (k = 0; k < average[0].Nmeasure; k++) {
    812     // reset the bit to note that a detection was used (or not)
     820  // flag measurements from stars with 2MASS, GAIA, TYCHO
     821  // NOTE: if 'isStack' is TRUE, these will not be correctly set.
     822  // ONLY do this loop if not(isStack)
     823  for (k = 0; !isStack && (k < average[0].Nmeasure); k++) {
     824    // reset the bit to note that an object does or does not have the value
    813825    if (has2MASS) {
    814826      measure[k].dbFlags |=  ID_MEAS_OBJECT_HAS_2MASS;
  • trunk/Ohana/src/relastro/src/UpdateStacksWithFit.c

    r40382 r40414  
    7373    // are all automatically updated in this block because they are re-generated from
    7474    // image.coords on each pass.
    75     setImageRaw (catalog, Ncatalog, i, raw, Nraw, MODE_MOSAIC);
     75    setImageRaw (catalog, Ncatalog, i, raw, Nraw, MODE_SIMPLE);
    7676
    7777    NnewFit ++;
  • trunk/Ohana/src/relastro/src/args.c

    r40382 r40414  
    6868  }
    6969
     70  // the default is to only measure the scatter for the stacks, not to perform a new fit
     71  FIT_STACKS = FALSE;
     72  if ((N = get_argument (argc, argv, "-fit-stacks"))) {
     73    remove_argument (N, &argc, argv);
     74    FIT_STACKS = TRUE;
     75  }
     76
    7077  REPAIR_STACKS = FALSE;
    7178  if ((N = get_argument (argc, argv, "-repair-stacks-on-update"))) {
     
    189196    }
    190197  }
    191   if ((RELASTRO_OP == OP_PARALLEL_IMAGES) || (RELASTRO_OP == OP_IMAGES)) {
     198  if (RELASTRO_OP == OP_UPDATE_OBJECTS) {
     199    if (!UPDATE_ALL_MEASURE && !UPDATE_PS1_STACK_MEASURE && !UPDATE_PS1_CHIP_MEASURE && !UPDATE_HSC_MEASURE && !UPDATE_CFH_MEASURE) {
     200      fprintf (stderr, "for -update-objects, need to select at least one of -update-all-cameras, -update-ps1-stack, -update-ps1-chip, -update-hsc, -update-cfh\n");
     201      exit (2);
     202    }
     203  }
     204  if ((RELASTRO_OP == OP_PARALLEL_REGIONS) || (RELASTRO_OP == OP_PARALLEL_IMAGES) || (RELASTRO_OP == OP_IMAGES)) {
    192205    if (APPLY_OFFSETS && !UPDATE_ALL_MEASURE && !UPDATE_PS1_STACK_MEASURE && !UPDATE_PS1_CHIP_MEASURE && !UPDATE_HSC_MEASURE && !UPDATE_CFH_MEASURE) {
    193206      fprintf (stderr, "for [-images or -parallel-images] with -apply-offsets, need to select at least one of -update-ps1-stack, -update-ps1-chip, -update-hsc, -update-cfh\n");
     
    305318    remove_argument (N, &argc, argv);
    306319    FIT_TARGET = SET_CHIPS;
     320  }
     321  if ((N = get_argument (argc, argv, "-set-stacks"))) {
     322    remove_argument (N, &argc, argv);
     323    FIT_TARGET = SET_STACKS;
    307324  }
    308325
  • trunk/Ohana/src/relastro/src/launch_region_hosts.c

    r39926 r40414  
    117117        strextend (&command, "-set-chips");
    118118        break;
     119      case SET_STACKS:
     120        strextend (&command, "-set-stacks");
     121        break;
    119122      case TARGET_NONE:
    120123        abort();
     
    151154    if (SKIP_CFH)            strextend (&command, "-skip-cfh");
    152155
     156    if (FIT_STACKS)          strextend (&command, "-fit-stacks");
     157
    153158    strextend (&command, "-nloop %d", NLOOP);
    154159    strextend (&command, "-threads %d", NTHREADS);
  • trunk/Ohana/src/relastro/src/relastro_images.c

    r40382 r40414  
    104104      UpdateChips (catalog, Ncatalog, 0);   // measure.X,Y -> R,D, fit image.coords
    105105      MARKTIME("update chips: %f sec\n", dtime);
    106 
     106      break;
     107
     108    case SET_STACKS:
     109      // we just want to fit the selected stacks to the mean positions
     110      if (FIT_STACKS) {
     111        // model astrometry for stacks
     112        UpdateStacksWithFit (catalog, Ncatalog);
     113      } else {
     114        // measure scatter for stacks
     115        UpdateStacks (catalog, Ncatalog);
     116      }
     117      MARKTIME("update stacks : %f sec\n", dtime);
    107118      break;
    108119
  • trunk/Ohana/src/relastro/src/relastro_parallel_images.c

    r40382 r40414  
    163163      break;
    164164
     165    case SET_STACKS:
     166      // we just want to fit the selected stacks to the mean positions
     167      share_mean_pos (catalog, Ncatalog, regionHosts, 0);
     168      slurp_mean_pos (catalog, Ncatalog, regionHosts, 0);
     169      if (FIT_STACKS) {
     170        // model astrometry for stacks
     171        UpdateStacksWithFit (catalog, Ncatalog);
     172      } else {
     173        // measure scatter for stacks
     174        UpdateStacks (catalog, Ncatalog);
     175      }
     176      share_image_pos (regionHosts, 0);
     177      slurp_image_pos (catalog, Ncatalog, regionHosts, 0);
     178      MARKTIME("update stacks : %f sec\n", dtime);
     179      break;
     180
    165181    case TARGET_MOSAICS:
    166182      for (i = 0; i < NLOOP; i++) {
  • trunk/Ohana/src/relastro/src/select_images.c

    r39926 r40414  
    114114    }
    115115    if (FALSE && !strncmp(timage[i].name, "o6227g0311o", 10)) {
     116      fprintf (stderr, "test image 2\n");
     117    }
     118
     119    // RINGS.V3.skycell.2634.034.stk.3411510.skycal.3811673.cmf[SkyChip.hdr]
     120    if (!strncmp(timage[i].name, "RINGS.V3.skycell.2634.034.stk.3411510", strlen("RINGS.V3.skycell.2634.034.stk.3411510"))) {
    116121      fprintf (stderr, "test image 2\n");
    117122    }
Note: See TracChangeset for help on using the changeset viewer.