IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2016, 12:43:41 PM (10 years ago)
Author:
eugene
Message:

add options to tie down relative to Gaia

Location:
branches/czw_branch/20160809/Ohana/src/relastro
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20160809/Ohana/src/relastro/include/relastro.h

    r39731 r39735  
    298298} CheckMeasureResult;
    299299
    300 # define ID_MEAS_OBJECT_HAS_2MASS ID_MEAS_POOR_PHOTOM
     300// # define ID_MEAS_OBJECT_HAS_2MASS ID_MEAS_POOR_PHOTOM
    301301
    302302/* global variables set in parameter file */
     
    420420
    421421float *LoopWeight2MASS;
     422char *LoopWeight2MASSstr;
     423
    422424float *LoopWeightTycho;
    423 char *LoopWeight2MASSstr;
    424425char *LoopWeightTychostr;
     426
     427float *LoopWeightGAIA;
     428char *LoopWeightGAIAstr;
    425429
    426430int ImagSelect;
  • branches/czw_branch/20160809/Ohana/src/relastro/src/GetAstromError.c

    r39457 r39735  
    6969  // to match the 2MASS / Tycho / ICRS reference frame.  As Nloop gets higher, the weight
    7070  // needs to drop to allow the ps1 measurements to drive the solution
     71  int isGAIA   = USE_GALAXY_MODEL && !isImage && (measure[0].photcode == 1030);
    7172  int is2MASS  = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2011) && (measure[0].photcode <= 2013);
    7273  int isTycho  = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2020) && (measure[0].photcode <= 2021);
     74
     75  int hasGAIA  = USE_GALAXY_MODEL &&  isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_GAIA);
    7376  int has2MASS = USE_GALAXY_MODEL &&  isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_2MASS);
     77  int hasTycho = USE_GALAXY_MODEL &&  isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_TYCHO);
    7478
    7579  // modest hack: if the object has 2MASS or Tycho, we set this internal bit and adjust the
     
    7983    dPtotal = dPtotal / LoopWeight2MASS[Nloop];
    8084  }
     85  if (hasGAIA && LoopWeightGAIA && (Nloop >= 0)) {
     86    dPtotal = dPtotal / LoopWeightGAIA[Nloop];
     87  }
     88  if (hasTycho && LoopWeightTycho && (Nloop >= 0)) {
     89    dPtotal = dPtotal / LoopWeightTycho[Nloop];
     90  }
     91
    8192  if (is2MASS && LoopWeight2MASS && (Nloop >= 0)) {
    8293    dPtotal = dPtotal / LoopWeight2MASS[Nloop];
     94  }
     95  if (isGAIA && LoopWeightGAIA && (Nloop >= 0)) {
     96    dPtotal = dPtotal / LoopWeightGAIA[Nloop];
    8397  }
    8498  if (isTycho && LoopWeightTycho && (Nloop >= 0)) {
     
    143157  // to match the 2MASS / Tycho / ICRS reference frame.  As Nloop gets higher, the weight
    144158  // needs to drop to allow the ps1 measurements to drive the solution
     159  int isGAIA   = USE_GALAXY_MODEL && !isImage && (measure[0].photcode == 1030);
    145160  int is2MASS  = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2011) && (measure[0].photcode <= 2013);
    146161  int isTycho  = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2020) && (measure[0].photcode <= 2021);
     162
     163  int hasGAIA  = USE_GALAXY_MODEL &&  isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_GAIA);
    147164  int has2MASS = USE_GALAXY_MODEL &&  isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_2MASS);
     165  int hasTycho = USE_GALAXY_MODEL &&  isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_TYCHO);
    148166
    149167  // modest hack: if the object has 2MASS or Tycho, we set this internal bit and adjust the
     
    153171    dPtotal = dPtotal / LoopWeight2MASS[Nloop];
    154172  }
     173  if (hasGAIA && LoopWeightGAIA && (Nloop >= 0)) {
     174    dPtotal = dPtotal / LoopWeightGAIA[Nloop];
     175  }
     176  if (hasTycho && LoopWeightTycho && (Nloop >= 0)) {
     177    dPtotal = dPtotal / LoopWeightTycho[Nloop];
     178  }
     179
    155180  if (is2MASS && LoopWeight2MASS) {
    156181    dPtotal = dPtotal / LoopWeight2MASS[Nloop];
     182  }
     183  if (isGAIA && LoopWeightGAIA && (Nloop >= 0)) {
     184    dPtotal = dPtotal / LoopWeightGAIA[Nloop];
    157185  }
    158186  if (isTycho && LoopWeightTycho) {
  • branches/czw_branch/20160809/Ohana/src/relastro/src/UpdateObjects.c

    r39731 r39735  
    1111
    1212typedef enum {
    13   SELECT_MEAS_HAS_DATA  = 1,
    14   SELECT_MEAS_HAS_STACK = 2,
    15   SELECT_MEAS_HAS_2MASS = 4,
     13  SELECT_MEAS_HAS_DATA  = 0x01,
     14  SELECT_MEAS_HAS_STACK = 0x02,
     15  SELECT_MEAS_HAS_2MASS = 0x04,
     16  SELECT_MEAS_HAS_GAIA  = 0x08,
     17  SELECT_MEAS_HAS_TYCHO = 0x10,
    1618} SelectMeasureStatus;
    1719
     
    666668
    667669  int has2MASS = FALSE;
     670  int hasGAIA  = FALSE;
     671  int hasTycho = FALSE;
    668672  int hasStack = FALSE;
    669673  if (stackEntry) *stackEntry = -1;
     
    774778    Npoints++;
    775779
    776     if ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013)) {
    777       has2MASS = TRUE;
    778     }
     780    hasGAIA  =  (measure[k].photcode == 1030);
     781    has2MASS = ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013));
     782    hasTycho = ((measure[k].photcode >= 2020) && (measure[k].photcode <= 2021));
    779783
    780784    myAssert (Npoints <= fit->NpointsAlloc, "oops");
     
    796800      measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_2MASS;
    797801    }
     802    if (hasGAIA) {
     803      measure[k].dbFlags |=  ID_MEAS_OBJECT_HAS_GAIA;
     804    } else {
     805      measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_GAIA;
     806    }
     807    if (hasTycho) {
     808      measure[k].dbFlags |=  ID_MEAS_OBJECT_HAS_TYCHO;
     809    } else {
     810      measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_TYCHO;
     811    }
    798812  }
    799813
     
    803817  if (hasStack) status |= SELECT_MEAS_HAS_STACK;
    804818  if (has2MASS) status |= SELECT_MEAS_HAS_2MASS;
     819  if (hasGAIA)  status |= SELECT_MEAS_HAS_GAIA;
     820  if (hasTycho) status |= SELECT_MEAS_HAS_TYCHO;
    805821  return status;
    806822}
  • branches/czw_branch/20160809/Ohana/src/relastro/src/args.c

    r39731 r39735  
    651651  }
    652652  LoopWeightTycho = NULL;
     653  LoopWeightTychostr = NULL;
    653654  if ((N = get_argument (argc, argv, "-loop-weights-tycho"))) {
    654655    remove_argument (N, &argc, argv);
    655656    LoopWeightTychostr = strcreate(argv[N]);
    656657    LoopWeightTycho = ParseLoopWeights (argv[N]);
     658    remove_argument (N, &argc, argv);
     659  }
     660  LoopWeightGAIA = NULL;
     661  LoopWeightGAIAstr = NULL;
     662  if ((N = get_argument (argc, argv, "-loop-weights-gaia"))) {
     663    remove_argument (N, &argc, argv);
     664    LoopWeightGAIAstr = strcreate(argv[N]);
     665    LoopWeightGAIA = ParseLoopWeights (argv[N]);
    657666    remove_argument (N, &argc, argv);
    658667  }
     
    674683  FREE (LoopWeight2MASSstr);
    675684  FREE (LoopWeightTychostr);
     685  FREE (LoopWeightGAIAstr);
    676686
    677687  FREE (PHOTCODE_SKIP_LIST);
  • branches/czw_branch/20160809/Ohana/src/relastro/src/launch_region_hosts.c

    r39731 r39735  
    139139    if (LoopWeight2MASS) {  strextend (&command, "-loop-weights-2mass %s", LoopWeight2MASSstr); }
    140140    if (LoopWeightTycho) {  strextend (&command, "-loop-weights-tycho %s", LoopWeightTychostr); }
     141    if (LoopWeightGAIA)  {  strextend (&command, "-loop-weights-gaia %s", LoopWeightGAIAstr); }
    141142    if (APPLY_PROPER_MOTION) strextend (&command, "-apply-proper-motion");
    142143
Note: See TracChangeset for help on using the changeset viewer.