IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 1, 2014, 4:08:42 PM (12 years ago)
Author:
eugene
Message:

merge changes from tags/ipp-pv3-20140717 (dvolens, addstar mods for lensing / apflux)

Location:
branches/eam_branches/ipp-20140813/Ohana
Files:
19 edited
17 copied

Legend:

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

  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/Makefile

    r37116 r37344  
    8686$(SRC)/ReadStarsTEXT.$(ARCH).o \
    8787$(SRC)/ReadStarsSDSS.$(ARCH).o \
     88$(SRC)/ReadXradFITS.$(ARCH).o \
    8889$(SRC)/FilterStars.$(ARCH).o \
    8990$(SRC)/ImageOptions.$(ARCH).o \
  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/include/addstar.h

    r37116 r37344  
    3535  char *exthead;
    3636  char *extdata;
     37  char *extxrad;
    3738  char *exttype;
    3839  int extnum_head;
    3940  int extnum_data;
     41  int extnum_xrad;
    4042} HeaderSet;
    4143
     
    146148
    147149int     OLD_RESORT;
     150int     READ_XRAD_DATA;
    148151
    149152int    PARALLEL;
     
    250253Stars     *FilterStars            PROTO((Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options));
    251254Stars     *MergeStars             PROTO((Stars *stars, unsigned int *Nstars, Stars *instars, unsigned int Ninstars));
     255
     256int        ReadXradFITS           PROTO((FILE *f, Header *theader, Stars *stars, unsigned int Nstars));
     257
    252258double     scat_subpix            PROTO((double x, double y));
    253259void       update_coords          PROTO((Average *average, Measure *measure, off_t *next));
  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/FilterStars.c

    r37036 r37344  
    99
    1010// the imageID supplied here is the sequence **within this set**
    11 // this value is updated based on the image table later
     11// this value is updated based on the image table later (in UpdateImageIDs)
    1212Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options) {
    1313
     
    127127    stars[N].measure.imageID = imageID; // this value is updated in UpdateImageIDs
    128128
     129    // add imageID to lensing entry, if it exists
     130    if (stars[N].lensing) {
     131      stars[N].lensing->imageID = imageID;
     132    }
     133
    129134    N ++;
    130135  }
  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/LoadData.c

    r34088 r37344  
    8383      continue;
    8484    }
     85
     86    // XRAD : if we want to read the xrad table, skip to that table here:
     87    if (headerSets[i].extnum_xrad != -1) {
     88      int Nxrad = headerSets[i].extnum_xrad;
     89      Nskip = 0;
     90      for (j = 0; j < Nxrad; j++) {
     91        Nskip += extsize[j];
     92      }
     93      fseeko (f, Nskip, SEEK_SET);
     94     
     95      if (!ReadXradFITS (f, headers[Nxrad], inStars, images[0][Nvalid].nstar)) {
     96        fprintf (stderr, "problem reading the radial flux data for %s\n", headerSets[i].extdata);
     97      }
     98    }
     99
    85100    inStars = FilterStars (inStars, &images[0][Nvalid], Nvalid, options);
    86101    *stars = MergeStars (*stars, Nstars, inStars, images[0][Nvalid].nstar);
  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/MatchHeaders.c

    r37054 r37344  
    7979    headerSets[Nimage].extdata     = strcreate (extname);
    8080    headerSets[Nimage].exthead     = strcreate (exthead);
     81    headerSets[Nimage].extxrad     = NULL;
    8182    headerSets[Nimage].extnum_data = i;
    8283    headerSets[Nimage].extnum_head = -1;
     84    headerSets[Nimage].extnum_xrad = -1;
     85
     86    // XXX a special case for fforce xrad data
     87    if (READ_XRAD_DATA) {
     88      // extname is foobar.psf, convert to foobar.xrad
     89      int Nchar = strlen (extname); // foobar.psf : Nchar = 10
     90      ALLOCATE (headerSets[Nimage].extxrad, char, Nchar + 2); // xrad is 1 longer than psf
     91      memcpy   (headerSets[Nimage].extxrad, extname, Nchar - 3); // Nchar - 3 = 7
     92      memcpy  (&headerSets[Nimage].extxrad[Nchar-3], "xrad", 4);
     93      headerSets[Nimage].extxrad[Nchar + 1] = 0; // put the 0 at element 11 for foobar.xrad\0
     94    }
    8395
    8496    // find the matching exthead entry
    8597    for (j = 0; j < Nheaders; j++) {
    8698      if (!gfits_scan (headers[j], ExtnameKeyword, "%s", 1, extname)) continue;
    87       if (strcmp (extname, headerSets[Nimage].exthead)) continue;
    88       headerSets[Nimage].extnum_head = j;
    89       break;
     99      if (!strcmp (extname, headerSets[Nimage].exthead)) {
     100        headerSets[Nimage].extnum_head = j;
     101        if (!READ_XRAD_DATA) break;
     102      }
     103      if (READ_XRAD_DATA && !strcmp (extname, headerSets[Nimage].extxrad)) {
     104        headerSets[Nimage].extnum_xrad = j;
     105      }
     106      if ((headerSets[Nimage].extnum_head > -1) && (headerSets[Nimage].extnum_xrad > -1)) {
     107        // we can only get here if READ_XRAD_DATA is true
     108        break;
     109      }
    90110    }
    91111
  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/UpdateImageIDs.c

    r35579 r37344  
    5555  for (i = 0; i < Nstars; i++) {
    5656    stars[i].measure.imageID += imageID;
     57    if (stars[i].lensing) {
     58      stars[i].lensing->imageID += imageID;
     59    }
    5760  }
    5861
  • branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/args.c

    r37116 r37344  
    8181    PMM_CCD_TABLE = strcreate (argv[N]);
    8282    remove_argument (N, &argc, argv);
     83  }
     84
     85  READ_XRAD_DATA = FALSE;
     86  if ((N = get_argument (argc, argv, "-xrad"))) {
     87    remove_argument (N, &argc, argv);
     88    READ_XRAD_DATA = TRUE;
    8389  }
    8490
  • branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_detections_dvopsps.c

    r37308 r37344  
    6868    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    6969
    70     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
     70    if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "r")) {
    7171      fprintf (stderr, "ERROR: failure reading catalog %s\n", catalog.filename);
    7272      exit (1);
  • branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_objects_dvopsps.c

    r35098 r37344  
    5656    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    5757
    58     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
     58    if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "r")) {
    5959      fprintf (stderr, "ERROR: failure reading catalog %s\n", catalog.filename);
    6060      exit (1);
  • branches/eam_branches/ipp-20140813/Ohana/src/getstar

  • branches/eam_branches/ipp-20140813/Ohana/src/getstar/src/getstar.c

    r31669 r37344  
    1414  set_db (&db);
    1515
    16   sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);
     16  sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, FALSE, SKY_DEPTH, VERBOSE);
    1717  if (!sky) exit (1);
    1818   
  • branches/eam_branches/ipp-20140813/Ohana/src/libautocode/def/lensing-ps1-v5.d

    r37034 r37344  
    22EXTNAME      DVO_LENSING_PS1_V5
    33TYPE         BINTABLE
    4 SIZE         128
     4SIZE         136
    55DESCRIPTION  DVO Lensing Table
    66
     
    4444FIELD  averef,         AVE_REF,      unsigned int,   reference to average entry     
    4545
     46FIELD imageID,         IMAGE_ID,     unsigned int,   reference to DVO image ID
     47FIELD padding,         PADDING,      unsigned int,   reference to DVO image ID
     48
    4649# 28 x float
    4750# 4 x int
  • branches/eam_branches/ipp-20140813/Ohana/src/libautocode/def/lensing.d

    r37034 r37344  
    22EXTNAME      DVO_LENSING
    33TYPE         BINTABLE
    4 SIZE         128
     4SIZE         136
    55DESCRIPTION  DVO Lensing Table
    66
     
    3939FIELD fF_ApR6,       FLUX_AP_R6,     float,          Flux inside r = 6
    4040
    41 FIELD   detID,          DET_ID,       unsigned int,   detection ID
    42 FIELD   objID,          OBJ_ID,       unsigned int,   unique ID for object in table
    43 FIELD   catID,          CAT_ID,       unsigned int,   unique ID for table in which object was first realized
    44 FIELD  averef,         AVE_REF,       unsigned int,   reference to average entry     
     41FIELD   detID,          DET_ID,      int,            detection ID
     42FIELD   objID,          OBJ_ID,      int,            unique ID for object in table
     43FIELD   catID,          CAT_ID,      int,            unique ID for table in which object was first realized
     44FIELD  averef,         AVE_REF,      int,            reference to average entry     
     45
     46FIELD imageID,         IMAGE_ID,     int,            reference to DVO image ID
     47FIELD padding,         PADDING,      int,            padding
    4548
    4649# 28 x float
    47 # 4 x int
    48 # = 128 bytes / detection
     50# 5 x int + padding
     51# = 136 bytes / detection
    4952# for 2.5G objects + 60 overlaps, expect 15TB for forced warp
  • branches/eam_branches/ipp-20140813/Ohana/src/libautocode/def/lensobj-ps1-v5.d

    r37034 r37344  
    4343FIELD     E2,               E2,      float
    4444
    45 FIELD  objID,          OBJ_ID,       unsigned int,   unique ID for object in table
    46 FIELD  catID,          CAT_ID,       unsigned int,   unique ID for table in which object was first realized
    47 FIELD    pad,             PAD,       int
     45FIELD    objID,          OBJ_ID,       unsigned int,   unique ID for object in table
     46FIELD    catID,          CAT_ID,       unsigned int,   unique ID for table in which object was first realized
     47FIELD photcode,         PHOTCODE,    short
     48FIELD    Nmeas,            NMEAS,    short
    4849
    4950# 31 x float
  • branches/eam_branches/ipp-20140813/Ohana/src/libautocode/def/lensobj.d

    r37034 r37344  
    2929FIELD  E2_sh_psf,      E2_SH_PSF,    float,          mean lensing shear psf stars E2
    3030
    31 FIELD F_ApR5,        FLUX_AP_R5,     float,          Flux inside r = 5
    32 FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          Flux inside r = 5
    33 FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          Flux inside r = 5
    34 FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          Flux inside r = 5
     31FIELD     F_ApR5,    FLUX_AP_R5,     float,          Flux inside r = 5
     32FIELD    dF_ApR5,    FLUX_ERR_AP_R5, float,          Flux inside r = 5
     33FIELD    sF_ApR5,    FLUX_STD_AP_R5, float,          Flux inside r = 5
     34FIELD    fF_ApR5,    FLUX_FIL_AP_R5, float,          Flux inside r = 5
    3535
    36 FIELD F_ApR6,        FLUX_AP_R6,     float,          Flux inside r = 5
    37 FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          Flux inside r = 5
    38 FIELD sF_ApR6,       FLUX_AP_R6,     float,          Flux inside r = 5
    39 FIELD fF_ApR6,       FLUX_AP_R6,     float,          Flux inside r = 5
     36FIELD     F_ApR6,    FLUX_AP_R6,     float,          Flux inside r = 5
     37FIELD    dF_ApR6,    FLUX_ERR_AP_R6, float,          Flux inside r = 5
     38FIELD    sF_ApR6,    FLUX_AP_R6,     float,          Flux inside r = 5
     39FIELD    fF_ApR6,    FLUX_AP_R6,     float,          Flux inside r = 5
    4040
    41 FIELD  gamma,            GAMMA,      float
    42 FIELD     E1,               E1,      float
    43 FIELD     E2,               E2,      float
     41FIELD      gamma,        GAMMA,      float
     42FIELD         E1,           E1,      float
     43FIELD         E2,           E2,      float
    4444
    45 FIELD  objID,          OBJ_ID,       unsigned int,   unique ID for object in table
    46 FIELD  catID,          CAT_ID,       unsigned int,   unique ID for table in which object was first realized
    47 FIELD    pad,             PAD,       int
     45FIELD    objID,           OBJ_ID,    unsigned int,   unique ID for object in table
     46FIELD    catID,           CAT_ID,    unsigned int,   unique ID for table in which object was first realized
     47FIELD photcode,         PHOTCODE,    short
     48FIELD    Nmeas,            NMEAS,    short
    4849
    4950# 31 x float
  • branches/eam_branches/ipp-20140813/Ohana/src/libdvo/include/dvo.h

    r37246 r37344  
    10391039
    10401040void dvo_lensing_init (Lensing *lensing);
    1041 void dvo_lensobj_init (Lensobj *lensobj);
     1041void dvo_lensobj_init (Lensobj *lensobj, int toZero);
    10421042
    10431043void InitRegionHosts (RegionHostInfo *hosts, int Nhosts, int NHOSTS);
  • branches/eam_branches/ipp-20140813/Ohana/src/libdvo/src/dvo_catalog.c

    r37246 r37344  
    389389  lensing->catID = -1;
    390390  lensing->averef = 0;
     391
     392  lensing->imageID = -1;
     393  lensing->padding = 0;
    391394}
    392395
    393396// init all data, or just catalog data
    394 void dvo_lensobj_init (Lensobj *lensobj) {
    395   lensobj->X11_sm_obj = NAN;
    396   lensobj->X12_sm_obj = NAN;
    397   lensobj->X22_sm_obj = NAN;
    398   lensobj->E1_sm_obj  = NAN;
    399   lensobj->E2_sm_obj  = NAN;
    400 
    401   lensobj->X11_sh_obj = NAN;
    402   lensobj->X12_sh_obj = NAN;
    403   lensobj->X22_sh_obj = NAN;
    404   lensobj->E1_sh_obj  = NAN;
    405   lensobj->E2_sh_obj  = NAN;
    406 
    407   lensobj->X11_sm_psf = NAN;
    408   lensobj->X12_sm_psf = NAN;
    409   lensobj->X22_sm_psf = NAN;
    410   lensobj->E1_sm_psf  = NAN;
    411   lensobj->E2_sm_psf  = NAN;
    412 
    413   lensobj->X11_sh_psf = NAN;
    414   lensobj->X12_sh_psf = NAN;
    415   lensobj->X22_sh_psf = NAN;
    416   lensobj->E1_sh_psf  = NAN;
    417   lensobj->E2_sh_psf  = NAN;
    418 
    419   lensobj->F_ApR5     = NAN;
    420   lensobj->dF_ApR5    = NAN;
    421   lensobj->sF_ApR5    = NAN;
    422   lensobj->fF_ApR5    = NAN;
    423 
    424   lensobj->F_ApR6     = NAN;
    425   lensobj->dF_ApR6    = NAN;
    426   lensobj->sF_ApR6    = NAN;
    427   lensobj->fF_ApR6    = NAN;
     397void dvo_lensobj_init (Lensobj *lensobj, int toZero) {
     398  lensobj->X11_sm_obj = toZero ? 0 : NAN;
     399  lensobj->X12_sm_obj = toZero ? 0 : NAN;
     400  lensobj->X22_sm_obj = toZero ? 0 : NAN;
     401  lensobj->E1_sm_obj  = toZero ? 0 : NAN;
     402  lensobj->E2_sm_obj  = toZero ? 0 : NAN;
     403  lensobj->X11_sh_obj = toZero ? 0 : NAN;
     404  lensobj->X12_sh_obj = toZero ? 0 : NAN;
     405  lensobj->X22_sh_obj = toZero ? 0 : NAN;
     406  lensobj->E1_sh_obj  = toZero ? 0 : NAN;
     407  lensobj->E2_sh_obj  = toZero ? 0 : NAN;
     408  lensobj->X11_sm_psf = toZero ? 0 : NAN;
     409  lensobj->X12_sm_psf = toZero ? 0 : NAN;
     410  lensobj->X22_sm_psf = toZero ? 0 : NAN;
     411  lensobj->E1_sm_psf  = toZero ? 0 : NAN;
     412  lensobj->E2_sm_psf  = toZero ? 0 : NAN;
     413  lensobj->X11_sh_psf = toZero ? 0 : NAN;
     414  lensobj->X12_sh_psf = toZero ? 0 : NAN;
     415  lensobj->X22_sh_psf = toZero ? 0 : NAN;
     416  lensobj->E1_sh_psf  = toZero ? 0 : NAN;
     417  lensobj->E2_sh_psf  = toZero ? 0 : NAN;
     418  lensobj->F_ApR5     = toZero ? 0 : NAN;
     419  lensobj->dF_ApR5    = toZero ? 0 : NAN;
     420  lensobj->sF_ApR5    = toZero ? 0 : NAN;
     421  lensobj->fF_ApR5    = toZero ? 0 : NAN;
     422  lensobj->F_ApR6     = toZero ? 0 : NAN;
     423  lensobj->dF_ApR6    = toZero ? 0 : NAN;
     424  lensobj->sF_ApR6    = toZero ? 0 : NAN;
     425  lensobj->fF_ApR6    = toZero ? 0 : NAN;
    428426
    429427  lensobj->gamma = NAN;
     
    434432  lensobj->catID = -1;
    435433
    436   lensobj->pad = 0;
     434  lensobj->photcode = 0;
     435  lensobj->Nmeas = 0;
    437436}
    438437
  • branches/eam_branches/ipp-20140813/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c

    r37246 r37344  
    491491
    492492    out[i].averef      = in[i].averef;
     493
     494    out[i].imageID     = in[i].imageID;
    493495  }
    494496  return (out);
     
    543545
    544546    out[i].averef      = in[i].averef;
     547    out[i].imageID     = in[i].imageID;
    545548  }
    546549  return (out);
     
    555558
    556559  for (i = 0; i < Nvalues; i++) {
    557     dvo_lensobj_init (&out[i]);
     560    dvo_lensobj_init (&out[i], FALSE);
    558561
    559562    out[i].X11_sm_obj  = in[i].X11_sm_obj;     
     
    598601    out[i].catID       = in[i].catID;
    599602
     603    out[i].photcode    = in[i].photcode;
     604    out[i].Nmeas       = in[i].Nmeas;
    600605  }
    601606  return (out);
     
    651656    out[i].objID       = in[i].objID;
    652657    out[i].catID       = in[i].catID;
     658
     659    out[i].photcode    = in[i].photcode;
     660    out[i].Nmeas       = in[i].Nmeas;
    653661  }
    654662  return (out);
Note: See TracChangeset for help on using the changeset viewer.