IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 11, 2015, 2:02:45 PM (12 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20140904/Ohana
Files:
25 edited
8 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana

  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/include/WISE.h

    r33963 r37803  
    2121short WISE_W1, WISE_W2, WISE_W3, WISE_W4;
    2222
    23 int ALLSKY;
     23enum {MODE_NONE, MODE_ALLWISE, MODE_ALLSKY, MODE_PRELIM};
     24int MODE;
    2425
    2526AddstarClientOptions args_loadwise (int argc, char **argv, AddstarClientOptions options);
    2627
    27 int loadwise_rawdata (SkyList *skytable, char *filename, AddstarClientOptions options, int ALLSKY);
     28int loadwise_rawdata (SkyList *skytable, char *filename, AddstarClientOptions options);
    2829
    2930int getWISE_setup ();
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/MatchHeaders.c

    r37357 r37803  
    6464    if (!strcmp (exttype, "PS1_SV2")) goto keep;
    6565    if (!strcmp (exttype, "PS1_SV3")) goto keep;
     66    if (!strcmp (exttype, "PS1_SV4")) goto keep;
    6667
    6768    if (!strcmp (exttype, "PS1_DV1")) goto keep;
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/ReadStarsFITS.c

    r37246 r37803  
    1414Stars     *Convert_PS1_V5         PROTO((FTable *table, unsigned int *nstars));
    1515Stars     *Convert_PS1_V5_Lensing PROTO((FTable *table, unsigned int *nstars));
     16Stars     *Convert_PS1_V5_Lensing_Alt PROTO((FTable *table, unsigned int *nstars));
    1617Stars     *Convert_PS1_SV1        PROTO((FTable *table, unsigned int *nstars));
    1718Stars     *Convert_PS1_SV1_Alt    PROTO((FTable *table, unsigned int *nstars));
    1819Stars     *Convert_PS1_SV2        PROTO((FTable *table, unsigned int *nstars));
    1920Stars     *Convert_PS1_SV3        PROTO((FTable *table, unsigned int *nstars));
     21Stars     *Convert_PS1_SV4        PROTO((FTable *table, unsigned int *nstars));
    2022Stars     *Convert_PS1_DV3        PROTO((FTable *table, unsigned int *nstars));
    2123Stars     *Convert_PS1_DV4        PROTO((FTable *table, unsigned int *nstars));
     
    7880  }
    7981  if (!strcmp (type, "PS1_V5")) {
    80     if (table.header[0].Naxis[0] == 312) {
    81       stars = Convert_PS1_V5_Lensing (&table, &Nstars);
    82     } else {
    83       stars = Convert_PS1_V5 (&table, &Nstars);
     82    switch (table.header[0].Naxis[0]) {
     83      case 232:
     84        stars = Convert_PS1_V5 (&table, &Nstars);
     85        break;
     86      case 312:
     87        stars = Convert_PS1_V5_Lensing_Alt (&table, &Nstars);
     88        break;
     89      case 320:
     90        stars = Convert_PS1_V5_Lensing (&table, &Nstars);
     91        break;
     92      default:
     93        fprintf (stderr, "invalid PS1_V5 table size %d\n", (int) table.header[0].Naxis[0]);
     94        return NULL;
    8495    }
    8596  }
     
    92103  if (!strcmp (type, "PS1_SV3")) {
    93104    stars = Convert_PS1_SV3 (&table, &Nstars);
     105  }
     106  if (!strcmp (type, "PS1_SV4")) {
     107    stars = Convert_PS1_SV4 (&table, &Nstars);
    94108  }
    95109  if (!strcmp (type, "PS1_DV3")) {
     
    971985}
    972986
     987Stars *Convert_PS1_V5_Lensing_Alt (FTable *table, unsigned int *nstars) {
     988
     989  off_t Nstars;
     990  unsigned int i;
     991  double ZeroPt;
     992  Stars *stars;
     993  CMF_PS1_V5_Lensing_Alt *ps1data;
     994
     995  ps1data = gfits_table_get_CMF_PS1_V5_Lensing_Alt (table, &Nstars, NULL);
     996  if (!ps1data) {
     997    fprintf (stderr, "skipping inconsistent entry\n");
     998    return (NULL);
     999  }
     1000  ZeroPt = GetZeroPoint();
     1001
     1002  ALLOCATE (stars, Stars, Nstars);
     1003  for (i = 0; i < Nstars; i++) {
     1004    InitStar (&stars[i]);
     1005    stars[i].measure.Xccd       = ps1data[i].X;
     1006    stars[i].measure.Yccd       = ps1data[i].Y;
     1007    stars[i].measure.dXccd      = ToShortPixels(ps1data[i].dX);
     1008    stars[i].measure.dYccd      = ToShortPixels(ps1data[i].dY);
     1009
     1010    stars[i].measure.posangle   = ToShortDegrees(ps1data[i].posangle);
     1011    stars[i].measure.pltscale   = ps1data[i].pltscale;
     1012
     1013    if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
     1014      stars[i].measure.M      = NAN;
     1015    } else {
     1016      stars[i].measure.M      = ps1data[i].M + ZeroPt;
     1017    }
     1018    stars[i].measure.dM         = ps1data[i].dM;
     1019    stars[i].measure.dMcal      = ps1data[i].dMcal;
     1020    stars[i].measure.Map        = ps1data[i].Map + ZeroPt;
     1021    stars[i].measure.dMap       = (ps1data[i].apFlux > 0.0) ? fabs(ps1data[i].apFluxErr / ps1data[i].apFlux) : NAN;
     1022                       
     1023    stars[i].measure.Mkron      = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN;
     1024    stars[i].measure.dMkron     = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN;
     1025                       
     1026    // these fluxes are converted from counts to counts/sec in FilterStars.c
     1027    stars[i].measure.FluxPSF    = GetFluxFromFluxOrMag (ps1data[i].Flux, ps1data[i].M);
     1028    stars[i].measure.dFluxPSF   = GetFluxErrFromFluxOrMag (ps1data[i].dFlux, stars[i].measure.FluxPSF, ps1data[i].dM);
     1029    stars[i].measure.FluxKron   = ps1data[i].kronFlux;
     1030    stars[i].measure.dFluxKron  = ps1data[i].kronFluxErr;
     1031    stars[i].measure.FluxAp     = GetFluxFromFluxOrMag (ps1data[i].apFlux, ps1data[i].Map);
     1032    stars[i].measure.dFluxAp    = GetFluxErrFromFluxOrMag (ps1data[i].apFluxErr, stars[i].measure.FluxAp, stars[i].measure.dMap);
     1033
     1034    stars[i].measure.Sky        = ps1data[i].sky;
     1035    stars[i].measure.dSky       = ps1data[i].dSky;
     1036                       
     1037    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
     1038    stars[i].measure.psfQF      = ps1data[i].psfQF;
     1039    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
     1040
     1041    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
     1042    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     1043    stars[i].measure.extNsigma  = ps1data[i].extNsigma;
     1044
     1045    stars[i].measure.FWx        = ToShortPixels(ps1data[i].fx);
     1046    stars[i].measure.FWy        = ToShortPixels(ps1data[i].fy);
     1047    stars[i].measure.theta      = ToShortDegrees(ps1data[i].df);
     1048
     1049    stars[i].measure.Mxx        = ToShortPixels(ps1data[i].Mxx);
     1050    stars[i].measure.Mxy        = ToShortPixels(ps1data[i].Mxy);
     1051    stars[i].measure.Myy        = ToShortPixels(ps1data[i].Myy);
     1052                       
     1053    stars[i].measure.photFlags  = ps1data[i].flags;
     1054    stars[i].measure.photFlags2 = ps1data[i].flags2;
     1055
     1056    // this is may optionally be replaced by the internal sequence (see FilterStars.c)
     1057    stars[i].measure.detID      = ps1data[i].detID;
     1058
     1059    ALLOCATE (stars[i].lensing, Lensing, 1);
     1060    dvo_lensing_init (stars[i].lensing);
     1061
     1062    stars[i].lensing->X11_sm_obj  = ps1data[i].X11_sm_obj;
     1063    stars[i].lensing->X12_sm_obj  = ps1data[i].X12_sm_obj;
     1064    stars[i].lensing->X22_sm_obj  = ps1data[i].X22_sm_obj;
     1065    stars[i].lensing->E1_sm_obj   = ps1data[i].E1_sm_obj;
     1066    stars[i].lensing->E2_sm_obj   = ps1data[i].E2_sm_obj;
     1067
     1068    stars[i].lensing->X11_sh_obj  = ps1data[i].X11_sh_obj;
     1069    stars[i].lensing->X12_sh_obj  = ps1data[i].X12_sh_obj;
     1070    stars[i].lensing->X22_sh_obj  = ps1data[i].X22_sh_obj;
     1071    stars[i].lensing->E1_sh_obj   = ps1data[i].E1_sh_obj;
     1072    stars[i].lensing->E2_sh_obj   = ps1data[i].E2_sh_obj;
     1073
     1074    stars[i].lensing->X11_sm_psf  = ps1data[i].X11_sm_psf;
     1075    stars[i].lensing->X12_sm_psf  = ps1data[i].X12_sm_psf;
     1076    stars[i].lensing->X22_sm_psf  = ps1data[i].X22_sm_psf;
     1077    stars[i].lensing->E1_sm_psf   = ps1data[i].E1_sm_psf;
     1078    stars[i].lensing->E2_sm_psf   = ps1data[i].E2_sm_psf;
     1079
     1080    stars[i].lensing->X11_sh_psf  = ps1data[i].X11_sh_psf;
     1081    stars[i].lensing->X12_sh_psf  = ps1data[i].X12_sh_psf;
     1082    stars[i].lensing->X22_sh_psf  = ps1data[i].X22_sh_psf;
     1083    stars[i].lensing->E1_sh_psf   = ps1data[i].E1_sh_psf;
     1084    stars[i].lensing->E2_sh_psf   = ps1data[i].E2_sh_psf;
     1085
     1086    // stars[i].lensing->F_ApR5    = ps1data[i].F_ApR5;
     1087    // stars[i].lensing->dF_ApR5   = ps1data[i].dF_ApR5;
     1088    // stars[i].lensing->sF_ApR5   = ps1data[i].sF_ApR5;
     1089    // stars[i].lensing->fF_ApR5   = ps1data[i].fF_ApR5;
     1090    //
     1091    // stars[i].lensing->F_ApR6    = ps1data[i].F_ApR6;
     1092    // stars[i].lensing->dF_ApR6   = ps1data[i].dF_ApR6;
     1093    // stars[i].lensing->sF_ApR6   = ps1data[i].sF_ApR6;
     1094    // stars[i].lensing->fF_ApR6   = ps1data[i].fF_ApR6;
     1095
     1096    // this is may optionally be replaced by the internal sequence (see FilterStars.c)
     1097    stars[i].lensing->detID      = ps1data[i].detID;
     1098
     1099    // the Average fields and the following Measure fields are set in FilterStars after
     1100    // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID.
     1101
     1102    // averef is set in find_matches
     1103
     1104    // dbFlags is zero on ingest.
     1105
     1106    // the following fields are currently not being set anywhere: t_msec
     1107  }   
     1108  *nstars = Nstars;
     1109  return (stars);
     1110}
     1111
    9731112Stars *Convert_PS1_SV1 (FTable *table, unsigned int *nstars) {
    9741113
     
    13041443}
    13051444
    1306 Stars *Convert_PS1_DV3 (FTable *table, unsigned int *nstars) {
     1445Stars *Convert_PS1_SV4 (FTable *table, unsigned int *nstars) {
    13071446
    13081447  off_t Nstars;
     
    13101449  double ZeroPt;
    13111450  Stars *stars;
    1312   CMF_PS1_DV3 *ps1data;
    1313 
    1314   ps1data = gfits_table_get_CMF_PS1_DV3 (table, &Nstars, NULL);
     1451  CMF_PS1_SV4 *ps1data;
     1452
     1453  ps1data = gfits_table_get_CMF_PS1_SV4 (table, &Nstars, NULL);
    13151454  if (!ps1data) {
    13161455    fprintf (stderr, "skipping inconsistent entry\n");
     
    13421481    stars[i].measure.Mkron      = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN;
    13431482    stars[i].measure.dMkron     = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN;
    1344                        
     1483
    13451484    // these fluxes are converted from counts to counts/sec in FilterStars.c
    13461485    stars[i].measure.FluxPSF    = GetFluxFromFluxOrMag (ps1data[i].Flux, ps1data[i].M);
     
    13571496    stars[i].measure.psfQF      = ps1data[i].psfQF;
    13581497    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
     1498
    13591499    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
    13601500    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     
    13761516
    13771517    // the Average fields and the following Measure fields are set in FilterStars after
    1378     // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID.
    1379 
    1380     // averef is set in find_matches
    1381 
    1382     // dbFlags is zero on ingest.
     1518    // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID,
     1519    // averef is set in find_matches, dbFlags is zero on ingest.
    13831520
    13841521    // the following fields are currently not being set anywhere: t_msec
     
    13881525}
    13891526
    1390 Stars *Convert_PS1_DV4 (FTable *table, unsigned int *nstars) {
     1527Stars *Convert_PS1_DV3 (FTable *table, unsigned int *nstars) {
    13911528
    13921529  off_t Nstars;
     
    13941531  double ZeroPt;
    13951532  Stars *stars;
    1396   CMF_PS1_DV4 *ps1data;
    1397 
    1398   ps1data = gfits_table_get_CMF_PS1_DV4 (table, &Nstars, NULL);
     1533  CMF_PS1_DV3 *ps1data;
     1534
     1535  ps1data = gfits_table_get_CMF_PS1_DV3 (table, &Nstars, NULL);
    13991536  if (!ps1data) {
    14001537    fprintf (stderr, "skipping inconsistent entry\n");
     
    14021539  }
    14031540  ZeroPt = GetZeroPoint();
    1404 
    1405   fprintf (stderr, "WARNING: Convert_PS1_DV4 not yet updated to match real format\n");
    14061541
    14071542  ALLOCATE (stars, Stars, Nstars);
     
    14741609}
    14751610
    1476 
    1477 
     1611Stars *Convert_PS1_DV4 (FTable *table, unsigned int *nstars) {
     1612
     1613  off_t Nstars;
     1614  unsigned int i;
     1615  double ZeroPt;
     1616  Stars *stars;
     1617  CMF_PS1_DV4 *ps1data;
     1618
     1619  ps1data = gfits_table_get_CMF_PS1_DV4 (table, &Nstars, NULL);
     1620  if (!ps1data) {
     1621    fprintf (stderr, "skipping inconsistent entry\n");
     1622    return (NULL);
     1623  }
     1624  ZeroPt = GetZeroPoint();
     1625
     1626  fprintf (stderr, "WARNING: Convert_PS1_DV4 not yet updated to match real format\n");
     1627
     1628  ALLOCATE (stars, Stars, Nstars);
     1629  for (i = 0; i < Nstars; i++) {
     1630    InitStar (&stars[i]);
     1631    stars[i].measure.Xccd       = ps1data[i].X;
     1632    stars[i].measure.Yccd       = ps1data[i].Y;
     1633    stars[i].measure.dXccd      = ToShortPixels(ps1data[i].dX);
     1634    stars[i].measure.dYccd      = ToShortPixels(ps1data[i].dY);
     1635
     1636    stars[i].measure.posangle   = ToShortDegrees(ps1data[i].posangle);
     1637    stars[i].measure.pltscale   = ps1data[i].pltscale;
     1638
     1639    if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
     1640      stars[i].measure.M      = NAN;
     1641    } else {
     1642      stars[i].measure.M      = ps1data[i].M + ZeroPt;
     1643    }
     1644    stars[i].measure.dM         = ps1data[i].dM;
     1645    stars[i].measure.dMcal      = ps1data[i].dMcal;
     1646    stars[i].measure.Map        = ps1data[i].Map + ZeroPt;
     1647    stars[i].measure.dMap       = (ps1data[i].apFlux > 0.0) ? fabs(ps1data[i].apFluxErr / ps1data[i].apFlux) : NAN;
     1648                       
     1649    stars[i].measure.Mkron      = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN;
     1650    stars[i].measure.dMkron     = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN;
     1651                       
     1652    // these fluxes are converted from counts to counts/sec in FilterStars.c
     1653    stars[i].measure.FluxPSF    = GetFluxFromFluxOrMag (ps1data[i].Flux, ps1data[i].M);
     1654    stars[i].measure.dFluxPSF   = GetFluxErrFromFluxOrMag (ps1data[i].dFlux, stars[i].measure.FluxPSF, ps1data[i].dM);
     1655    stars[i].measure.FluxKron   = ps1data[i].kronFlux;
     1656    stars[i].measure.dFluxKron  = ps1data[i].kronFluxErr;
     1657    stars[i].measure.FluxAp     = GetFluxFromFluxOrMag (ps1data[i].apFlux, ps1data[i].Map);
     1658    stars[i].measure.dFluxAp    = GetFluxErrFromFluxOrMag (ps1data[i].apFluxErr, stars[i].measure.FluxAp, stars[i].measure.dMap);
     1659
     1660    stars[i].measure.Sky        = ps1data[i].sky;
     1661    stars[i].measure.dSky       = ps1data[i].dSky;
     1662                       
     1663    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
     1664    stars[i].measure.psfQF      = ps1data[i].psfQF;
     1665    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
     1666    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
     1667    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     1668    stars[i].measure.extNsigma  = ps1data[i].extNsigma;
     1669
     1670    stars[i].measure.FWx        = ToShortPixels(ps1data[i].fx);
     1671    stars[i].measure.FWy        = ToShortPixels(ps1data[i].fy);
     1672    stars[i].measure.theta      = ToShortDegrees(ps1data[i].df);
     1673
     1674    stars[i].measure.Mxx        = ToShortPixels(ps1data[i].Mxx);
     1675    stars[i].measure.Mxy        = ToShortPixels(ps1data[i].Mxy);
     1676    stars[i].measure.Myy        = ToShortPixels(ps1data[i].Myy);
     1677                       
     1678    stars[i].measure.photFlags  = ps1data[i].flags;
     1679    stars[i].measure.photFlags2 = ps1data[i].flags2;
     1680
     1681    // this is may optionally be replaced by the internal sequence (see FilterStars.c)
     1682    stars[i].measure.detID      = ps1data[i].detID;
     1683
     1684    // the Average fields and the following Measure fields are set in FilterStars after
     1685    // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID.
     1686
     1687    // averef is set in find_matches
     1688
     1689    // dbFlags is zero on ingest.
     1690
     1691    // the following fields are currently not being set anywhere: t_msec
     1692  }   
     1693  *nstars = Nstars;
     1694  return (stars);
     1695}
     1696
     1697
     1698
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/args_loadwise.c

    r33963 r37803  
    5353  }
    5454
     55enum {MODE_NONE, MODE_ALLWISE, MODE_ALLSKY, MODE_PRELIM};
     56int MODE;
     57
    5558  /* load the prelim data dump */
    56   ALLSKY = TRUE;
    57   if ((N = get_argument (argc, argv, "-prelim"))) {
    58     ALLSKY = FALSE;
     59  MODE = MODE_ALLWISE;
     60  if ((N = get_argument (argc, argv, "-mode"))) {
     61    MODE = MODE_NONE;
     62    remove_argument (N, &argc, argv);
     63    if (!strcasecmp(argv[N], "allwise")) MODE = MODE_ALLWISE;
     64    if (!strcasecmp(argv[N], "allsky"))  MODE = MODE_ALLSKY;
     65    if (!strcasecmp(argv[N], "prelim"))  MODE = MODE_PRELIM;
     66    if (MODE == MODE_NONE) {
     67      fprintf (stderr, "invalid mode: %s\n", argv[N]);
     68      exit (2);
     69    }
    5970    remove_argument (N, &argc, argv);
    6071  }
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadsupercos_plates.c

    r37386 r37803  
    9292    image[Nimage].Radius = NAN;
    9393   
    94     snprintf (image[Nimage].name, 121, "SCOS.%02d.%06d", survey_id, plate_id);
     94    snprintf (image[Nimage].name, DVO_IMAGE_NAME_LEN, "SCOS.%02d.%06d", survey_id, plate_id);
    9595    image[Nimage].imageID = Nimage + 1;
    9696    image[Nimage].externID = plate_id;
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadwise.c

    r33963 r37803  
    4040  for (i = 1; i < argc; i++) {
    4141      fprintf (stderr, "loading %s\n", argv[i]);
    42       loadwise_rawdata (skylist, argv[i], options, ALLSKY);
     42      loadwise_rawdata (skylist, argv[i], options);
    4343  }
    4444  exit (0);
  • branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadwise_rawdata.c

    r34088 r37803  
    1010# define DEBUG 0
    1111
    12 int loadwise_rawdata (SkyList *skytable, char *filename, AddstarClientOptions options, int ALLSKY) {
     12int loadwise_rawdata (SkyList *skytable, char *filename, AddstarClientOptions options) {
    1313 
    1414  int i, j, verbose;
     
    159159        stars[Nstars+3][0].average.D = tstars[j].D;
    160160       
    161         if (ALLSKY) {
    162           loadwise_star_allsky (&stars[Nstars], &buffer[offset], Nbyte - offset);
    163         } else {
    164           loadwise_star_prelim (&stars[Nstars], &buffer[offset], Nbyte - offset);
     161        switch (MODE) {
     162          case MODE_PRELIM:
     163            loadwise_star_prelim (&stars[Nstars], &buffer[offset], Nbyte - offset);
     164            break;
     165          case MODE_ALLSKY:
     166            loadwise_star_allsky (&stars[Nstars], &buffer[offset], Nbyte - offset);
     167            break;
     168          case MODE_ALLWISE:
     169          default:
     170            // loadwise_star_allwise (&stars[Nstars], &buffer[offset], Nbyte - offset);
     171            break;
    165172        }
    166173
  • branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/args.c

    r37790 r37803  
    5959
    6060  UPDATE_CATFORMAT = NULL;
    61   if ((N = get_argument (argc, argv, "-update-catformat"))) {
    62     remove_argument (N, &argc, argv);
     61  if ((N = get_argument (*argc, argv, "-update-catformat"))) {
     62    remove_argument (N, argc, argv);
    6363    UPDATE_CATFORMAT = strcreate (argv[N]);
    64     remove_argument (N, &argc, argv);
     64    remove_argument (N, argc, argv);
    6565  }
    6666
  • branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/build_links.c

    r37585 r37803  
    241241  for (i = 0; i < Naverage; i++) {
    242242    if (!average[i].Nlensing) continue;
     243    off_t m = average[i].lensingOffset;
     244    myAssert (lensing[m].averef == i, "not sorted");
    243245    for (j = 0; j < average[i].Nlensing - 1; j++, N++) {
     246      myAssert (lensing[m+j+1].averef == i, "not sorted");
    244247      next_lens[N] = N + 1;
    245248      if (N >= Nlensing) {
     
    329332  }
    330333
    331   if (m == -1) {
     334  // if Nlensing is 0, m may have been mis-set; add to the end
     335  if ((average[0].Nlensing == 0) || (m == -1)) {
    332336    average[0].lensingOffset = Nlensing;
    333337  } else {
     
    355359
    356360  /* fix order of Lensing (memory intensive, but fast) */
     361  np = -1;
    357362  N = 0;
    358363  ALLOCATE (tmplensing, Lensing, Nlensing);
  • branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/merge_catalogs_new.c

    r37585 r37803  
    1515  Naverage = output[0].Naverage;
    1616  Nmeasure = output[0].Nmeasure;
     17  Nlensing = output[0].Nlensing;
    1718
    1819  NsecfiltOut = output[0].Nsecfilt;
     
    2122  NAVERAGE = Naverage + 100;
    2223  NMEASURE = Nmeasure + 1000;
     24  NLENSING = Nlensing + 1000;
    2325
    2426  REALLOCATE (output[0].average, Average, NAVERAGE);
    2527  REALLOCATE (output[0].secfilt, SecFilt, NAVERAGE*NsecfiltOut);
    2628  REALLOCATE (output[0].measure, Measure, NMEASURE);
     29  REALLOCATE (output[0].lensing, Lensing, NLENSING);
    2730
    2831  // add all of these entries to the existing catalog
  • branches/eam_branches/ipp-20140904/Ohana/src/dvopsps/Makefile

    r35098 r37803  
    3030$(SRC)/insert_objects_dvopsps.$(ARCH).o \
    3131$(SRC)/insert_objects_dvopsps_catalog.$(ARCH).o \
     32$(SRC)/insert_FWobjects_dvopsps.$(ARCH).o \
     33$(SRC)/insert_FWobjects_dvopsps_catalog.$(ARCH).o \
    3234$(SRC)/insert_detections_dvopsps.$(ARCH).o \
    3335$(SRC)/insert_detections_dvopsps_catalog.$(ARCH).o
     
    4648$(SRC)/insert_objects_dvopsps.$(ARCH).o \
    4749$(SRC)/insert_objects_dvopsps_catalog.$(ARCH).o \
     50$(SRC)/insert_FWobjects_dvopsps.$(ARCH).o \
     51$(SRC)/insert_FWobjects_dvopsps_catalog.$(ARCH).o \
    4852$(SRC)/insert_detections_dvopsps.$(ARCH).o \
    4953$(SRC)/insert_detections_dvopsps_catalog.$(ARCH).o
  • branches/eam_branches/ipp-20140904/Ohana/src/dvopsps/include/dvopsps.h

    r37246 r37803  
    102102                                         
    103103int    insert_objects_mysql_create_tables PROTO((char *basename, MYSQL *mysql));
    104 
    105104int    insert_objects_mysql_commit        PROTO((IOBuffer *ave_buffer, IOBuffer *sec_buffer, MYSQL *mysql));
    106105int    insert_objects_mysql_value         PROTO((IOBuffer *ave_buffer, IOBuffer *sec_buffer, Average *average, SecFilt *secfilt, int Nsecfilt));
    107106int    insert_objects_mysql_init          PROTO((IOBuffer *ave_buffer, IOBuffer *sec_buffer, char *basename));
     107
     108int    insert_FWobjects_dvopsps             PROTO(());
     109int    insert_FWobjects_dvopsps_parallel    PROTO((SkyList *sky));
     110int    insert_FWobjects_dvopsps_catalog     PROTO((Catalog *catalog, char *basename, MYSQL *mysql));
     111                                         
     112int    insert_FWobjects_mysql_create_tables PROTO((char *basename, MYSQL *mysql));
     113int    insert_FWobjects_mysql_init          PROTO((IOBuffer *ave_buffer, IOBuffer *sec_buffer, IOBuffer *cpy_buffer, char *basename));
     114int    insert_FWobjects_mysql_value         PROTO((IOBuffer *ave_buffer, IOBuffer *sec_buffer, IOBuffer *cpy_buffer, Average *average, SecFilt *secfilt, int Nsecfilt, Lensobj *lensobj, int Nlensobj));
     115int    insert_FWobjects_mysql_commit        PROTO((IOBuffer *ave_buffer, IOBuffer *sec_buffer, IOBuffer *cpy_buffer, MYSQL *mysql));
    108116
    109117int    insert_skytable                    PROTO(());
  • branches/eam_branches/ipp-20140904/Ohana/src/dvopsps/src/dvopsps.c

    r35098 r37803  
    1414  if (!strcasecmp (argv[1], "objects")) {
    1515    status = insert_objects_dvopsps ();
     16  }
     17  if (!strcasecmp (argv[1], "forced_warp_objects")) {
     18    status = insert_FWobjects_dvopsps ();
    1619  }
    1720  if (!strcasecmp (argv[1], "skytable")) {
  • branches/eam_branches/ipp-20140904/Ohana/src/dvopsps/src/dvopsps_client.c

    r35111 r37803  
    2222    status = insert_objects_dvopsps ();
    2323  }
     24  if (!strcasecmp (argv[1], "forced_warp_objects")) {
     25    status = insert_FWobjects_dvopsps ();
     26  }
    2427  if (status == -1) {
    2528    fprintf (stderr, "invalid mode, should be : detections, skytable\n");
  • branches/eam_branches/ipp-20140904/Ohana/src/dvopsps/src/initialize_dvopsps.c

    r36188 r37803  
    2121  fprintf (stderr, "\n");
    2222
    23   fprintf (stderr, " (mode) is one of detections, objects, skytable\n");
     23  fprintf (stderr, " (mode) is one of detections, objects, forced_warp_objects, skytable\n");
    2424
    2525  fprintf (stderr, "\n");
  • branches/eam_branches/ipp-20140904/Ohana/src/getstar

  • branches/eam_branches/ipp-20140904/Ohana/src/kapa2/src/InterpretKeys.c

    r37781 r37803  
    5050    Z = -1;
    5151
    52     if (graph) {
     52    int haveGraph = graph && graph->haveGraph;
     53    if (haveGraph) {
    5354      X = (event[0].x - graph[0].axis[0].fx)*(graph[0].axis[0].max - graph[0].axis[0].min)/graph[0].axis[0].dfx + graph[0].axis[0].min;
    5455      Y = (event[0].y - graph[0].axis[1].fy)*(graph[0].axis[1].max - graph[0].axis[1].min)/graph[0].axis[1].dfy + graph[0].axis[1].min;
    5556      XY_to_RD (&R, &D, X, Y, &graph[0].data.coords);
    5657    }
    57     if (image && !graph) {
     58    if (image && !haveGraph) {
    5859      if (event[0].x < image[0].picture.x) goto skip_cursor;
    5960      if (event[0].y < image[0].picture.y) goto skip_cursor;
  • branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/cmf-ps1-v5-lensing.d

    r37034 r37803  
    33EXTNAME CMF_PS1_V5
    44TYPE    BINTABLE
    5 SIZE    312
     5SIZE    320
    66
    77# elements of data structure / FITS table
     
    8181FIELD E2_sh_psf,      E2_SH_PSF,         float,    lensing shear
    8282
     83FIELD srcChipNum,     SRC_CHIP_NUM,      short,    source chip in warp
     84FIELD srcChipX,       SRC_CHIP_X,        short,    source chip x coordinate
     85FIELD srcChipY,       SRC_CHIP_Y,        short,    source chip y coordinate
     86FIELD padding3,       SRC_CHIP_PAD,      short,    source chip in warp
     87
    8388FIELD Mr1,            MOMENTS_R1,        float,    first radial moment,   pixels
    8489FIELD Mrh,            MOMENTS_RH,        float,    half radial moment,    pixels^1/2
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/Makefile

    r37601 r37803  
    4242$(DESTINC)/cmf-ps1-v5.h \
    4343$(DESTINC)/cmf-ps1-sv3.h \
    44 $(DESTINC)/cmf-ps1-v5-lensing.h
     44$(DESTINC)/cmf-ps1-sv4.h \
     45$(DESTINC)/cmf-ps1-v5-lensing.h \
     46$(DESTINC)/cmf-ps1-v5-lensing-alt.h
    4547
    4648INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h $(DESTINC)/dvo_util.h $(DESTINC)/dvodb.h $(DESTINC)/libdvo_astro.h $(DESTINC)/convert.h $(DESTINC)/get_graphdata.h
     
    98100$(SRC)/cmf-ps1-dv3.$(ARCH).o \
    99101$(SRC)/cmf-ps1-sv3.$(ARCH).o \
     102$(SRC)/cmf-ps1-sv4.$(ARCH).o \
    100103$(SRC)/cmf-ps1-v5.$(ARCH).o \
    101104$(SRC)/cmf-ps1-v5-lensing.$(ARCH).o \
     105$(SRC)/cmf-ps1-v5-lensing-alt.$(ARCH).o \
    102106$(SRC)/dvo_util.$(ARCH).o \
    103107$(SRC)/dbBooleanCond.$(ARCH).o          \
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/cmf-ps1-v5-lensing.h

    r37035 r37803  
    7171  float            E2_sh_psf;            // lensing shear
    7272
     73  short            srcChipNum;
     74  short            srcChipX;
     75  short            srcChipY;
     76
    7377  float            Mr1;                  // first radial moment (pixels)
    7478  float            Mrh;                  // half radial moment (pixels^1/2)
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/dvo.h

    r37664 r37803  
    332332# include "cmf-ps1-dv3.h"
    333333# include "cmf-ps1-sv3.h"
     334# include "cmf-ps1-sv4.h"
    334335# include "cmf-ps1-v5.h"
    335336# include "cmf-ps1-v5-lensing.h"
     337# include "cmf-ps1-v5-lensing-alt.h"
    336338
    337339typedef struct {
     
    10551057# define LENSFIELD(NAME) float LensValue_##NAME (PhotCode *code, Lensobj *lensobj);
    10561058
    1057 LENSFIELD(X11_sm_obj);
    1058 LENSFIELD(X12_sm_obj);
    1059 LENSFIELD(X22_sm_obj);
    1060 LENSFIELD(E1_sm_obj);
    1061 LENSFIELD(E2_sm_obj);
    1062 
    1063 LENSFIELD(X11_sh_obj);
    1064 LENSFIELD(X12_sh_obj);
    1065 LENSFIELD(X22_sh_obj);
    1066 LENSFIELD(E1_sh_obj);
    1067 LENSFIELD(E2_sh_obj);
    1068 
    1069 LENSFIELD(X11_sm_psf);
    1070 LENSFIELD(X12_sm_psf);
    1071 LENSFIELD(X22_sm_psf);
    1072 LENSFIELD(E1_sm_psf);
    1073 LENSFIELD(E2_sm_psf);
    1074 
    1075 LENSFIELD(X11_sh_psf);
    1076 LENSFIELD(X12_sh_psf);
    1077 LENSFIELD(X22_sh_psf);
    1078 LENSFIELD(E1_sh_psf);
    1079 LENSFIELD(E2_sh_psf);
     1059LENSFIELD(X11_sm_obj)
     1060LENSFIELD(X12_sm_obj)
     1061LENSFIELD(X22_sm_obj)
     1062LENSFIELD(E1_sm_obj)
     1063LENSFIELD(E2_sm_obj)
     1064
     1065LENSFIELD(X11_sh_obj)
     1066LENSFIELD(X12_sh_obj)
     1067LENSFIELD(X22_sh_obj)
     1068LENSFIELD(E1_sh_obj)
     1069LENSFIELD(E2_sh_obj)
     1070
     1071LENSFIELD(X11_sm_psf)
     1072LENSFIELD(X12_sm_psf)
     1073LENSFIELD(X22_sm_psf)
     1074LENSFIELD(E1_sm_psf)
     1075LENSFIELD(E2_sm_psf)
     1076
     1077LENSFIELD(X11_sh_psf)
     1078LENSFIELD(X12_sh_psf)
     1079LENSFIELD(X22_sh_psf)
     1080LENSFIELD(E1_sh_psf)
     1081LENSFIELD(E2_sh_psf)
    10801082
    10811083# undef LENSFIELD
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/cmf-ps1-v5-lensing.c

    r37035 r37803  
    11# include "dvo.h"
    2 # define ST_SIZE 312
     2# define ST_SIZE 320
    33
    44// this function is based on the one generated by the autocode of cmf-ps1-v5.d
     
    100100    SWAP_WORD (256); // E1_SH_PSF
    101101    SWAP_WORD (260); // E2_SH_PSF
    102     SWAP_WORD (264); // MOMENTS_R1
    103     SWAP_WORD (268); // MOMENTS_RH
    104     SWAP_WORD (272); // KRON_FLUX
    105     SWAP_WORD (276); // KRON_FLUX_ERR
    106     SWAP_WORD (280); // KRON_FLUX_INNER
    107     SWAP_WORD (284); // KRON_FLUX_OUTER
    108     SWAP_WORD (288); // SKY_LIMIT_RAD
    109     SWAP_WORD (292); // SKY_LIMIT_FLUX
    110     SWAP_WORD (296); // SKY_LIMIT_SLOPE
    111     SWAP_WORD (300); // FLAGS
    112     SWAP_WORD (304); // FLAGS2
    113     SWAP_BYTE (308); // N_FRAMES
    114     SWAP_BYTE (310); // PADDING                       
     102
     103    SWAP_BYTE (264); // SRC_CHIP_NUM
     104    SWAP_BYTE (266); // SRC_CHIP_X
     105    SWAP_BYTE (268); // SRC_CHIP_Y
     106
     107    SWAP_WORD (272); // MOMENTS_R1
     108    SWAP_WORD (276); // MOMENTS_RH
     109    SWAP_WORD (280); // KRON_FLUX
     110    SWAP_WORD (284); // KRON_FLUX_ERR
     111    SWAP_WORD (288); // KRON_FLUX_INNER
     112    SWAP_WORD (292); // KRON_FLUX_OUTER
     113    SWAP_WORD (296); // SKY_LIMIT_RAD
     114    SWAP_WORD (300); // SKY_LIMIT_FLUX
     115    SWAP_WORD (304); // SKY_LIMIT_SLOPE
     116    SWAP_WORD (308); // FLAGS
     117    SWAP_WORD (312); // FLAGS2
     118    SWAP_BYTE (316); // N_FRAMES
     119    SWAP_BYTE (318); // PADDING                       
    115120  }
    116121# endif 
     
    289294  gfits_define_bintable_column (header, "E",    "E1_SH_PSF",        "lensing shear",                   "",                  1.0, 0.0);
    290295  gfits_define_bintable_column (header, "E",    "E2_SH_PSF",        "lensing shear",                   "",                  1.0, 0.0);
     296
     297  gfits_define_bintable_column (header, "I",    "SRC_CHIP_NUM",     "number of source chip for warp",  "",                  1.0, 0.0);
     298  gfits_define_bintable_column (header, "I",    "SRC_CHIP_X",       "x-coord in source chip",          "",                  1.0, 0.0);
     299  gfits_define_bintable_column (header, "I",    "SRC_CHIP_Y",       "y-coord in source chip",          "",                  1.0, 0.0);
     300  gfits_define_bintable_column (header, "I",    "PADDING3",         "padding for 8byte records",       "",                  1.0, 0.0);
     301
    291302  gfits_define_bintable_column (header, "E",    "MOMENTS_R1",       "first radial moment",             "pixels",            1.0, 0.0);
    292303  gfits_define_bintable_column (header, "E",    "MOMENTS_RH",       "half radial moment",              "pixels^1/2",        1.0, 0.0);
     
    385396  gfits_define_bintable_column (header, "E",    "E1_SH_PSF",        "lensing shear",                   "",                  1.0, 0.0);
    386397  gfits_define_bintable_column (header, "E",    "E2_SH_PSF",        "lensing shear",                   "",                  1.0, 0.0);
     398
     399  gfits_define_bintable_column (header, "I",    "SRC_CHIP_NUM",     "number of source chip for warp",  "",                  1.0, 0.0);
     400  gfits_define_bintable_column (header, "I",    "SRC_CHIP_X",       "x-coord in source chip",          "",                  1.0, 0.0);
     401  gfits_define_bintable_column (header, "I",    "SRC_CHIP_Y",       "y-coord in source chip",          "",                  1.0, 0.0);
     402  gfits_define_bintable_column (header, "I",    "PADDING3",         "padding for 8byte records",       "",                  1.0, 0.0);
     403
    387404  gfits_define_bintable_column (header, "E",    "MOMENTS_R1",       "first radial moment",             "pixels",            1.0, 0.0);
    388405  gfits_define_bintable_column (header, "E",    "MOMENTS_RH",       "half radial moment",              "pixels^1/2",        1.0, 0.0);
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/cmf-ps1-v5.c

    r37035 r37803  
    11# include "dvo.h"
     2# define ST_SIZE 232
    23
    34// this function is based on the one generated by the autocode of cmf-ps1-v5.d
     
    78  unsigned char tmp;
    89
    9   if (size != 232) {
    10     fprintf (stderr, "WARNING: mismatch in data types CMF_PS1_V5: "OFF_T_FMT" vs %d\n",  size,  232);
     10  if (size != ST_SIZE) {
     11    fprintf (stderr, "WARNING: mismatch in data types CMF_PS1_V5: "OFF_T_FMT" vs %d\n",  size,  ST_SIZE);
    1112    return (FALSE);
    1213  }
     
    3334# ifdef BYTE_SWAP
    3435  byte = (unsigned char *) data;
    35   for (i = 0; i < nitems; i++, byte += 232) {
     36  for (i = 0; i < nitems; i++, byte += ST_SIZE) {
    3637    /** BYTE SWAP **/
    3738    SWAP_WORD (0); // IPP_IDET                     
     
    176177
    177178  Ncols = ftable[0].header[0].Naxis[0];
    178   if (Ncols != 232) {
    179     fprintf (stderr, "ERROR: mis-match in table size: width is %d but should be %d bytes\n", Ncols, 232);
     179  if (Ncols != ST_SIZE) {
     180    fprintf (stderr, "ERROR: mis-match in table size: width is %d but should be %d bytes\n", Ncols, ST_SIZE);
    180181    return NULL;
    181182  }
  • branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/setMrelCatalog.c

    r37743 r37803  
    520520      haveStackObject = TRUE;
    521521     
    522       // match measurement to its image (this is just a check, right?)
    523       if (getImageEntry (meas, cat) < 0) {
    524         fprintf (stderr, "*** warning : this should be impossible\n");
    525         abort();
    526         continue;
    527       }
    528 
    529522      // find the PRIMARY measurement
    530523
     
    546539      // overlaps).  we only want measurements associated with stack images in this loop
    547540
    548       Mcal  = getMcal_alt  (meas, cat, flatcorr, measure[k].Xccd, measure[k].Yccd);
    549       if (isnan(Mcal))  SKIP_THIS_MEAS_STACK(Ncal);
    550       Mmos  = getMmos  (meas, cat);
    551       if (isnan(Mmos))  SKIP_THIS_MEAS_STACK(Nmos);
    552       Mgrid = getMgrid (meas, cat);
    553       if (isnan(Mgrid)) SKIP_THIS_MEAS_STACK(Ngrid);
     541      // match measurement to its image (this is just a check, right?)
     542      if (getImageEntry (meas, cat) < 0) {
     543        // measurements without an image are either external reference photometry or
     544        // data for which the associated image has not been loaded (probably because of
     545        // overlaps).  Msys + measure.Mcal is our best guess of the true magnitude
     546        Mmos = Mgrid = 0;
     547        Mcal = measure[k].Mcal; // check that this is zero for loaded REF value
     548      } else {
     549        Mcal  = getMcal_alt  (meas, cat, flatcorr, measure[k].Xccd, measure[k].Yccd);
     550        if (isnan(Mcal))  SKIP_THIS_MEAS_STACK(Ncal);
     551        Mmos  = getMmos  (meas, cat);
     552        if (isnan(Mmos))  SKIP_THIS_MEAS_STACK(Nmos);
     553        Mgrid = getMgrid (meas, cat);
     554        if (isnan(Mgrid)) SKIP_THIS_MEAS_STACK(Ngrid);
     555      }
    554556
    555557      // NOTE: negative and insignificant vlues values are allowed, but not NAN flux values
Note: See TracChangeset for help on using the changeset viewer.