IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 3, 2014, 3:24:28 PM (12 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20140813
Files:
37 edited
12 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140813

  • branches/eam_branches/ipp-20140813/DataStoreServer/scripts/dsreg

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/Ohana

  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/build_links.c

    r37116 r37351  
    11# include "addstar.h"
     2
     3# define myAbortF(FORMAT,...) { fprintf (stderr, FORMAT, __VA_ARGS__); abort(); }
    24
    35/*
     
    4749
    4850    if (N >= Nmeasure) {
    49       fprintf (stderr, "overflow in init_measure_links\n");
    50       abort ();
     51      myAbort ("overflow in init_measure_links\n");
    5152    }
    5253  }
     
    136137Measure *sort_measure (Average *average, off_t Naverage, Measure *measure, off_t Nmeasure, off_t *next_meas) {
    137138
    138   off_t i, k, n, N;
     139  int i, k, n, N;
    139140  Measure *tmpmeasure;
    140141
     
    146147    average[i].measureOffset = N;
    147148    for (k = 0; k < average[i].Nmeasure; k++, N++) {
    148       if (n == -1) abort();
     149      if (n == -1) myAbortF("invalid measureOffset for ave %d, measureOffset %d, measure %d\n", i, average[i].measureOffset, k);
    149150      tmpmeasure[N] = measure[n];
    150       if (measure[n].averef != i) abort();
     151      if (measure[n].averef != i) myAbortF("invalid averef for ave %d, measureOffset %d, measure %d, averef %d\n", i, average[i].measureOffset, k, measure[n].averef);
    151152      tmpmeasure[N].averef = i;
    152153      n = next_meas[n];
     
    175176      next_miss[N] = -1;
    176177      if (N >= Nmissing) {
    177         fprintf (stderr, "overflow in init_missing_links");
    178         abort ();
     178        myAbort ("overflow in init_missing_links");
    179179      }
    180180      N++;
     
    253253
    254254    if (N >= Nlensing) {
    255       fprintf (stderr, "overflow in init_lensing_links\n");
    256       abort ();
     255      myAbort ("overflow in init_lensing_links\n");
    257256    }
    258257    N++;
     
    343342Lensing *sort_lensing (Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing, off_t *next_lens) {
    344343
    345   off_t i, k, n, N;
     344  int i, k, n, N;
    346345  Lensing *tmplensing;
    347346
     
    354353    average[i].lensingOffset = N;
    355354    for (k = 0; k < average[i].Nlensing; k++, N++) {
    356       if (n == -1) abort();
     355      if (n == -1) myAbortF("invalid lensingOffset for ave %d, lensingOffset %d, lensing %d\n", i, average[i].lensingOffset, k);
    357356      tmplensing[N] = lensing[n];
    358       if (lensing[n].averef != i) abort();
     357      if (lensing[n].averef != i) myAbortF("invalid averef for ave %d, lensingOffset %d, lensing %d, averef %d\n", i, average[i].lensingOffset, k, lensing[n].averef);
    359358      tmplensing[N].averef = i;
    360359      n = next_lens[n];
  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/resort_catalog.c

    r37116 r37351  
    8282      myAssert(average[averageSeq[i]].catID == measure[measureSeq[i]].catID, "object / detection mismatch");
    8383# if (1)
    84       myAssert(average[averageSeq[i]].objID == measure[measureSeq[i]].objID, "object / detection mismatch");
     84      // myAssert(average[averageSeq[i]].objID == measure[measureSeq[i]].objID, "object / detection mismatch");
     85      // check if the objID is correct. if not, check if it is byte-swapped (this has happened) and repair if so. 
     86      // otherwise, abort
     87      if (average[averageSeq[i]].objID != measure[measureSeq[i]].objID) {
     88        fprintf (stderr, "object / detection mismatch average.objID = %d, measure.objID = %d, catID: %d, detID: %d",
     89                 average[averageSeq[i]].objID, measure[measureSeq[i]].objID,
     90                 measure[measureSeq[i]].catID, measure[measureSeq[i]].detID);
     91        int objIDalt = measure[measureSeq[i]].objID;
     92        char *byte = (char *) &objIDalt;
     93        char tmp;
     94        tmp = byte[0]; byte[0] = byte[3]; byte[3] = tmp;
     95        tmp = byte[1]; byte[1] = byte[2]; byte[2] = tmp;
     96        if (average[averageSeq[i]].objID == objIDalt) {
     97          fprintf (stderr, "objID is byte-swapped, repairing\n");
     98          measure[measureSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this...
     99        } else if (measure[measureSeq[i]].objID == 0) {
     100          fprintf (stderr, "objID is 0, repairing\n");
     101          measure[measureSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this...
     102        } else {
     103          myAbort ("objID is NOT byte-swapped, aborting\n");
     104        }
     105      }
    85106# else
    86107      // for reasons I do not understand, the mini dvodbs generated on stsci1X had a handful of detections with an inconsistency between averef and objID. 
  • branches/eam_branches/ipp-20140813/Ohana/src/getstar

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/ippMonitor/czartool/czartool/Plotter.pm

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/ippScripts/Build.PL

    r37114 r37351  
    119119        scripts/ipp_apply_burntool.pl
    120120        scripts/ipp_apply_burntool_single.pl
     121        scripts/ipp_apply_burntool_fix.pl
    121122        scripts/make_burntool_pcontrol.pl
    122123        scripts/bundle_detrends.pl
  • branches/eam_branches/ipp-20140813/ippScripts/MANIFEST

    r37114 r37351  
    4343scripts/ipp_apply_burntool.pl
    4444scripts/ipp_apply_burntool_single.pl
     45scripts/ipp_apply_burntool_fix.pl
    4546scripts/make_burntool_pcontrol.pl
    4647scripts/bundle_detrends.pl
  • branches/eam_branches/ipp-20140813/ippScripts/scripts/lap_science.pl

    r37193 r37351  
    10771077        &my_die("Unable to perform stacktool -definebyquery: $error_code", $lap_id);
    10781078    }
    1079     $stacks_made .= $mdcParser->parse_list(join "", @$stdout_buf) or
     1079    my $stacks_made_deep .= $mdcParser->parse_list(join "", @$stdout_buf) or
    10801080        &my_die("unable to parse metadata from stacktool -definebyquery", $lap_id, "");   
    10811081
    1082 
     1082    # Append deep stacks to stacks so we can get a complete count later.
     1083    push @{ $stacks_made}, @{ $stacks_made_deep };
     1084   
    10831085    ## Determine the sass_id so we can record it in the database.
    10841086    $command = "$stacktool ";
  • branches/eam_branches/ipp-20140813/ippScripts/scripts/queuestaticsky.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/ippScripts/scripts/sc_remote_exec.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/ippconfig

  • branches/eam_branches/ipp-20140813/ippconfig/gpc1/ppStack.config

    r37305 r37351  
    160160    STACK.TYPE              STR   DEEP_STACK  ## needed?
    161161    PSF.INPUT.CLIP.SIMPLE   BOOL  True
    162     PSF.INPUT.MAX           F32   7.0    # center/edge can vary 1-2 pix, prefer <6 pix but needs to be <7 pix for edges
     162    PSF.INPUT.MAX           F32   10.0   # center/edge can vary 1-2 pix, prefer <6 pix but needs to be <10 pix for edges until code improved..
    163163    PSF.INPUT.CLIP.NSIGMA   F32   100.0  # any change to inputs can greatly impact edge filling factor..
    164164    PSF.INPUT.THRESH        F32   NAN
  • branches/eam_branches/ipp-20140813/ippconfig/gpc1/psastro.config

    r37305 r37351  
    520520   PSASTRO.MAX.ERROR               F32   0.2  # in arcsec units, still liberal limit for well known astrometry for skycells
    521521   PSASTRO.MIN.NSTAR               S32   10   # edges may not have many and require special treatment
     522
     523   KH.CORRECT.APPLY              BOOL     FALSE
    522524END
    523525
     
    555557   PSASTRO.MIN.NSTAR               S32   10   # edges may not have many and require special treatment
    556558
    557 END
    558 
    559 
    560 
     559   KH.CORRECT.APPLY              BOOL     FALSE
     560END
  • branches/eam_branches/ipp-20140813/ippconfig/recipes/ppSub.config

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/ippconfig/recipes/reductionClasses.mdc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/psLib/src/math/psEllipse.c

    r36375 r37351  
    134134    assert (isfinite(axes.major));
    135135    assert (isfinite(axes.minor));
     136
     137    return axes;
     138}
     139// ellipse derotation (sx, sy, sxy) -> (major, minor, theta)
     140psEllipseAxes psEllipseShapeToAxesWithErrors(psEllipseShape shape, psEllipseShape shapeErrors, double maxAR, psEllipseAxes *pShapeErrors)
     141{
     142    psEllipseAxes axes;
     143    psEllipseAxes errors;
     144
     145    double f1 = 1.0 / PS_SQR(shape.sy) + 1.0 / PS_SQR(shape.sx);
     146    double f2 = 1.0 / PS_SQR(shape.sy) - 1.0 / PS_SQR(shape.sx);
     147
     148    double f32 = PS_SQR(f2) + 4*PS_SQR(shape.sxy);
     149    double f3 = sqrt(f32);
     150
     151    double df1 = - 2.0 * shapeErrors.sy / (PS_SQR(shape.sy) * shape.sy)
     152                 - 2.0 * shapeErrors.sx / (PS_SQR(shape.sx) * shape.sx);
     153    double df2 = - 2.0 * shapeErrors.sy / (PS_SQR(shape.sy) * shape.sy)
     154                 + 2.0 * shapeErrors.sx / (PS_SQR(shape.sx) * shape.sx);
     155
     156    // df3 = 0.5 * df32 / sqrt(f32) = 0.5 * df32 / f3
     157    double df3 = 0.5 * (2.0*f2*df2 + 2 * 4 * shape.sxy * shapeErrors.sxy) / f3;
     158
     159    double f13 = f1 + f3;
     160    axes.minor = sqrt (2.0 / f13);
     161
     162    // dminor = -0.5 * sqrt (2) * df13 * f13**-3/2  = - 0.5 * df13 * minor / f13
     163    errors.minor = - 0.5 * (df1 + df3) * axes.minor / f13;
     164
     165    axes.theta = -0.5 * atan2 (+2.0*shape.sxy, f2);
     166
     167    // according to wikipedia the derivitive of atan2(y, x) is
     168    //
     169    //  dAtan2(y, x) = - y * dx / (x**2 + y**2)) + x * dy / (x**2 + y**2) (for x > 0 and y!=0)
     170    //  where
     171    //  y = 2 * sxy  dy = 2 * dsxy   x = f2 so dx = df2
     172
     173    // dtheta = -0.5 * dAtan2(y, x)
     174
     175    errors.theta = -0.5 * ( -2.0 * shape.sxy * df2  +  f2 * 2 *shapeErrors.sxy ) /
     176                            (PS_SQR(f2) + 4 * PS_SQR(shape.sxy)) ;
     177
     178    // long, thin objects are likely to have a poorly measured major axis
     179    // the angle and minor axis are likely to be ok.
     180    // restrict the axis ratio
     181    double rAR2 = (f1 - f3) / (f1 + f3);
     182    if (rAR2 < 1.0/PS_SQR(maxAR)) {
     183        axes.major = axes.minor * maxAR;
     184        errors.major = errors.minor * maxAR;
     185    } else {
     186        axes.major = sqrt (2.0 / (f1 - f3));
     187
     188        // dmajor = -0.5 * (df1 - df3) * sqrt(2) * (f1 - f3)**-3/2
     189        //        = -0.5 * (df2 - df3) * major / (f1 - f3)
     190        errors.major = -0.5 * axes.major * (df1 - df3) / (f1 - f3);
     191    }
     192
     193    assert (isfinite(axes.theta));
     194    assert (isfinite(axes.major));
     195    assert (isfinite(axes.minor));
     196
     197    *pShapeErrors = errors;
    136198
    137199    return axes;
  • branches/eam_branches/ipp-20140813/psLib/src/math/psEllipse.h

    r36375 r37351  
    6565                                   );
    6666
     67/// Convert shape to axes representation and compute errors
     68psEllipseAxes psEllipseShapeToAxesWithErrors(psEllipseShape shape, ///< Shape of ellipse
     69                                   psEllipseShape errors, ///<errors on shape params
     70                                   double maxAR, ///< Maximum allowed axis ratio
     71                                   psEllipseAxes *pShapeErrors ///< propagated errors on axes
     72                                   );
     73
    6774/// Convert axes to polarization representation
    6875psEllipsePol psEllipseAxesToPol(psEllipseAxes axes ///< Axes of ellipse
  • branches/eam_branches/ipp-20140813/psModules/src/objects

    • Property svn:ignore
      •  

        old new  
        1616pmSourceIO_CMF_PS1_SV2.c
        1717pmSourceIO_CMF_PS1_SV3.c
         18pmSourceIO_CMF_PS1_SV4.c
        1819pmSourceIO_CMF_PS1_DV1.c
        1920pmSourceIO_CMF_PS1_DV2.c
        2021pmSourceIO_CMF_PS1_DV3.c
        2122pmSourceIO_CMF_PS1_DV4.c
         23
  • branches/eam_branches/ipp-20140813/psModules/src/objects/Makefile.am

    r36890 r37351  
    5353        pmSourceIO_CMF_PS1_SV2.c \
    5454        pmSourceIO_CMF_PS1_SV3.c \
     55        pmSourceIO_CMF_PS1_SV4.c \
    5556        pmSourceIO_CMF_PS1_DV1.c \
    5657        pmSourceIO_CMF_PS1_DV2.c \
     
    157158pmSourceIO_CMF_PS1_SV1.c \
    158159pmSourceIO_CMF_PS1_SV2.c \
    159 pmSourceIO_CMF_PS1_SV3.c
     160pmSourceIO_CMF_PS1_SV3.c \
     161pmSourceIO_CMF_PS1_SV4.c
    160162
    161163pmSourceIO_CMF_PS1_V1.c : pmSourceIO_CMF.c.in mksource.pl
     
    195197        mksource.pl pmSourceIO_CMF.c.in PS1_SV3 pmSourceIO_CMF_PS1_SV3.c
    196198
     199pmSourceIO_CMF_PS1_SV4.c : pmSourceIO_CMF.c.in mksource.pl
     200        mksource.pl pmSourceIO_CMF.c.in PS1_SV4 pmSourceIO_CMF_PS1_SV4.c
     201
    197202# EXTRA_DIST = pmErrorCodes.h.in pmErrorCodes.dat pmErrorCodes.c.in
  • branches/eam_branches/ipp-20140813/psModules/src/objects/mksource.pl

    r36864 r37351  
    2929                "PS1_SV2", 2,
    3030                "PS1_SV3", 3,
     31                "PS1_SV4", 4,
    3132    );
    3233
  • branches/eam_branches/ipp-20140813/psModules/src/objects/pmSource.c

    r36860 r37351  
    176176    source->parent = NULL;
    177177    source->tmpPtr = NULL;
     178    source->chipNum = -1;
     179    source->chipX = -1000;
     180    source->chipY = -1000;
    178181    source->imageID = -1;
    179182    source->nFrames = 0;
  • branches/eam_branches/ipp-20140813/psModules/src/objects/pmSource.h

    r36860 r37351  
    127127    pmSource *parent;                   ///< reference to the master source from which this is derived
    128128    psPtr *tmpPtr;                      ///< pointer that may be used to store data in a particular module. e.g. psphotKronIterate.
     129    short chipNum;                      ///< camera dependent of chip suppling pixels for fullforce source
     130    short chipX;                        ///< chip space X coord of fullforce source
     131    short chipY;                        ///< chip space Y coord of fullforce source
    129132    int imageID;
    130133    psU16 nFrames;
  • branches/eam_branches/ipp-20140813/psModules/src/objects/pmSourceIO.c

    r37051 r37351  
    602602            PM_SOURCES_WRITE("PS1_SV2",   CMF_PS1_SV2);
    603603            PM_SOURCES_WRITE("PS1_SV3",   CMF_PS1_SV3);
     604            PM_SOURCES_WRITE("PS1_SV4",   CMF_PS1_SV4);
    604605            PM_SOURCES_WRITE("PS1_DV1",   CMF_PS1_DV1);
    605606            PM_SOURCES_WRITE("PS1_DV2",   CMF_PS1_DV2);
     
    11241125            PM_SOURCES_READ_PSF("PS1_SV2",   CMF_PS1_SV2);
    11251126            PM_SOURCES_READ_PSF("PS1_SV3",   CMF_PS1_SV3);
     1127            PM_SOURCES_READ_PSF("PS1_SV4",   CMF_PS1_SV4);
    11261128            PM_SOURCES_READ_PSF("PS1_DV1",   CMF_PS1_DV1);
    11271129            PM_SOURCES_READ_PSF("PS1_DV2",   CMF_PS1_DV2);
     
    14121414        PM_SOURCES_READ_XSRC("PS1_SV2",   CMF_PS1_SV2);
    14131415        PM_SOURCES_READ_XSRC("PS1_SV3",   CMF_PS1_SV3);
     1416        PM_SOURCES_READ_XSRC("PS1_SV4",   CMF_PS1_SV4);
    14141417        PM_SOURCES_READ_XSRC("PS1_DV1",   CMF_PS1_DV1);
    14151418        PM_SOURCES_READ_XSRC("PS1_DV2",   CMF_PS1_DV2);
     
    14541457        PM_SOURCES_READ_XFIT("PS1_SV2",   CMF_PS1_SV2);
    14551458        PM_SOURCES_READ_XFIT("PS1_SV3",   CMF_PS1_SV3);
     1459        PM_SOURCES_READ_XFIT("PS1_SV4",   CMF_PS1_SV4);
    14561460        PM_SOURCES_READ_XFIT("PS1_DV1",   CMF_PS1_DV1);
    14571461        PM_SOURCES_READ_XFIT("PS1_DV2",   CMF_PS1_DV2);
     
    14951499        PM_SOURCES_READ_XRAD("PS1_SV2",   CMF_PS1_SV2);
    14961500        PM_SOURCES_READ_XRAD("PS1_SV3",   CMF_PS1_SV3);
     1501        PM_SOURCES_READ_XRAD("PS1_SV4",   CMF_PS1_SV4);
    14971502        PM_SOURCES_READ_XRAD("PS1_DV1",   CMF_PS1_DV1);
    14981503        PM_SOURCES_READ_XRAD("PS1_DV2",   CMF_PS1_DV2);
     
    15361541        PM_SOURCES_READ_XGAL("PS1_SV2",   CMF_PS1_SV2);
    15371542        PM_SOURCES_READ_XGAL("PS1_SV3",   CMF_PS1_SV3);
     1543        PM_SOURCES_READ_XGAL("PS1_SV4",   CMF_PS1_SV4);
    15381544        PM_SOURCES_READ_XGAL("PS1_DV1",   CMF_PS1_DV1);
    15391545        PM_SOURCES_READ_XGAL("PS1_DV2",   CMF_PS1_DV2);
  • branches/eam_branches/ipp-20140813/psModules/src/objects/pmSourceIO.h

    r36890 r37351  
    4141MK_PROTO(CMF_PS1_SV2);
    4242MK_PROTO(CMF_PS1_SV3);
     43MK_PROTO(CMF_PS1_SV4);
    4344MK_PROTO(CMF_PS1_DV1);
    4445MK_PROTO(CMF_PS1_DV2);
  • branches/eam_branches/ipp-20140813/psModules/src/objects/pmSourceIO_CMF.c.in

    r37245 r37351  
    221221          @>PS1_V4@               psMetadataAdd (row, PS_LIST_TAIL, "LENS_E2_SH_PSF",   PS_DATA_F32, "shear polarizability element (objects)",     source->lensingPSF->shear->e2);
    222222        }
     223
     224        // if lensing params exist also include the backmapped chipID and chip coordinates
     225        if (source->lensingPSF && source->lensingPSF->shear) {
     226            @>PS1_V4@               psMetadataAdd (row, PS_LIST_TAIL, "SRC_CHIP_NUM",   PS_DATA_S16, "id of warp input chip",     source->chipNum);
     227            @>PS1_V4@               psMetadataAdd (row, PS_LIST_TAIL, "SRC_CHIP_X",    PS_DATA_S16, "x coord in warp input chip",     source->chipX);
     228            @>PS1_V4@               psMetadataAdd (row, PS_LIST_TAIL, "SRC_CHIP_Y",    PS_DATA_S16, "y coord in warp input chip",     source->chipY);
     229            @>PS1_V4@               psMetadataAdd (row, PS_LIST_TAIL, "PADDING3",      PS_DATA_S16, "more padding", 0);
     230        }
    223231
    224232        @>PS1_V2,PS1_SV?,>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_R1",       PS_DATA_F32, "first radial moment",                        moments.Mrf);
     
    907915    }
    908916
    909     @>PS1_DV2@ pmChip *chip = readout->parent->parent;
     917    @>PS1_DV2,>PS1_SV3@ pmChip *chip = readout->parent->parent;
    910918
    911919    pmModelStatus badModel = PM_MODEL_STATUS_NONE;
     
    966974            }
    967975
    968             @>PS1_DV2@ psSphere ptSky = {0.0, 0.0, 0.0, 0.0};
    969             @>PS1_DV2@ float posAngle = 0.0;
    970             @>PS1_DV2@ float pltScale = 0.0;
    971             @>PS1_DV2@ pmSourceLocalAstrometry (&ptSky, &posAngle, &pltScale, chip, xPos, yPos);
    972             @>PS1_DV2@ double raPos = ptSky.r*PS_DEG_RAD;
    973             @>PS1_DV2@ double decPos = ptSky.d*PS_DEG_RAD;
    974             @>PS1_DV2@ posAngle *= PS_DEG_RAD;
    975             @>PS1_DV2@ pltScale *= PS_DEG_RAD*3600.0;
     976            @>PS1_DV2,>PS1_SV3@ psSphere ptSky = {0.0, 0.0, 0.0, 0.0};
     977            @>PS1_DV2,>PS1_SV3@ float posAngle = 0.0;
     978            @>PS1_DV2,>PS1_SV3@ float pltScale = 0.0;
     979            @>PS1_DV2,>PS1_SV3@ pmSourceLocalAstrometry (&ptSky, &posAngle, &pltScale, chip, xPos, yPos);
     980            @>PS1_DV2,>PS1_SV3@ double raPos = ptSky.r*PS_DEG_RAD;
     981            @>PS1_DV2,>PS1_SV3@ double decPos = ptSky.d*PS_DEG_RAD;
     982            @>PS1_DV2,>PS1_SV3@ posAngle *= PS_DEG_RAD;
     983            @>PS1_DV2,>PS1_SV3@ pltScale *= PS_DEG_RAD*3600.0;
    976984
    977985            float kronFlux = source->moments ? source->moments->KronFlux : NAN;
     
    987995            psMetadataAddF32 (row, PS_LIST_TAIL, "X_EXT_SIG",        0, "Sigma in EXT x coordinate",                  xErr);
    988996            psMetadataAddF32 (row, PS_LIST_TAIL, "Y_EXT_SIG",        0, "Sigma in EXT y coordinate",                  yErr);
    989             @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "RA_EXT",           0, "EXT model ra coordinate",                    raPos);
    990             @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "DEC_EXT",          0, "EXT model dec coordinate",                   decPos);
     997            @>PS1_DV2,>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "RA_EXT",           0, "EXT model ra coordinate",                    raPos);
     998            @>PS1_DV2,>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "DEC_EXT",          0, "EXT model dec coordinate",                   decPos);
    991999            @>PS1_DV2@ float instFlux = isfinite(model->mag) ? pow(10.0, -0.4*model->mag) : NAN;
    9921000            @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_FLUX",    0, "EXT fit instrumental counts",                instFlux);
  • branches/eam_branches/ipp-20140813/psphot/src/Makefile.am

    r36623 r37351  
    9797# generalized forced photometry (including Kron, Petro, and Models) of specified positions given a specified psf
    9898psphotFullForce_SOURCES = \
    99         psphotFullForce.c             \
    100         psphotFullForceArguments.c    \
     99        psphotFullForce.c          \
     100        psphotFullForceArguments.c \
    101101        psphotParseCamera.c        \
    102102        psphotImageLoop.c          \
     
    259259        psphotEfficiency.c             \
    260260        psphotSetNFrames.c             \
    261         psphotSourceMemory.c
     261        psphotSourceMemory.c           \
     262        psphotChipParams.c
    262263
    263264# not currently used
  • branches/eam_branches/ipp-20140813/psphot/src/psphot.h

    r36757 r37351  
    571571bool psphotSourceMemoryReadout(pmConfig *config, const pmFPAview *view, const char *filerule, int index);
    572572
     573bool psphotChipParams(pmConfig *config, const pmFPAview *view, const char *filerule);
     574bool psphotChipParams_Threaded(psThreadJob *job);
     575
    573576const char * psphotGetFilerule(const char *baseRule);
    574577extern bool psphotINpsphotStack;
    575578
     579
    576580#endif
  • branches/eam_branches/ipp-20140813/psphot/src/psphotFullForceReadout.c

    r36663 r37351  
    106106    psphotKronFlux (config, view, filerule);
    107107
     108    psphotChipParams (config, view, filerule);
     109
    108110    // measure petro fluxes
    109111    psphotPetroFlux (config, view, filerule);
  • branches/eam_branches/ipp-20140813/psphot/src/psphotSetThreads.c

    r36375 r37351  
    8787    psFree(task);
    8888
     89    task = psThreadTaskAlloc("PSPHOT_CHIP_PARAMS", 2);
     90    task->function = &psphotChipParams_Threaded;
     91    psThreadTaskAdd(task);
     92    psFree(task);
     93
    8994    return true;
    9095}
  • branches/eam_branches/ipp-20140813/pstamp/scripts/pstamp_checkdependent.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/pstamp/scripts/pstamp_finish.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/pstamp/scripts/pstamp_job_run.pl

    r36812 r37351  
    9191my $ppBackgroundStack = can_run('ppBackgroundStack') or (warn "Can't find ppBackgroundStack" and $missing_tools = 1);
    9292my $stack_bkg_mk_mdc = can_run('stack_bkg_mk_mdc.pl') or (warn "Can't find stack_bkg_mk_mdc.pl" and $missing_tools = 1);
     93my $fpack = can_run('fpack') or (warn "Can't find fpack" and $missing_tools = 1);
     94
    9395
    9496if ($missing_tools) {
     
    146148    my $mask;
    147149    my $variance;
    148 
    149     # We need to background restore HERE
    150     # and change the image file supplied to ppstamp
    151150
    152151    my $fileArgs = " -file $params->{image}";
     
    224223
    225224    # unless the stage is stack_summary we use ppstamp to make postage stamps (including -wholefile)
    226     # otherwise we make copies of the input files to the outputs
     225    # if stage is stack_summary we make copies of the input files to the outputs
    227226    my $use_ppstamp = ($stage ne 'stack_summary');
    228227
     
    243242            $exitStatus = $PS_EXIT_SYS_ERROR;
    244243        }
    245         # XXX: if stage is stack deal with EXP and NUM images if selected
     244
     245        # if stage is stack deal with EXP and NUM images if selected by running ppstamp again
     246        if (!$exitStatus and $stage eq 'stack' and ($options & ($PSTAMP_SELECT_EXP | $PSTAMP_SELECT_NUM))) {
     247            # XXX Here I am assuming that nothing relevant gets added to $argString
     248            # Need to check
     249            my $roiArgs = $params->{job_args};
     250
     251            # XXX: define expnum and exptime input images in the params file so that we don't have to
     252            # make assumptions about the file rules here
     253            my $pathBase = $params->{stack_path_base};
     254            $pathBase = $params->{path_base} unless defined $pathBase;
     255            unless (defined $pathBase) {
     256                my_die("stack path base undefined found when creating exp or expnum image", $job_id, $PS_EXIT_PROG_ERROR);
     257            }
     258            $pathBase .= ".unconv";
     259            my $tmpBase = "$outputBase.TMP";
     260            # nocompress because exp image gets corrupted if we do
     261            my $command = "$ppstamp $tmpBase $roiArgs  -nocompress -stage stack";
     262            # XXX: use file rules
     263            # Image is the EXP (exptime) image
     264            $command .= " -file $pathBase.exp.fits";
     265            # treat number image as mask
     266            $command .= " -mask $pathBase.num.fits" if ($options & $PSTAMP_SELECT_NUM);
     267
     268            $command .= " -forheader $calibfile" if $calibfile;
     269
     270            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     271                run(command => $command, verbose => $verbose);
     272
     273            if (WIFEXITED($error_code)) {
     274                $exitStatus = WEXITSTATUS($error_code);
     275            } else {
     276                print STDERR "ppstamp failed error_code: $error_code\n";
     277                $exitStatus = $PS_EXIT_SYS_ERROR;
     278            }
     279
     280            # command to compress fits files to stdout using gzip
     281            my $fpack_gzip = "$fpack -g -S";
     282            $fpack_gzip .= " -D" unless $save_temps;
     283
     284            if (!$exitStatus and ($options & $PSTAMP_SELECT_NUM)) {
     285                # rename the num image if selected since it is not a mask
     286                # Change .exp.mk to .num
     287                my $tmpName = "$tmpBase.mk.fits";
     288                my $numName = "$outputBase.num.fits";
     289                # optionally fpack it while we're here unless user wants uncompressed images
     290                unless ($options & $PSTAMP_SELECT_UNCOMPRESSED) {
     291                    my $command = "$fpack_gzip $tmpName > $numName";
     292                    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     293                        run(command => $command, verbose => $verbose);
     294
     295                    if (WIFEXITED($error_code)) {
     296                        $exitStatus = WEXITSTATUS($error_code);
     297                    } else {
     298                        print STDERR "ppstamp failed error_code: $error_code\n";
     299                        print STDERR "@$stderr_buf\n";
     300                        $exitStatus = $PS_EXIT_SYS_ERROR;
     301                    }
     302                } elsif (!$exitStatus) {
     303                    rename $tmpName, $numName
     304                        or my_die ("failed to rename $tmpName to $numName", $job_id, $PS_EXIT_UNKNOWN_ERROR);
     305                }
     306
     307            }
     308            # fpack the exp image if not -nocompress
     309            unless ($exitStatus or ($options & $PSTAMP_SELECT_UNCOMPRESSED)) {
     310                my $command = "$fpack_gzip $tmpBase.fits > $outputBase.exp.fits";
     311                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     312                    run(command => $command, verbose => $verbose);
     313
     314                if (WIFEXITED($error_code)) {
     315                    $exitStatus = WEXITSTATUS($error_code);
     316                } else {
     317                    print STDERR "ppstamp failed error_code: $error_code\n";
     318                    print STDERR "@$stderr_buf\n";
     319                    $exitStatus = $PS_EXIT_SYS_ERROR;
     320                }
     321            } elsif (!$exitStatus) {
     322                rename "$tmpBase.fits", "$outputBase.exp.fits"
     323                    or my_die ("failed to rename $tmpBase.fits to $outputBase.exp.fits", $job_id, $PS_EXIT_UNKNOWN_ERROR);
     324            }
     325        }
    246326    } else {
    247327        $exitStatus = justCopyFiles($outputBase, \$options, $params);
  • branches/eam_branches/ipp-20140813/pstamp/scripts/pstampparse.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/pstamp/scripts/request_finish.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140813/tools/heather/queuesliceslap2.pl

    r36187 r37351  
    44
    55
    6 $label = "LAP.ThreePi.20130717";
     6#$label = "LAP.ThreePi.20130717";
     7$label = "LAP.ThreePi.20130717.pole3";
     8#$label = "LAP.ThreePi.20130717.pole3.CNP";
    79
    810@segments = (0,1,2,3,4,5,6,7,8);
     
    1113
    1214
    13 @slices = ("00","02","04","06","08",10,12,14,16,18,20,22);
    14    
    15 $slice = $slices[0];
    16 $slice = $slices[1];
     15@slices = ("00","02","04","06","08","10","12","14","16","18","20","22");
     16 
     17foreach $slice (@slices) {
     18   
     19#$slice = $slices[0];
     20#$slice = $slices[1];
    1721    foreach $num (@segments) {
    1822
    19         $dvodb = "LAP.20130717";
    20         $minidvodb_group = "LAP.slice$slice.$segments[$num].cam";
     23        $dvodb = "LAP.PV2.20130717";
     24        $minidvodb_group = "LAP.PV2.slice$slice.$segments[$num].cam";
    2125        $dvodb_label = "$minidvodb_group";
    2226        $ra_min = $slice*15.0;
     
    2731
    2832       
    29         print "addtool -definebyquery  -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group -set_minidvodb -set_label $dvodb_label -stage cam -uncensored -ra_min $ra_min -ra_max $ra_max -decl_min $dec_min -decl_max $dec_max -dbname gpc1 \n";
    30 
    31 
     33        $com =  "addtool -definebyquery  -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group -set_minidvodb -set_label $dvodb_label -stage cam -uncensored -ra_min $ra_min -ra_max $ra_max -decl_min $dec_min -decl_max $dec_max -dbname gpc1";
     34        print "$com\n";
     35        `$com`;
     36    }
    3237
    3338}
     39$com2 = "addtool -definebyquery  -label $label -set_dvodb $dvodb -set_minidvodb_group LAP.PV2.pole.cam -set_minidvodb -set_label LAP.PV2.pole.cam -stage cam -uncensored -ra_min 0 -ra_max 360 -decl_min 75 -decl_max 90 -dbname gpc1";
     40print "$com2\n";
     41`$com2`;
Note: See TracChangeset for help on using the changeset viewer.