IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 19, 2010, 5:13:52 PM (16 years ago)
Author:
watersc1
Message:

Merging czw_branch (maskstats and software versions) back into the trunk

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ippTools/src/difftool.c

    r27794 r28043  
    162162            exposure,
    163163            false,
     164            NULL, // software version
     165            0,    // mask stat npix
     166            NAN,    // static
     167            NAN,    // dynamic
     168            NAN,    // magic
     169            NAN,    // advisory
    164170            diff_mode,
    165171            note
     
    549555    PXOPT_LOOKUP_F32(good_frac, config->args, "-good_frac", false, false);
    550556    PXOPT_LOOKUP_S64(magicked, config->args, "-magicked", false, false);
     557
     558    PXOPT_LOOKUP_STR(ver_pslib, config->args, "-ver_pslib", false, false);
     559    PXOPT_LOOKUP_STR(ver_psmodules, config->args, "-ver_psmodules", false, false);
     560    PXOPT_LOOKUP_STR(ver_psphot, config->args, "-ver_psphot", false, false);
     561    PXOPT_LOOKUP_STR(ver_ppstats, config->args, "-ver_ppstats", false, false);
     562    PXOPT_LOOKUP_STR(ver_ppsub, config->args, "-ver_ppsub", false, false);
     563    PXOPT_LOOKUP_STR(ver_streaks, config->args, "-ver_streaks", false, false);
     564
     565    PXOPT_LOOKUP_S32(maskfrac_npix, config->args, "-maskfrac_npix", false, false);
     566    PXOPT_LOOKUP_F32(maskfrac_static, config->args, "-maskfrac_static", false, false);
     567    PXOPT_LOOKUP_F32(maskfrac_dynamic, config->args, "-maskfrac_dynamic", false, false);
     568    PXOPT_LOOKUP_F32(maskfrac_magic, config->args, "-maskfrac_magic", false, false);
     569    PXOPT_LOOKUP_F32(maskfrac_advisory, config->args, "-maskfrac_advisory", false, false);
     570   
     571    psTrace("czw.test",1,"Received versions: pslib %s psmodules %s psphot %s ppstats %s ppsub %s streaks %s\n",
     572            ver_pslib,ver_psmodules,ver_psphot,ver_ppstats,ver_ppsub,ver_streaks);
     573    psString ver_code = NULL;
     574    if ((ver_pslib)&&(ver_psmodules)) {
     575      ver_code = pxMergeCodeVersions(ver_pslib,ver_psmodules);
     576    }
     577    if (ver_psphot) {
     578      ver_code = pxMergeCodeVersions(ver_code,ver_psphot);
     579    }
     580    if (ver_ppstats) {
     581      ver_code = pxMergeCodeVersions(ver_code,ver_ppstats);
     582    }
     583    if (ver_ppsub) {
     584      ver_code = pxMergeCodeVersions(ver_code,ver_ppsub);
     585    }
     586    if (ver_streaks) {
     587      ver_code = pxMergeCodeVersions(ver_code,ver_streaks);
     588    }
    551589
    552590    if (!psDBTransaction(config->dbh)) {
     
    582620                           fault,
    583621                           quality,
    584                            magicked
     622                           magicked,
     623                           ver_code,
     624                           maskfrac_npix,
     625                           maskfrac_static,
     626                           maskfrac_dynamic,
     627                           maskfrac_magic,
     628                           maskfrac_advisory
    585629          )) {
    586630        if (!psDBRollback(config->dbh)) {
     
    671715        psS64 magicked = psMetadataLookupS64(NULL, row, "magicked");
    672716
     717        psString software_ver = NULL;
     718        psS32 maskfrac_npix = 0;
     719        psF32 maskfrac_static = 0;
     720        psF32 maskfrac_dynamic = 0;
     721        psF32 maskfrac_magic = 0;
     722        psF32 maskfrac_advisory = 0;
     723
     724        // Calculate run level masking and software state
     725        if (!pxCoalesceRunStatus(config,"difftool_coalesce_run.sql",diff_id,
     726                                 &software_ver,&maskfrac_npix,
     727                                 &maskfrac_static,&maskfrac_dynamic,
     728                                 &maskfrac_magic,&maskfrac_advisory)) {
     729          psError(PS_ERR_UNKNOWN, false, "failed to generate run level statistics");
     730          psFree(output);
     731          if (!psDBRollback(config->dbh)) {
     732            psError(PS_ERR_UNKNOWN, false, "database error");
     733          }
     734          return(false);
     735        }
     736        // Set diffRun.software_ver to the appropriate value
     737        if (software_ver) {
     738          if (!pxSetRunSoftware(config, "diffRun", "diff_id", diff_id, software_ver)) {
     739            psError(PS_ERR_UNKNOWN, false, "failed to set diffRun.software_ver for diff_id: %" PRId64,
     740                    diff_id);
     741            psFree(output);
     742            if (!psDBRollback(config->dbh)) {
     743              psError(PS_ERR_UNKNOWN, false, "database error");
     744            }
     745            return(false);
     746          }
     747        }
     748        // Set diffRun.maskfrac* to the appropriate values.
     749        if (maskfrac_npix) {
     750          if (!pxSetRunMaskfrac(config, "diffRun", "diff_id", diff_id, maskfrac_npix, maskfrac_static,
     751                                maskfrac_dynamic, maskfrac_magic, maskfrac_advisory)) {
     752            psError(PS_ERR_UNKNOWN, false, "failed to set diffRun.software_ver for diff_id: %" PRId64,
     753                    diff_id);
     754            psFree(output);
     755            if (!psDBRollback(config->dbh)) {
     756              psError(PS_ERR_UNKNOWN, false, "database error");
     757            }
     758            return(false);
     759          }
     760        }
    673761        // set diffRun.state to 'full'
    674762        if (!setdiffRunState(config, diff_id, "full", magicked)) {
     
    9851073            false,
    9861074            0,       // magicked
     1075            NULL, // software version
     1076            0,    // mask stat npix
     1077            NAN,    // static
     1078            NAN,    // dynamic
     1079            NAN,    // magic
     1080            NAN,    // advisory
    9871081            diff_mode, // diff_mode
    9881082            note
     
    14121506                true,                   // exposure
    14131507                0,       // magicked
     1508                NULL, // software version
     1509                0,    // mask stat npix
     1510                NAN,    // static
     1511                NAN,    // dynamic
     1512                NAN,    // magic
     1513                NAN,    // advisory
    14141514                IPP_DIFF_MODE_WARP_STACK,
    14151515                note
     
    17641864                                          true,  // exposure
    17651865                                          false, // magicked
     1866                                          NULL, // software version
     1867                                          0,    // mask stat npix
     1868                                          NAN,    // static
     1869                                          NAN,    // dynamic
     1870                                          NAN,    // magic
     1871                                          NAN,    // advisory                                   
    17661872                                          IPP_DIFF_MODE_WARP_WARP,
    17671873                                          note); // Run to insert
     
    20462152                                      false,                 // exposure
    20472153                                      0,       // magicked
     2154                                      NULL, // software version
     2155                                      0,    // mask stat npix
     2156                                      NAN,    // static
     2157                                      NAN,    // dynamic
     2158                                      NAN,    // magic
     2159                                      NAN,    // advisory                                   
    20482160                                      IPP_DIFF_MODE_STACK_STACK, // diff_mode
    20492161                                      note
Note: See TracChangeset for help on using the changeset viewer.