IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35316


Ignore:
Timestamp:
Mar 17, 2013, 6:16:50 AM (13 years ago)
Author:
eugene
Message:

add structures to addstar ps1-dv3

Location:
branches/eam_branches/ipp-20130307/Ohana/src
Files:
6 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307/Ohana/src/addstar/src/GetFileMode.c

    r35108 r35316  
    2020  havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, ctmp);
    2121  haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, ctmp);
    22   if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ;
     22  if (havePHOT_VER && haveTARG_VER) {
     23    if (VERBOSE) fprintf (stderr, "found SDSS objects\n");
     24    return SDSS_OBJ;
     25  }
    2326
    2427  if (haveNaxis && (Naxis == 2)) {
     
    2831    if ((Nx > 0) && (Ny > 0)) {
    2932      if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) {
     33        if (VERBOSE) fprintf (stderr, "found MOSAIC CMP\n");
    3034        return MOSAIC_CMP;
    3135      }
     36      if (VERBOSE) fprintf (stderr, "found SIMPLE CMP\n");
    3237      return SIMPLE_CMP;
    3338    }
     
    3641  if (haveNaxis && (TEXTMODE || !simple)) {
    3742    if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) {
     43      if (VERBOSE) fprintf (stderr, "found MOSAIC CMP\n");
    3844      return MOSAIC_CMP;
    3945    }
     46    if (VERBOSE) fprintf (stderr, "found SIMPLE CMP\n");
    4047    return SIMPLE_CMP;
    4148  }
     
    4350  if (!extend && strcmp (&ctype[4], "-DIS")) {
    4451    if (!strcmp (&ctype[4], "-WRP")) {
     52      if (VERBOSE) fprintf (stderr, "found MOSAIC CMF\n");
    4553      return MOSAIC_CMF;
    4654    }
     55    if (VERBOSE) fprintf (stderr, "found SIMPLE CMF\n");
    4756    return SIMPLE_CMF;
    4857  }
    4958
    5059  if (!extend && !strcmp (&ctype[4], "-DIS")) {
     60    if (VERBOSE) fprintf (stderr, "found MOSAIC PHU\n");
    5161    return MOSAIC_PHU;
    5262  }
    5363
    5464  if (extend && strcmp (&ctype[4], "-DIS")) {
     65    if (VERBOSE) fprintf (stderr, "found SIMPLE MEF\n");
    5566    return SIMPLE_MEF;
    5667  }
    5768
    5869  if (extend && !strcmp (&ctype[4], "-DIS")) {
     70    if (VERBOSE) fprintf (stderr, "found MOSAIC MEF\n");
    5971    return MOSAIC_MEF;
    6072  }
    6173
     74  if (VERBOSE) fprintf (stderr, "extension type is unknown\n");
    6275  return (NONE);
    6376}
  • branches/eam_branches/ipp-20130307/Ohana/src/addstar/src/MatchHeaders.c

    r34405 r35316  
    6161    if (!strcmp (exttype, "PS1_SV1")) goto keep;
    6262    if (!strcmp (exttype, "PS1_SV2")) goto keep;
     63    if (!strcmp (exttype, "PS1_DV3")) {
     64      fprintf (stderr, "exttype, ..%s..\n", exttype);
     65      goto keep;
     66    }
     67    fprintf (stderr, "exttype, ..%s..\n", exttype);
    6368    continue;
    6469
  • branches/eam_branches/ipp-20130307/Ohana/src/addstar/src/ReadStarsFITS.c

    r34580 r35316  
    1515Stars     *Convert_PS1_SV1_Alt    PROTO((FTable *table, unsigned int *nstars));
    1616Stars     *Convert_PS1_SV2        PROTO((FTable *table, unsigned int *nstars));
     17Stars     *Convert_PS1_DV3        PROTO((FTable *table, unsigned int *nstars));
    1718
    1819// given a file with the pointer at the start of the table block and the
     
    7879    stars = Convert_PS1_SV2 (&table, &Nstars);
    7980  }
     81  if (!strcmp (type, "PS1_DV3")) {
     82    stars = Convert_PS1_DV3 (&table, &Nstars);
     83  }
    8084  if (stars == NULL) {
    8185    fprintf (stderr, "invalid table type %s\n", type);
     
    962966}
    963967
    964 
     968Stars *Convert_PS1_DV3 (FTable *table, unsigned int *nstars) {
     969
     970  off_t Nstars;
     971  unsigned int i;
     972  double ZeroPt;
     973  Stars *stars;
     974  CMF_PS1_DV3 *ps1data;
     975
     976  ps1data = gfits_table_get_CMF_PS1_DV3 (table, &Nstars, NULL);
     977  if (!ps1data) {
     978    fprintf (stderr, "skipping inconsistent entry\n");
     979    return (NULL);
     980  }
     981  ZeroPt = GetZeroPoint();
     982
     983  ALLOCATE (stars, Stars, Nstars);
     984  for (i = 0; i < Nstars; i++) {
     985    InitStar (&stars[i]);
     986    stars[i].measure.Xccd       = ps1data[i].X;
     987    stars[i].measure.Yccd       = ps1data[i].Y;
     988    stars[i].measure.dXccd      = ToShortPixels(ps1data[i].dX);
     989    stars[i].measure.dYccd      = ToShortPixels(ps1data[i].dY);
     990
     991    stars[i].measure.posangle   = ToShortDegrees(ps1data[i].posangle);
     992    stars[i].measure.pltscale   = ps1data[i].pltscale;
     993
     994    if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
     995      stars[i].measure.M      = NAN;
     996    } else {
     997      stars[i].measure.M      = ps1data[i].M + ZeroPt;
     998    }
     999    stars[i].measure.dM         = ps1data[i].dM;
     1000    stars[i].measure.dMcal      = ps1data[i].dMcal;
     1001    stars[i].measure.Map        = ps1data[i].Map + ZeroPt;
     1002                       
     1003    stars[i].measure.Mkron      = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN;
     1004    stars[i].measure.dMkron     = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN;
     1005                       
     1006    // these fluxes are converted from counts to counts/sec in FilterStars.c
     1007    stars[i].measure.FluxPSF    = ps1data[i].Flux;
     1008    stars[i].measure.dFluxPSF   = ps1data[i].dFlux;
     1009    stars[i].measure.FluxKron   = ps1data[i].kronFlux;
     1010    stars[i].measure.dFluxKron  = ps1data[i].kronFluxErr;
     1011
     1012    stars[i].measure.Sky        = ps1data[i].sky;
     1013    stars[i].measure.dSky       = ps1data[i].dSky;
     1014                       
     1015    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
     1016    stars[i].measure.psfQF      = ps1data[i].psfQF;
     1017    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
     1018    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
     1019    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     1020    stars[i].measure.crNsigma   = ps1data[i].crNsigma;
     1021    stars[i].measure.extNsigma  = ps1data[i].extNsigma;
     1022
     1023    stars[i].measure.FWx        = ToShortPixels(ps1data[i].fx);
     1024    stars[i].measure.FWy        = ToShortPixels(ps1data[i].fy);
     1025    stars[i].measure.theta      = ToShortDegrees(ps1data[i].df);
     1026
     1027    stars[i].measure.Mxx        = ToShortPixels(ps1data[i].Mxx);
     1028    stars[i].measure.Mxy        = ToShortPixels(ps1data[i].Mxy);
     1029    stars[i].measure.Myy        = ToShortPixels(ps1data[i].Myy);
     1030                       
     1031    stars[i].measure.photFlags  = ps1data[i].flags;
     1032
     1033    // this is may optionally be replaced by the internal sequence (see FilterStars.c)
     1034    stars[i].measure.detID      = ps1data[i].detID;
     1035
     1036    // the Average fields and the following Measure fields are set in FilterStars after
     1037    // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID.
     1038
     1039    // averef is set in find_matches
     1040
     1041    // dbFlags is zero on ingest.
     1042
     1043    // the following fields are currently not being set anywhere: t_msec
     1044  }   
     1045  *nstars = Nstars;
     1046  return (stars);
     1047}
     1048
     1049
     1050
  • branches/eam_branches/ipp-20130307/Ohana/src/libdvo/Makefile

    r35263 r35316  
    3636$(DESTINC)/ps1_v3_defs.h \
    3737$(DESTINC)/ps1_v4_defs.h \
    38 $(DESTINC)/ps1_ref_defs.h
     38$(DESTINC)/ps1_ref_defs.h \
     39$(DESTINC)/cmf-ps1-dv3.h
    3940
    4041INCS = $(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
     
    8485$(SRC)/cmf-ps1-v1-alt.$(ARCH).o \
    8586$(SRC)/cmf-ps1-sv1-alt.$(ARCH).o \
     87$(SRC)/cmf-ps1-dv3.$(ARCH).o \
    8688$(SRC)/dvo_util.$(ARCH).o \
    8789$(SRC)/dbBooleanCond.$(ARCH).o          \
  • branches/eam_branches/ipp-20130307/Ohana/src/libdvo/include/dvo.h

    r35102 r35316  
    288288CMF_PS1_SV1 *gfits_table_get_CMF_PS1_SV1_Alt (FTable *ftable, off_t *Ndata, char *swapped);
    289289
     290// another special case : does not match byte-boundaries
     291# include "cmf-ps1-dv3.h"
     292
    290293typedef struct {
    291294  int Ncode;                                      // number of photcodes
  • branches/eam_branches/ipp-20130307/Ohana/src/opihi/cmd.data/Makefile

    r35237 r35316  
    150150$(SRC)/vsmooth.$(ARCH).o           \
    151151$(SRC)/vstats.$(ARCH).o            \
     152$(SRC)/xsection.$(ARCH).o          \
    152153$(SRC)/wd.$(ARCH).o                \
    153154$(SRC)/write_vectors.$(ARCH).o     \
  • branches/eam_branches/ipp-20130307/Ohana/src/opihi/cmd.data/init.c

    r35237 r35316  
    141141int wd               PROTO((int, char **));
    142142int write_vectors    PROTO((int, char **));
     143int xsection         PROTO((int, char **));
    143144int zap              PROTO((int, char **));
    144145int zplot            PROTO((int, char **));
     
    299300  {1, "wd",           wd,               "write an image to a file"},
    300301  {1, "write",        write_vectors,    "write vectors to datafile"},
     302  {1, "xsection",     xsection,         "generate cross-section histogram for an image (or region)"},
    301303  {1, "zap",          zap,              "assign values to pixel regions"},
    302304  {1, "zplot",        zplot,            "plot x y with size scaled by z"},
Note: See TracChangeset for help on using the changeset viewer.