IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40805 for trunk/Ohana


Ignore:
Timestamp:
Jun 20, 2019, 10:22:42 AM (7 years ago)
Author:
eugene
Message:

add option to retain average photometry on merge

Location:
trunk/Ohana/src/dvomerge
Files:
4 edited

Legend:

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

    r40735 r40805  
    3131int    IMAGES_ONLY;
    3232int    ACCEPT_MOTION;
     33int    RETAIN_AVE_PHOTOMETRY;
    3334char   CATDIR[DVO_MAX_PATH];
    3435char   GSCFILE[DVO_MAX_PATH];
  • trunk/Ohana/src/dvomerge/src/args.c

    r40735 r40805  
    117117    remove_argument (N, argc, argv);
    118118    ACCEPT_MOTION = TRUE;
     119  }
     120
     121  /* limit the impact of a dvomerge -parallel */
     122  RETAIN_AVE_PHOTOMETRY = FALSE;
     123  if ((N = get_argument (*argc, argv, "-retain-ave-photometry"))) {
     124    remove_argument (N, argc, argv);
     125    RETAIN_AVE_PHOTOMETRY = TRUE;
     126    remove_argument (N, argc, argv);
    119127  }
    120128
     
    336344  }
    337345
     346  /* limit the impact of a dvomerge -parallel */
     347  RETAIN_AVE_PHOTOMETRY = FALSE;
     348  if ((N = get_argument (*argc, argv, "-retain-ave-photometry"))) {
     349    remove_argument (N, argc, argv);
     350    RETAIN_AVE_PHOTOMETRY = TRUE;
     351    remove_argument (N, argc, argv);
     352  }
     353
    338354  /* extra error messages */
    339355  MATCHED_TABLES = FALSE;
  • trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c

    r40735 r40805  
    320320               UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS);
    321321
    322     if (VERBOSE)             { strextend (&command, "-v"); }
    323     if (VERIFY)              { strextend (&command, "-verify"); }
    324     if (VERIFY_CATALOG_ONLY) { strextend (&command, "-verify-catalogs"); }
    325     if (REPLACE_BY_PHOTCODE) { strextend (&command, "-replace"); }
    326     if (REPLACE_TYCHO)       { strextend (&command, "-replace-tycho"); }
    327     if (PARALLEL_INPUT)      { strextend (&command, "-parallel-input"); }
    328     if (FORCE_MERGE)         { strextend (&command, "-force-merge"); }
    329     if (ACCEPT_MOTION)       { strextend (&command, "-accept-motion"); }
    330     if (MATCHED_TABLES)      { strextend (&command, "-matched-tables"); }
    331     if (MATCH_BY_EXTERN_ID)  { strextend (&command, "-match-by-extern-id"); }
    332     if (ONLY_MATCHES)        { strextend (&command, "-only-matches"); }
    333     if (UPDATE_CATFORMAT)    { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
    334     if (UPDATE_CATCOMPRESS)  { strextend (&command, "-update-catcompress %s", UPDATE_CATCOMPRESS); }
    335     if (REPAIR_BY_OBJID)     { strextend (&command, "-repair-by-objid"); }
     322    if (VERBOSE)               { strextend (&command, "-v"); }
     323    if (VERIFY)                { strextend (&command, "-verify"); }
     324    if (VERIFY_CATALOG_ONLY)   { strextend (&command, "-verify-catalogs"); }
     325    if (REPLACE_BY_PHOTCODE)   { strextend (&command, "-replace"); }
     326    if (REPLACE_TYCHO)         { strextend (&command, "-replace-tycho"); }
     327    if (PARALLEL_INPUT)        { strextend (&command, "-parallel-input"); }
     328    if (FORCE_MERGE)           { strextend (&command, "-force-merge"); }
     329    if (ACCEPT_MOTION)         { strextend (&command, "-accept-motion"); }
     330    if (RETAIN_AVE_PHOTOMETRY) { strextend (&command, "-retain-ave-photometry"); }
     331    if (MATCHED_TABLES)        { strextend (&command, "-matched-tables"); }
     332    if (MATCH_BY_EXTERN_ID)    { strextend (&command, "-match-by-extern-id"); }
     333    if (ONLY_MATCHES)          { strextend (&command, "-only-matches"); }
     334    if (UPDATE_CATFORMAT)      { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
     335    if (UPDATE_CATCOMPRESS)    { strextend (&command, "-update-catcompress %s", UPDATE_CATCOMPRESS); }
     336    if (REPAIR_BY_OBJID)       { strextend (&command, "-repair-by-objid"); }
    336337
    337338    if (SKIP_MEASURE)               { strextend (&command, "-skip-measure"); }
  • trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c

    r40574 r40805  
    11# include "dvomerge.h"
    22# define PSPS_ID TRUE
     3# define D_ITEM 100000
    34
    45# define IN_REGION(R,D) (                                       \
     
    187188    /* make sure there is space for next Nmeasure entries */
    188189    if (Nmeasure + input[0].average[N].Nmeasure >= NMEASURE) {
    189       NMEASURE = Nmeasure + input[0].average[N].Nmeasure + 1000;
     190      NMEASURE = Nmeasure + input[0].average[N].Nmeasure + D_ITEM;
    190191      REALLOCATE (next_measure, off_t, NMEASURE);
    191192      REALLOCATE (output[0].measure, Measure, NMEASURE);
    192193    }
    193194    if (Nlensing + input[0].average[N].Nlensing >= NLENSING) {
    194       NLENSING = Nlensing + input[0].average[N].Nlensing + 1000;
     195      NLENSING = Nlensing + input[0].average[N].Nlensing + D_ITEM;
    195196      REALLOCATE (next_lensing, off_t, NLENSING);
    196197      REALLOCATE (output[0].lensing, Lensing, NLENSING);
    197198    }
    198199    if (Nlensobj + input[0].average[N].Nlensobj >= NLENSOBJ) {
    199       NLENSOBJ = Nlensobj + input[0].average[N].Nlensobj + 1000;
     200      NLENSOBJ = Nlensobj + input[0].average[N].Nlensobj + D_ITEM;
    200201      REALLOCATE (next_lensobj, off_t, NLENSOBJ);
    201202      REALLOCATE (output[0].lensobj, Lensobj, NLENSOBJ);
    202203    }
    203204    if (Nstarpar + input[0].average[N].Nstarpar >= NSTARPAR) {
    204       NSTARPAR = Nstarpar + input[0].average[N].Nstarpar + 1000;
     205      NSTARPAR = Nstarpar + input[0].average[N].Nstarpar + D_ITEM;
    205206      REALLOCATE (next_starpar, off_t, NSTARPAR);
    206207      REALLOCATE (output[0].starpar, StarPar, NSTARPAR);
    207208    }
    208209    if (Ngalphot + input[0].average[N].Ngalphot >= NGALPHOT) {
    209       NGALPHOT = Ngalphot + input[0].average[N].Ngalphot + 1000;
     210      NGALPHOT = Ngalphot + input[0].average[N].Ngalphot + D_ITEM;
    210211      REALLOCATE (next_galphot, off_t, NGALPHOT);
    211212      REALLOCATE (output[0].galphot, GalPhot, NGALPHOT);
     
    363364
    364365    // update the average properties to reflect the incoming entries:
    365     // if the original value is NAN but the input value is not, accept the input:
     366    // if RETAIN_AVE_PHOTOMETRY is true and the original value is NAN, but the input value is not, accept the input:
     367    // if RETAIN_AVE_PHOTOMETRY is false and the input value is not NAN, accept the input
     368    // if RETAIN_AVE_PHOTOMETRY is true and the original value is not NAN, the keep the existing average photometry
     369   
    366370    if (!secfiltMap) {
    367371      // secfilt tables of input and output are the same
    368372      for (k = 0; k < NsecfiltIn; k++) {
    369         if ( isfinite(output[0].secfilt[n*NsecfiltIn+k].MpsfChp)) continue;
     373        if (RETAIN_AVE_PHOTOMETRY && isfinite(output[0].secfilt[n*NsecfiltIn+k].MpsfChp)) continue;
    370374        if (!isfinite( input[0].secfilt[N*NsecfiltIn+k].MpsfChp)) continue;
    371375        output[0].secfilt[n*NsecfiltIn+k] = input[0].secfilt[N*NsecfiltIn+k];
     
    378382        int outputIndex = n * NsecfiltOut + secfiltMap[k];
    379383       
    380         if ( isfinite(output[0].secfilt[outputIndex].MpsfChp)) continue;
     384        if (RETAIN_AVE_PHOTOMETRY && isfinite(output[0].secfilt[outputIndex].MpsfChp)) continue;
    381385        if (!isfinite( input[0].secfilt[N*NsecfiltIn+k].MpsfChp)) continue;
    382386        output[0].secfilt[outputIndex] = input[0].secfilt[N*NsecfiltIn+k];
     
    411415    /* make sure there is space for next entry */
    412416    if (Nmeasure + input[0].average[N].Nmeasure >= NMEASURE) {
    413       NMEASURE = Nmeasure + input[0].average[N].Nmeasure + 1000;
     417      NMEASURE = Nmeasure + input[0].average[N].Nmeasure + D_ITEM;
    414418      REALLOCATE (next_measure, off_t, NMEASURE);
    415419      REALLOCATE (output[0].measure, Measure, NMEASURE);
    416420    }
    417421    if (Nlensing + input[0].average[N].Nlensing >= NLENSING) {
    418       NLENSING = Nlensing + input[0].average[N].Nlensing + 1000;
     422      NLENSING = Nlensing + input[0].average[N].Nlensing + D_ITEM;
    419423      REALLOCATE (next_lensing, off_t, NLENSING);
    420424      REALLOCATE (output[0].lensing, Lensing, NLENSING);
    421425    }
    422426    if (Nlensobj + input[0].average[N].Nlensobj >= NLENSOBJ) {
    423       NLENSOBJ = Nlensobj + input[0].average[N].Nlensobj + 1000;
     427      NLENSOBJ = Nlensobj + input[0].average[N].Nlensobj + D_ITEM;
    424428      REALLOCATE (next_lensobj, off_t, NLENSOBJ);
    425429      REALLOCATE (output[0].lensobj, Lensobj, NLENSOBJ);
    426430    }
    427431    if (Nstarpar + input[0].average[N].Nstarpar >= NSTARPAR) {
    428       NSTARPAR = Nstarpar + input[0].average[N].Nstarpar + 1000;
     432      NSTARPAR = Nstarpar + input[0].average[N].Nstarpar + D_ITEM;
    429433      REALLOCATE (next_starpar, off_t, NSTARPAR);
    430434      REALLOCATE (output[0].starpar, StarPar, NSTARPAR);
    431435    }
    432436    if (Ngalphot + input[0].average[N].Ngalphot >= NGALPHOT) {
    433       NGALPHOT = Ngalphot + input[0].average[N].Ngalphot + 1000;
     437      NGALPHOT = Ngalphot + input[0].average[N].Ngalphot + D_ITEM;
    434438      REALLOCATE (next_galphot, off_t, NGALPHOT);
    435439      REALLOCATE (output[0].galphot, GalPhot, NGALPHOT);
    436440    }
    437441    if (Nave >= NAVE) {
    438       NAVE = Nave + 1000;
     442      NAVE = Nave + D_ITEM;
    439443      REALLOCATE (output[0].average, Average, NAVE);
    440444      REALLOCATE (output[0].secfilt, SecFilt, NAVE*NsecfiltOut);
Note: See TracChangeset for help on using the changeset viewer.