IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39355


Ignore:
Timestamp:
Feb 18, 2016, 4:41:34 PM (10 years ago)
Author:
eugene
Message:

add setgalmodel to setphot

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/uniphot/Makefile

    r39288 r39355  
    7575$(SRC)/update_catalog_setphot.$(ARCH).o \
    7676$(SRC)/update_catalog_setastrom.$(ARCH).o \
     77$(SRC)/update_catalog_setgalmodel.$(ARCH).o \
    7778$(SRC)/repair_catalog_by_objID.$(ARCH).o \
    7879$(SRC)/SetSignals.$(ARCH).o         \
     
    8788$(SRC)/update_catalog_setphot.$(ARCH).o \
    8889$(SRC)/update_catalog_setastrom.$(ARCH).o \
     90$(SRC)/update_catalog_setgalmodel.$(ARCH).o \
    8991$(SRC)/repair_catalog_by_objID.$(ARCH).o \
    9092$(SRC)/initialize_setphot_client.$(ARCH).o \
  • trunk/Ohana/src/uniphot/include/setphot.h

    r39288 r39355  
    6262int          DCR_RESET;
    6363int          CAM_RESET;
     64
     65int          SET_GAL_MODEL;
    6466
    6567int          VERBOSE;
     
    139141int CamAstromCorrectionValue (int chipID, int filter, float Xccd, float Yccd, double *dX, double *dY);
    140142
    141 
     143int           update_catalog_setgalmodel        PROTO((Catalog *catalog));
    142144int           update_catalog_setastrom        PROTO((Catalog *catalog));
  • trunk/Ohana/src/uniphot/src/initialize_setphot.c

    r39288 r39355  
    7878    char *tmpfile = strcreate (argv[N]);
    7979    CAM_PHOTOM_FILE = abspath (tmpfile, DVO_MAX_PATH);
     80    remove_argument (N, &argc, argv);
     81  }
     82
     83  SET_GAL_MODEL = FALSE;
     84  if ((N = get_argument (argc, argv, "-setgalmodel"))) {
     85    SET_GAL_MODEL = TRUE;
    8086    remove_argument (N, &argc, argv);
    8187  }
  • trunk/Ohana/src/uniphot/src/initialize_setphot_client.c

    r39288 r39355  
    6666  }
    6767
     68  // NOTE: I do not need to pass the cam-flat file to the
     69  // setphot clients because the database gets an update to
     70  // CATDIR/flatfield.fits which is loaded by setphot_client
    6871  CAM_PHOTOM_FILE = NULL;
    69 /*
    70   if ((N = get_argument (argc, argv, "-cam-flat"))) {
    71     remove_argument (N, &argc, argv);
    72     char *tmpfile = strcreate (argv[N]);
    73     CAM_PHOTOM_FILE = abspath (tmpfile, DVO_MAX_PATH);
     72
     73  SET_GAL_MODEL = FALSE;
     74  if ((N = get_argument (argc, argv, "-setgalmodel"))) {
     75    SET_GAL_MODEL = TRUE;
    7476    remove_argument (N, &argc, argv);
    7577  }
    76 */
    7778
    7879  VERBOSE = FALSE;
  • trunk/Ohana/src/uniphot/src/update_catalog_setgalmodel.c

    r39225 r39355  
    1313
    1414  CoordTransform *transform = InitTransform (COORD_CELESTIAL, COORD_GALACTIC);
     15
     16  // the typical motions do not vary so much as a function of position, we can use the
     17  // median uR,uD values for all objects without stellar parameters
     18
     19  int Nsave = 0;
     20  ALLOCATE_PTR (uRsave, double, catalog[0].Nstarpar);
     21  ALLOCATE_PTR (uDsave, double, catalog[0].Nstarpar);
    1522
    1623  // first set the proper motion based on Galactic rotation and solar motion
     
    5764    average[i].uRgal = uR;
    5865    average[i].uDgal = uD;
     66
     67    if (Nsave < catalog[0].Nstarpar) {
     68      uRsave[Nsave] = uR;
     69      uDsave[Nsave] = uD;
     70      Nsave ++;
     71    }
    5972  }
     73
     74  // below we attempt to set the uRgal, uDgal values for objects
     75  // without starpar data.  but if we do not have enough information,
     76  // give up and return
     77  if (Nsave < 3) return TRUE;
     78
     79  dsort (uRsave, Nsave);
     80  dsort (uDsave, Nsave);
     81
     82  int Nmid = 0.5*Nsave;
     83  double uRmid = uRsave[Nmid];
     84  double uDmid = uDsave[Nmid];
     85
     86  // set the value for unassigned stars based on the median uR,uD values for this patch
     87  for (i = 0; i < catalog[0].Naverage; i++) {
     88    if (isfinite(average[i].uRgal)) continue;
     89
     90    average[i].uRgal = uRmid;
     91    average[i].uDgal = uDmid;
     92  } 
    6093
    6194  return (TRUE);
  • trunk/Ohana/src/uniphot/src/update_dvo_setphot.c

    r39288 r39355  
    6262      catalog.catflags |= DVO_LOAD_SECFILT;
    6363    }
     64    if (SET_GAL_MODEL) {
     65      catalog.catflags |= DVO_LOAD_STARPAR;
     66    }
    6467    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
    6568
     
    8588    if (KH_FILE || DCR_FILE || CAM_ASTROM_FILE) {
    8689      update_catalog_setastrom (&catalog);
     90    }
     91
     92    if (SET_GAL_MODEL) {
     93      update_catalog_setgalmodel (&catalog);
    8794    }
    8895
     
    166173    if (DCR_FILE)         { strextend (&command, "-DCR %s", DCR_FILE); }
    167174    if (CAM_ASTROM_FILE)  { strextend (&command, "-CAM %s", CAM_ASTROM_FILE); }
     175
     176    if (SET_GAL_MODEL)    { strextend (&command, "-setgalmodel"); }
    168177
    169178    if (KH_RESET)         { strextend (&command, "-KH-reset"); }
Note: See TracChangeset for help on using the changeset viewer.