IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38153 for trunk


Ignore:
Timestamp:
Apr 18, 2015, 6:33:51 AM (11 years ago)
Author:
eugene
Message:

merge changes from eam branch ipp-20150405: add R7 to lensing, fix R5,R6,R7 definitions and mean photometry; calculate E1,E2 in dvolens; fix precision for dvopsps FW objects; fix histograms at axis; new colormap options; require primary skycell in diff mean photometry

Location:
trunk
Files:
1 deleted
35 edited
6 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/Ohana/src/addstar/src/FilterStars.c

    r37357 r38153  
    105105      stars[N].measure.dFluxAp /= image[0].exptime;
    106106    }
     107    if (stars[N].lensing) {
     108      if (!isnan(stars[N].lensing-> F_ApR5)) stars[N].lensing-> F_ApR5 /= image[0].exptime;
     109      if (!isnan(stars[N].lensing->dF_ApR5)) stars[N].lensing->dF_ApR5 /= image[0].exptime;
     110      if (!isnan(stars[N].lensing->sF_ApR5)) stars[N].lensing->sF_ApR5 /= image[0].exptime;
     111      if (!isnan(stars[N].lensing->fF_ApR5)) stars[N].lensing->fF_ApR5 /= image[0].exptime;
     112
     113      if (!isnan(stars[N].lensing-> F_ApR6)) stars[N].lensing-> F_ApR6 /= image[0].exptime;
     114      if (!isnan(stars[N].lensing->dF_ApR6)) stars[N].lensing->dF_ApR6 /= image[0].exptime;
     115      if (!isnan(stars[N].lensing->sF_ApR6)) stars[N].lensing->sF_ApR6 /= image[0].exptime;
     116      if (!isnan(stars[N].lensing->fF_ApR6)) stars[N].lensing->fF_ApR6 /= image[0].exptime;
     117
     118      if (!isnan(stars[N].lensing-> F_ApR7)) stars[N].lensing-> F_ApR7 /= image[0].exptime;
     119      if (!isnan(stars[N].lensing->dF_ApR7)) stars[N].lensing->dF_ApR7 /= image[0].exptime;
     120      if (!isnan(stars[N].lensing->sF_ApR7)) stars[N].lensing->sF_ApR7 /= image[0].exptime;
     121      if (!isnan(stars[N].lensing->fF_ApR7)) stars[N].lensing->fF_ApR7 /= image[0].exptime;
     122    }
    107123   
    108124    // the external ID is supplied, but do we trust it?
  • trunk/Ohana/src/addstar/src/ReadXradFITS.c

    r37357 r38153  
    7272    }
    7373
    74     stars[i].lensing-> F_ApR5 = AperFlux   [Nap*Ncol + 3];
    75     stars[i].lensing->dF_ApR5 = AperFluxErr[Nap*Ncol + 3];
    76     stars[i].lensing->sF_ApR5 = AperFluxStd[Nap*Ncol + 3];
    77     stars[i].lensing->fF_ApR5 = AperFill   [Nap*Ncol + 3];
     74    // XXX this is all hard-wired and should make use of the headers.
     75    // psphot cmfs have 5 radial apertures:
     76    // array 0, 1, 2, 3, 4
     77    // SDSS  3, 4, 5, 6, 7
    7878
    79     stars[i].lensing-> F_ApR6 = AperFlux   [Nap*Ncol + 4];
    80     stars[i].lensing->dF_ApR6 = AperFluxErr[Nap*Ncol + 4];
    81     stars[i].lensing->sF_ApR6 = AperFluxStd[Nap*Ncol + 4];
    82     stars[i].lensing->fF_ApR6 = AperFill   [Nap*Ncol + 4];
     79    stars[i].lensing-> F_ApR5 = AperFlux   [Nap*Ncol + 2];
     80    stars[i].lensing->dF_ApR5 = AperFluxErr[Nap*Ncol + 2];
     81    stars[i].lensing->sF_ApR5 = AperFluxStd[Nap*Ncol + 2];
     82    stars[i].lensing->fF_ApR5 = AperFill   [Nap*Ncol + 2];
     83
     84    stars[i].lensing-> F_ApR6 = AperFlux   [Nap*Ncol + 3];
     85    stars[i].lensing->dF_ApR6 = AperFluxErr[Nap*Ncol + 3];
     86    stars[i].lensing->sF_ApR6 = AperFluxStd[Nap*Ncol + 3];
     87    stars[i].lensing->fF_ApR6 = AperFill   [Nap*Ncol + 3];
     88
     89    stars[i].lensing-> F_ApR7 = AperFlux   [Nap*Ncol + 4];
     90    stars[i].lensing->dF_ApR7 = AperFluxErr[Nap*Ncol + 4];
     91    stars[i].lensing->sF_ApR7 = AperFluxStd[Nap*Ncol + 4];
     92    stars[i].lensing->fF_ApR7 = AperFill   [Nap*Ncol + 4];
    8393    Nap ++;
    8494  }
  • trunk/Ohana/src/addstar/src/resort_catalog.c

    r37807 r38153  
    4040  resort_catalog_lensing (catalog);
    4141  resort_catalog_starpar (catalog);
     42
     43  // XXX somehow need to set the value of lensing->measure offset here
     44
     45
    4246}
    4347
  • trunk/Ohana/src/dvolens/Makefile

    r37358 r38153  
    2929$(SRC)/help.$(ARCH).o            \
    3030$(SRC)/initialize.$(ARCH).o      \
     31$(SRC)/myIndex.$(ARCH).o         \
    3132$(SRC)/update_objects.$(ARCH).o  \
    3233$(SRC)/update_objects_catalog.$(ARCH).o  \
     
    4445$(SRC)/help.$(ARCH).o            \
    4546$(SRC)/initialize.$(ARCH).o      \
     47$(SRC)/myIndex.$(ARCH).o         \
    4648$(SRC)/update_objects.$(ARCH).o  \
    4749$(SRC)/update_objects_catalog.$(ARCH).o  \
  • trunk/Ohana/src/dvolens/include/dvolens.h

    r37358 r38153  
    44# include <signal.h>
    55# include <pthread.h>
     6
     7# ifndef MAX_INT
     8# define MAX_INT 2147483647
     9# endif
     10
     11typedef struct {
     12  int minID;
     13  int maxID;
     14  int *index;
     15  int Nindex;
     16  int NINDEX;
     17} myIndexType;
    618
    719typedef enum {
     
    6375int           client_logger_message   PROTO((char *format,...));
    6476
     77myIndexType *myIndexAlloc ();
     78int myIndexFree (myIndexType *myIndex);
     79void myIndexInit (myIndexType *myIndex);
     80int myIndexUpdateLimits (myIndexType *myIndex, int value);
     81int myIndexSetRange (myIndexType *myIndex);
     82int myIndexSetEntry (myIndexType *myIndex, int value, int entry);
     83int myIndexGetEntry (myIndexType *myIndex, int value);
  • trunk/Ohana/src/dvolens/src/update_objects_catalog.c

    r37358 r38153  
    11# include "dvolens.h"
     2# define SCALE 0.001
     3float MagToFlux (float Mag); // in libdvo, but not exposed?
    24
    35int update_objects_catalog (Catalog *catalog) {
     
    1113  int Nsecfilt = GetPhotcodeNsecfilt ();
    1214 
     15  float *Mxx_obj = NULL;
     16  float *Mxy_obj = NULL;
     17  float *Myy_obj = NULL;
     18
     19  ALLOCATE (Mxx_obj, float, Nsecfilt);
     20  ALLOCATE (Mxy_obj, float, Nsecfilt);
     21  ALLOCATE (Myy_obj, float, Nsecfilt);
     22
    1323  // I think we have already allocated lensobj
    1424  REALLOCATE (catalog->lensobj, Lensobj, catalog->Naverage * Nsecfilt);
     
    1929  int Nlensobj = 0;
    2030
     31  myIndexType *measureIndex = myIndexAlloc();
     32
    2133  for (i = 0; i < catalog->Naverage; i++) {
    2234    Average *average = &catalog->average[i];
     
    2739    for (j = 0; j < Nsecfilt; j++) {
    2840      dvo_lensobj_init (&lensobj[j], TRUE); // init accumulated values to 0
     41      Mxx_obj[j] = 0.0;
     42      Mxy_obj[j] = 0.0;
     43      Myy_obj[j] = 0.0;
    2944    }
    3045
    3146    // reset the average values
    32 
    3347    off_t Loff = average->lensingOffset;
    3448    off_t Moff = average->measureOffset;
     49
     50    // I have Nmeasure entries for this object.  I need to match measure to lensing (by imageID)
     51    // I could generated a sorted list (imageID, measureSeq) and use bisection to find the desired imageID
     52    // I could make an index measureSeq[imageID-imageIDmin]
     53   
     54    myIndexInit (measureIndex);
     55
     56    // generate an index for these measure entries (based on Mj and imageID)
     57    for (Mj = 0; Mj < average->Nmeasure; Mj++) {
     58      myIndexUpdateLimits (measureIndex, catalog->measure[Moff + Mj].imageID);
     59    }
     60    myIndexSetRange (measureIndex);
     61    for (Mj = 0; Mj < average->Nmeasure; Mj++) {
     62      // if there are duplicates (multiple measures from the same image),
     63      // myIndexSetEntry will only select one
     64      myIndexSetEntry (measureIndex, catalog->measure[Moff + Mj].imageID, Mj);
     65    }
    3566
    3667    // loop over the lensing measurements.  for each one, I need to find the corresponding measurement (make an index in lensing?)
     
    4172      if (!isfinite(lensing->X11_sm_obj)) continue;
    4273
     74      // pointer from lensing entry to corresponding measure entry (keep updated?)
     75      // XX ALT int Mseq = lensing->measureSeq;
     76      // XX ALT myAssert (Mseq < average->Nmeasure, "oops");
     77      // XX ALT Measure *measure = &catalog->measure[Moff + Mseq];
     78      // XX ALT myAssert (measure->imageID == lensing->imageID, "oops, deux");
     79
     80      Mj = myIndexGetEntry (measureIndex, lensing->imageID);
     81      myAssert (Mj > -1, "missing index");
     82
     83      Measure *measure = &catalog->measure[Moff + Mj];
     84      myAssert (measure->imageID == lensing->imageID, "oops, deux");
     85
     86# if (0)     
    4387      Measure *measure = NULL;
    4488      int found = FALSE;
     
    5498        abort();
    5599      }
     100# endif
    56101     
    57102      // skip measurements that do not match the current photcode
     
    67112      if (measure->psfQFperf < 0.85) continue;
    68113     
    69 
     114      // I should probably only use lensing entries which correspond to warps
     115      // included in the mean warp flux (setMrelCatalog.c)
     116      if ((measure->dbFlags & ID_MEAS_WARP_USED) == 0) continue;
     117
     118      Mxx_obj[Nsec] += measure->Mxx;
     119      Mxy_obj[Nsec] += measure->Mxy;
     120      Myy_obj[Nsec] += measure->Myy;
     121     
    70122      lensobj[Nsec].X11_sm_obj += lensing->X11_sm_obj;
    71123      lensobj[Nsec].X12_sm_obj += lensing->X12_sm_obj;
     
    92144      lensobj[Nsec]. E2_sh_psf += lensing-> E2_sh_psf;
    93145
    94       lensobj[Nsec]. F_ApR5 += lensing-> F_ApR5;
    95       lensobj[Nsec].dF_ApR5 += SQ(lensing->dF_ApR5);
    96       lensobj[Nsec].sF_ApR5 += SQ(lensing->sF_ApR5);
    97       lensobj[Nsec].fF_ApR5 += lensing->fF_ApR5;
    98 
    99       lensobj[Nsec]. F_ApR6 += lensing-> F_ApR6;
    100       lensobj[Nsec].dF_ApR6 += SQ(lensing->dF_ApR6);
    101       lensobj[Nsec].sF_ApR6 += SQ(lensing->sF_ApR6);
    102       lensobj[Nsec].fF_ApR6 += lensing->fF_ApR6;
     146      // relphot sets measure->Mcal (setMcalOutput.c, called by setMrelFinal.c)
     147      float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure->Mcal;
     148      float Fcal = 3630.8 * MagToFlux(Mcal);
     149
     150      // lensing->F_ApR5, etc need to be in units of DN/sec
     151      // Fcal * lensing->F_ApR5 is in Jy
     152
     153      lensobj[Nsec]. F_ApR5 +=    Fcal * lensing-> F_ApR5;
     154      lensobj[Nsec].dF_ApR5 += SQ(Fcal * lensing->dF_ApR5);
     155      lensobj[Nsec].sF_ApR5 += SQ(Fcal * lensing->sF_ApR5);
     156      lensobj[Nsec].fF_ApR5 +=           lensing->fF_ApR5;
     157
     158      lensobj[Nsec]. F_ApR6 +=    Fcal * lensing-> F_ApR6;
     159      lensobj[Nsec].dF_ApR6 += SQ(Fcal * lensing->dF_ApR6);
     160      lensobj[Nsec].sF_ApR6 += SQ(Fcal * lensing->sF_ApR6);
     161      lensobj[Nsec].fF_ApR6 +=           lensing->fF_ApR6;
     162
     163      lensobj[Nsec]. F_ApR7 +=    Fcal * lensing-> F_ApR7;
     164      lensobj[Nsec].dF_ApR7 += SQ(Fcal * lensing->dF_ApR7);
     165      lensobj[Nsec].sF_ApR7 += SQ(Fcal * lensing->sF_ApR7);
     166      lensobj[Nsec].fF_ApR7 +=           lensing->fF_ApR7;
    103167
    104168      lensobj[Nsec].Nmeas   ++;
     
    139203      lensobj[j].sF_ApR5 /= Nmeas;
    140204      lensobj[j].fF_ApR5 /= Nmeas;
     205
    141206      lensobj[j]. F_ApR6 /= Nmeas;
    142207      lensobj[j].dF_ApR6 /= Nmeas;
     
    144209      lensobj[j].fF_ApR6 /= Nmeas;
    145210
     211      lensobj[j]. F_ApR7 /= Nmeas;
     212      lensobj[j].dF_ApR7 /= Nmeas;
     213      lensobj[j].sF_ApR7 /= Nmeas;
     214      lensobj[j].fF_ApR7 /= Nmeas;
     215
    146216      lensobj[j].dF_ApR5 = sqrt(lensobj[j].dF_ApR5);
    147217      lensobj[j].sF_ApR5 = sqrt(lensobj[j].sF_ApR5);
    148218      lensobj[j].dF_ApR6 = sqrt(lensobj[j].dF_ApR6);
    149219      lensobj[j].sF_ApR6 = sqrt(lensobj[j].sF_ApR6);
     220      lensobj[j].dF_ApR7 = sqrt(lensobj[j].dF_ApR7);
     221      lensobj[j].sF_ApR7 = sqrt(lensobj[j].sF_ApR7);
    150222
    151223      // somewhere in here I should calculate the values of E1, E2, and gamma
     224
     225      float e0 = Mxx_obj[j] + Myy_obj[j];
     226      lensobj[j].E1 = (Mxx_obj[j] - Myy_obj[j]) / e0;
     227      lensobj[j].E2 = 2.0 * Mxy_obj[j] / e0;
    152228    }
    153229
     
    159235  }
    160236
     237  free (Mxx_obj);
     238  free (Mxy_obj);
     239  free (Myy_obj);
     240
     241  myIndexFree (measureIndex);
     242
    161243  catalog->Nlensobj = Nlensobj;
    162244  catalog->Nlensobj_disk = 0;
  • trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps_catalog.c

    r37926 r38153  
    188188                 "FLUX_STD_AP_R5     FLOAT, "
    189189                 "FLUX_FIL_AP_R5     FLOAT, "
     190
    190191                 "FLUX_AP_R6         FLOAT, "
    191192                 "FLUX_ERR_AP_R6     FLOAT, "
    192193                 "FLUX_STD_AP_R6     FLOAT, "
    193194                 "FLUX_FIL_AP_R6     FLOAT, "
     195
     196                 "FLUX_AP_R7         FLOAT, "
     197                 "FLUX_ERR_AP_R7     FLOAT, "
     198                 "FLUX_STD_AP_R7     FLOAT, "
     199                 "FLUX_FIL_AP_R7     FLOAT, "
    194200
    195201                 "X11_SM_OBJ         FLOAT, "
     
    281287                 "FLUX_STD_AP_R5, "
    282288                 "FLUX_FIL_AP_R5, "
     289
    283290                 "FLUX_AP_R6, "
    284291                 "FLUX_ERR_AP_R6, "
    285292                 "FLUX_STD_AP_R6, "
    286293                 "FLUX_FIL_AP_R6, "
     294
     295                 "FLUX_AP_R7, "
     296                 "FLUX_ERR_AP_R7, "
     297                 "FLUX_STD_AP_R7, "
     298                 "FLUX_FIL_AP_R7, "
    287299
    288300                 "X11_SM_OBJ, "
     
    367379
    368380    // use %e?
    369     PRINT_FLOAT(sec_buffer, meanPSFFlux,      "%.6f, "); // uflux precision
    370     PRINT_FLOAT(sec_buffer, meanPSFFluxErr,   "%.6f, "); // uflux precision
    371     PRINT_FLOAT(sec_buffer, meanPSFFluxStd,   "%.6f, "); // uflux precision
    372 
    373     PRINT_FLOAT(sec_buffer, meanKronFlux,     "%.6f, "); // uflux precision
    374     PRINT_FLOAT(sec_buffer, meanKronFluxErr,  "%.6f, "); // uflux precision
    375     PRINT_FLOAT(sec_buffer, meanKronFluxStd,  "%.6f, "); // uflux precision
    376 
    377     PRINT_FLOAT(sec_buffer, meanApFlux,     "%.6f, "); // uflux precision
    378     PRINT_FLOAT(sec_buffer, meanApFluxErr,  "%.6f, "); // uflux precision
    379     PRINT_FLOAT(sec_buffer, meanApFluxStd,  "%.6f, "); // uflux precision
     381    PRINT_FLOAT(sec_buffer, meanPSFFlux,      "%.6e, "); // uflux precision
     382    PRINT_FLOAT(sec_buffer, meanPSFFluxErr,   "%.6e, "); // uflux precision
     383    PRINT_FLOAT(sec_buffer, meanPSFFluxStd,   "%.6e, "); // uflux precision
     384
     385    PRINT_FLOAT(sec_buffer, meanKronFlux,     "%.6e, "); // uflux precision
     386    PRINT_FLOAT(sec_buffer, meanKronFluxErr,  "%.6e, "); // uflux precision
     387    PRINT_FLOAT(sec_buffer, meanKronFluxStd,  "%.6e, "); // uflux precision
     388
     389    PRINT_FLOAT(sec_buffer, meanApFlux,     "%.6e, "); // uflux precision
     390    PRINT_FLOAT(sec_buffer, meanApFluxErr,  "%.6e, "); // uflux precision
     391    PRINT_FLOAT(sec_buffer, meanApFluxStd,  "%.6e, "); // uflux precision
    380392
    381393    PrintIOBuffer (sec_buffer, "%u ", secfilt->flags);       
     
    390402    PrintIOBuffer (cpy_buffer, "%hd, ", lensobj->photcode);         
    391403
    392     PRINT_FLOAT(cpy_buffer, lensobj-> F_ApR5,     "%.8f, ");
    393     PRINT_FLOAT(cpy_buffer, lensobj->dF_ApR5,     "%.8f, ");
    394     PRINT_FLOAT(cpy_buffer, lensobj->sF_ApR5,     "%.8f, ");
    395     PRINT_FLOAT(cpy_buffer, lensobj->fF_ApR5,     "%.8f, ");
    396     PRINT_FLOAT(cpy_buffer, lensobj-> F_ApR6,     "%.8f, ");
    397     PRINT_FLOAT(cpy_buffer, lensobj->dF_ApR6,     "%.8f, ");
    398     PRINT_FLOAT(cpy_buffer, lensobj->sF_ApR6,     "%.8f, ");
    399     PRINT_FLOAT(cpy_buffer, lensobj->fF_ApR6,     "%.8f, ");
    400 
    401     PRINT_FLOAT(cpy_buffer, lensobj->X11_sm_obj,  "%.8f, ");
    402     PRINT_FLOAT(cpy_buffer, lensobj->X12_sm_obj,  "%.8f, ");
    403     PRINT_FLOAT(cpy_buffer, lensobj->X22_sm_obj,  "%.8f, ");
    404     PRINT_FLOAT(cpy_buffer, lensobj->E1_sm_obj,   "%.8f, ");
    405     PRINT_FLOAT(cpy_buffer, lensobj->E2_sm_obj,   "%.8f, ");
    406     PRINT_FLOAT(cpy_buffer, lensobj->X11_sh_obj,  "%.8f, ");
    407     PRINT_FLOAT(cpy_buffer, lensobj->X12_sh_obj,  "%.8f, ");
    408     PRINT_FLOAT(cpy_buffer, lensobj->X22_sh_obj,  "%.8f, ");
    409     PRINT_FLOAT(cpy_buffer, lensobj->E1_sh_obj,   "%.8f, ");
    410     PRINT_FLOAT(cpy_buffer, lensobj->E2_sh_obj,   "%.8f, ");
    411 
    412     PRINT_FLOAT(cpy_buffer, lensobj->X11_sm_psf,  "%.8f, ");
    413     PRINT_FLOAT(cpy_buffer, lensobj->X12_sm_psf,  "%.8f, ");
    414     PRINT_FLOAT(cpy_buffer, lensobj->X22_sm_psf,  "%.8f, ");
    415     PRINT_FLOAT(cpy_buffer, lensobj->E1_sm_psf,   "%.8f, ");
    416     PRINT_FLOAT(cpy_buffer, lensobj->E2_sm_psf,   "%.8f, ");
    417     PRINT_FLOAT(cpy_buffer, lensobj->X11_sh_psf,  "%.8f, ");
    418     PRINT_FLOAT(cpy_buffer, lensobj->X12_sh_psf,  "%.8f, ");
    419     PRINT_FLOAT(cpy_buffer, lensobj->X22_sh_psf,  "%.8f, ");
    420     PRINT_FLOAT(cpy_buffer, lensobj->E1_sh_psf,   "%.8f, ");
    421     PRINT_FLOAT(cpy_buffer, lensobj->E2_sh_psf,   "%.8f, ");
    422 
    423     PRINT_FLOAT(cpy_buffer, lensobj->gamma,       "%.8f, ");
    424     PRINT_FLOAT(cpy_buffer, lensobj->E1,          "%.8f, ");
    425     PRINT_FLOAT(cpy_buffer, lensobj->E2,          "%.8f, ");
     404    PRINT_FLOAT(cpy_buffer, lensobj-> F_ApR5,     "%.6e, ");
     405    PRINT_FLOAT(cpy_buffer, lensobj->dF_ApR5,     "%.6e, ");
     406    PRINT_FLOAT(cpy_buffer, lensobj->sF_ApR5,     "%.6e, ");
     407    PRINT_FLOAT(cpy_buffer, lensobj->fF_ApR5,     "%.6e, ");
     408    PRINT_FLOAT(cpy_buffer, lensobj-> F_ApR6,     "%.6e, ");
     409    PRINT_FLOAT(cpy_buffer, lensobj->dF_ApR6,     "%.6e, ");
     410    PRINT_FLOAT(cpy_buffer, lensobj->sF_ApR6,     "%.6e, ");
     411    PRINT_FLOAT(cpy_buffer, lensobj->fF_ApR6,     "%.6e, ");
     412    PRINT_FLOAT(cpy_buffer, lensobj-> F_ApR7,     "%.6e, ");
     413    PRINT_FLOAT(cpy_buffer, lensobj->dF_ApR7,     "%.6e, ");
     414    PRINT_FLOAT(cpy_buffer, lensobj->sF_ApR7,     "%.6e, ");
     415    PRINT_FLOAT(cpy_buffer, lensobj->fF_ApR7,     "%.6e, ");
     416    PRINT_FLOAT(cpy_buffer, lensobj->X11_sm_obj,  "%.6e, ");
     417    PRINT_FLOAT(cpy_buffer, lensobj->X12_sm_obj,  "%.6e, ");
     418    PRINT_FLOAT(cpy_buffer, lensobj->X22_sm_obj,  "%.6e, ");
     419    PRINT_FLOAT(cpy_buffer, lensobj->E1_sm_obj,   "%.6e, ");
     420    PRINT_FLOAT(cpy_buffer, lensobj->E2_sm_obj,   "%.6e, ");
     421    PRINT_FLOAT(cpy_buffer, lensobj->X11_sh_obj,  "%.6e, ");
     422    PRINT_FLOAT(cpy_buffer, lensobj->X12_sh_obj,  "%.6e, ");
     423    PRINT_FLOAT(cpy_buffer, lensobj->X22_sh_obj,  "%.6e, ");
     424    PRINT_FLOAT(cpy_buffer, lensobj->E1_sh_obj,   "%.6e, ");
     425    PRINT_FLOAT(cpy_buffer, lensobj->E2_sh_obj,   "%.6e, ");
     426    PRINT_FLOAT(cpy_buffer, lensobj->X11_sm_psf,  "%.6e, ");
     427    PRINT_FLOAT(cpy_buffer, lensobj->X12_sm_psf,  "%.6e, ");
     428    PRINT_FLOAT(cpy_buffer, lensobj->X22_sm_psf,  "%.6e, ");
     429    PRINT_FLOAT(cpy_buffer, lensobj->E1_sm_psf,   "%.6e, ");
     430    PRINT_FLOAT(cpy_buffer, lensobj->E2_sm_psf,   "%.6e, ");
     431    PRINT_FLOAT(cpy_buffer, lensobj->X11_sh_psf,  "%.6e, ");
     432    PRINT_FLOAT(cpy_buffer, lensobj->X12_sh_psf,  "%.6e, ");
     433    PRINT_FLOAT(cpy_buffer, lensobj->X22_sh_psf,  "%.6e, ");
     434    PRINT_FLOAT(cpy_buffer, lensobj->E1_sh_psf,   "%.6e, ");
     435    PRINT_FLOAT(cpy_buffer, lensobj->E2_sh_psf,   "%.6e, ");
     436    PRINT_FLOAT(cpy_buffer, lensobj->gamma,       "%.6e, ");
     437    PRINT_FLOAT(cpy_buffer, lensobj->E1,          "%.6e, ");
     438    PRINT_FLOAT(cpy_buffer, lensobj->E2,          "%.6e, ");
    426439
    427440    PrintIOBuffer (cpy_buffer, "%u ", lensobj->Nmeas); // NOTE: PRINT_FLOAT always adds a trailing comma -- need to use a different method on the last entry
  • trunk/Ohana/src/dvopsps/src/insert_diffobj_dvopsps_catalog.c

    r37924 r38153  
    258258
    259259    // use %e?
    260     PRINT_FLOAT(sec_buffer, meanPSFFlux,      "%.6f, "); // uflux precision
    261     PRINT_FLOAT(sec_buffer, meanPSFFluxErr,   "%.6f, "); // uflux precision
    262     PRINT_FLOAT(sec_buffer, meanPSFFluxStd,   "%.6f, "); // uflux precision
    263 
    264     PRINT_FLOAT(sec_buffer, meanKronFlux,     "%.6f, "); // uflux precision
    265     PRINT_FLOAT(sec_buffer, meanKronFluxErr,  "%.6f, "); // uflux precision
    266     PRINT_FLOAT(sec_buffer, meanKronFluxStd,  "%.6f, "); // uflux precision
    267 
    268     PRINT_FLOAT(sec_buffer, meanApFlux,     "%.6f, "); // uflux precision
    269     PRINT_FLOAT(sec_buffer, meanApFluxErr,  "%.6f, "); // uflux precision
    270     PRINT_FLOAT(sec_buffer, meanApFluxStd,  "%.6f, "); // uflux precision
     260    PRINT_FLOAT(sec_buffer, meanPSFFlux,      "%.6e, "); // uflux precision
     261    PRINT_FLOAT(sec_buffer, meanPSFFluxErr,   "%.6e, "); // uflux precision
     262    PRINT_FLOAT(sec_buffer, meanPSFFluxStd,   "%.6e, "); // uflux precision
     263
     264    PRINT_FLOAT(sec_buffer, meanKronFlux,     "%.6e, "); // uflux precision
     265    PRINT_FLOAT(sec_buffer, meanKronFluxErr,  "%.6e, "); // uflux precision
     266    PRINT_FLOAT(sec_buffer, meanKronFluxStd,  "%.6e, "); // uflux precision
     267
     268    PRINT_FLOAT(sec_buffer, meanApFlux,     "%.6e, "); // uflux precision
     269    PRINT_FLOAT(sec_buffer, meanApFluxErr,  "%.6e, "); // uflux precision
     270    PRINT_FLOAT(sec_buffer, meanApFluxStd,  "%.6e, "); // uflux precision
    271271
    272272    PrintIOBuffer (sec_buffer, "%u ", secfilt->flags);       
  • trunk/Ohana/src/kapa2/src/DrawObjects.c

    r38062 r38153  
    248248 
    249249  /* connect first point to second point */
    250   sxa = sx0 - 0.5*(sx1 - sx0);
     250  sxa = MIN (MAX (sx0 - 0.5*(sx1 - sx0), X0), X1);
    251251  sya = MAX (sy0, Y0);
    252252  DrawLine (sx0, sy0, sxa, sy0);
     
    254254 
    255255  /* draw segment equal distance behind first point and down to x-axis */
    256   sxa = 0.5*(sx0 + sx1);
     256  sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
    257257  DrawLine (sx0, sy0, sxa, sy0);
    258258  DrawLine (sxa, sy0, sxa, sy1);
     
    269269    sx1 = MIN (MAX (sx1, X0), X1);
    270270    sy1 = MAX (MIN (sy1, Y0), Y1);
    271     sxa = 0.5*(sx0 + sx1);
     271    sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
    272272    DrawLine (sx0, sy0, sxa, sy0);
    273273    DrawLine (sxa, sy0, sxa, sy1);
     
    278278 
    279279  /* draw segment equal distance after last point and down to x-axis */
    280   sxa = sx1 + 0.5*(sx1 - sxo);
     280  sxa = MIN (MAX (sx1 + 0.5*(sx1 - sxo), X0), X1);
    281281  sya = MAX (sy1, Y0);
    282282  DrawLine (sx1, sy1, sxa, sy1);
  • trunk/Ohana/src/kapa2/src/InterpretKeys.c

    r38062 r38153  
    11# include "Ximage.h"
     2# define FILTER_MODS 1
    23
    34int InterpretKeys (Graphic *graphic, XKeyEvent *event) {
     
    3233    // skip the following keys:
    3334    if (name == NULL) goto skip_cursor;
    34     if (!strcmp (name, "Shift_L")) goto skip_cursor;
    35     if (!strcmp (name, "Shift_R")) goto skip_cursor;
    36     if (!strcmp (name, "Control_L")) goto skip_cursor;
    37     if (!strcmp (name, "Control_R")) goto skip_cursor;
    38     if (!strcmp (name, "Alt_L")) goto skip_cursor;
    39     if (!strcmp (name, "Alt_R")) goto skip_cursor;
    40     if (!strcmp (name, "Super_L")) goto skip_cursor;
    41     if (!strcmp (name, "Super_R")) goto skip_cursor;
    42     if (!strcmp (name, "Caps_Lock")) goto skip_cursor;
    43     if (!strcmp (name, "Pause")) goto skip_cursor;
    44     if (!strcmp (name, "Continue")) goto skip_cursor;
    45     if (!strcmp (name, "Num_Lock")) goto skip_cursor;
    46     if (!strcmp (name, "Scroll_Lock")) goto skip_cursor;
    47     if (!strcmp (name, "Print")) goto skip_cursor;
    48     if (!strcmp (name, "(null)")) goto skip_cursor;
     35    if (FILTER_MODS) {
     36      if (!strcmp (name, "Shift_L")) goto skip_cursor;
     37      if (!strcmp (name, "Shift_R")) goto skip_cursor;
     38      if (!strcmp (name, "Control_L")) goto skip_cursor;
     39      if (!strcmp (name, "Control_R")) goto skip_cursor;
     40      if (!strcmp (name, "Alt_L")) goto skip_cursor;
     41      if (!strcmp (name, "Alt_R")) goto skip_cursor;
     42      if (!strcmp (name, "Super_L")) goto skip_cursor;
     43      if (!strcmp (name, "Super_R")) goto skip_cursor;
     44      if (!strcmp (name, "Caps_Lock")) goto skip_cursor;
     45      if (!strcmp (name, "Pause")) goto skip_cursor;
     46      if (!strcmp (name, "Continue")) goto skip_cursor;
     47      if (!strcmp (name, "Num_Lock")) goto skip_cursor;
     48      if (!strcmp (name, "Scroll_Lock")) goto skip_cursor;
     49      if (!strcmp (name, "Print")) goto skip_cursor;
     50      if (!strcmp (name, "(null)")) goto skip_cursor;
     51    }
    4952
    5053    Z = -1;
  • trunk/Ohana/src/kapa2/src/PSObjects.c

    r38062 r38153  
    211211 
    212212  /* connect first point to second point */
    213   sxa = sx0 - 0.5*(sx1 - sx0);
     213  sxa = MIN (MAX (sx0 - 0.5*(sx1 - sx0), X0), X1);
    214214  sya = MAX (sy0, Y0);
    215215  DrawLine (sx0, sy0, sxa, sy0);
     
    217217 
    218218  /* draw segment equal distance behind first point and down to x-axis */
    219   sxa = 0.5*(sx0 + sx1);
     219  sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
    220220  DrawLine (sx0, sy0, sxa, sy0);
    221221  DrawLine (sxa, sy0, sxa, sy1);
     
    232232    sx1 = MIN (MAX (sx1, X0), X1);
    233233    sy1 = MAX (MIN (sy1, Y0), Y1);
    234     sxa = 0.5*(sx0 + sx1);
     234    sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
    235235    DrawLine (sx0, sy0, sxa, sy0);
    236236    DrawLine (sxa, sy0, sxa, sy1);
     
    241241 
    242242  /* draw segment equal distance after last point and down to x-axis */
    243   sxa = sx1 + 0.5*(sx1 - sxo);
     243  sxa = MIN (MAX (sx1 + 0.5*(sx1 - sxo), X0), X1);
    244244  sya = MAX (sy1, Y0);
    245245  DrawLine (sx1, sy1, sxa, sy1);
  • trunk/Ohana/src/kapa2/src/SetColormap.c

    r35106 r38153  
    166166    goto store_colors;
    167167  }
     168  /* anuenue */
     169  if (!strcasecmp (name, "anuenue")) {
     170    redRef   = 0.25*MaxValue*scale*4.0; // value at 0.0
     171    greenRef = 0.50*MaxValue*scale*4.0;
     172    blueRef  = 1.33*MaxValue*scale;
     173    for (i = 0; i < (int)(0.50*MaxValue); i++) { 
     174      SETVALUE (graphic[0].cmap[i].green, 0.0, 0, 0xffff); // red is a ramp from 0 to 0xffff
     175      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
     176    }
     177    for (i = (int)(0.50*MaxValue); i < (int)(0.75*MaxValue); i++) { 
     178      SETVALUE (graphic[0].cmap[i].green, 4.0*i*scale - 0x20000, 0, 0xffff); // red is a ramp from 0 to 0xffff
     179      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
     180    }
     181    for (i = (int)(0.75*MaxValue); i < MaxValue; i++) { 
     182      SETVALUE (graphic[0].cmap[i].green, 0xffff, 0, 0xffff); // red is a ramp from 0 to 0xffff
     183      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
     184    }
     185
     186    for (i = 0; i < (int)(0.25*MaxValue); i++) { 
     187      SETVALUE (graphic[0].cmap[i].red,  4*i*scale, 0, 0xffff);
     188    }
     189    for (i = (int)(0.25*MaxValue); i < (int)(0.50*MaxValue); i++) { 
     190      SETVALUE (graphic[0].cmap[i].red,  0x20000 - 4*i*scale, 0, 0xffff);
     191    }
     192    for (i = (int)(0.50*MaxValue); i < MaxValue; i++) { 
     193      SETVALUE (graphic[0].cmap[i].red,  2*i*scale - 0xffff, 0, 0xffff);
     194    }
     195
     196    for (i = 0; i < (int)(0.50*MaxValue); i++) { 
     197      SETVALUE (graphic[0].cmap[i].blue,  2*i*scale, 0, 0xffff);
     198    }
     199    for (i = (int)(0.50*MaxValue); i < (int)(0.75*MaxValue); i++) { 
     200      SETVALUE (graphic[0].cmap[i].blue,  0x30000 - 4*i*scale, 0, 0xffff);
     201    }
     202    for (i = (int)(0.75*MaxValue); i < MaxValue; i++) { 
     203      SETVALUE (graphic[0].cmap[i].blue,  4*i*scale - 0x30000, 0, 0xffff);
     204    }
     205    goto store_colors;
     206  }
     207
     208  /* anuenue */
     209  if (!strncmp (name, "file:", 5)) {
     210    FILE *f = fopen (&name[5], "r");
     211    if (!f) {
     212      fprintf (stderr, "failed to open colormap file %s\n", &name[5]);
     213      return FALSE;
     214    }
     215    char line[1024];
     216
     217    int lastIndex = 0;
     218    float lastRed = 0.0;
     219    float lastBlue = 0.0;
     220    float lastGreen = 0.0;
     221
     222    float fracIndex, fracRed, fracBlue, fracGreen;
     223
     224    while (scan_line_maxlen (f, line, 1024) != EOF) {
     225      // file contains f R G B : f = 0.0 - 1.0, R,G,B = 0.0 - 1.0
     226      int Nscan = sscanf (line, "%f %f %f %f", &fracIndex, &fracRed, &fracBlue, &fracGreen);
     227      if (Nscan != 4) continue;
     228
     229      int nextIndex = fracIndex * MaxValue;
     230      if (nextIndex <= lastIndex) {
     231        lastRed = fracRed;
     232        lastBlue = fracBlue;
     233        lastGreen = fracGreen;
     234        continue;
     235      }
     236      float dRdI = (fracRed   - lastRed)   / (float) (nextIndex - lastIndex);
     237      float dBdI = (fracBlue  - lastBlue)  / (float) (nextIndex - lastIndex);
     238      float dGdI = (fracGreen - lastGreen) / (float) (nextIndex - lastIndex);
     239      for (i = lastIndex; i < nextIndex; i++) {
     240        float redValue   = 0xffff * (dRdI * (i - lastIndex) + lastRed);
     241        float blueValue  = 0xffff * (dBdI * (i - lastIndex) + lastBlue);
     242        float greenValue = 0xffff * (dGdI * (i - lastIndex) + lastGreen);
     243        SETVALUE (graphic[0].cmap[i].red,   redValue,   0, 0xffff);
     244        SETVALUE (graphic[0].cmap[i].blue,  blueValue,  0, 0xffff);
     245        SETVALUE (graphic[0].cmap[i].green, greenValue, 0, 0xffff);
     246      }
     247      lastRed = fracRed;
     248      lastBlue = fracBlue;
     249      lastGreen = fracGreen;
     250      lastIndex = nextIndex;
     251    }
     252    fclose (f);
     253
     254    if ((int) (MaxValue*fracIndex) < MaxValue) {
     255      float dRdI = (1.0 - lastRed)   / (float) (MaxValue - lastIndex);
     256      float dBdI = (1.0 - lastBlue)  / (float) (MaxValue - lastIndex);
     257      float dGdI = (1.0 - lastGreen) / (float) (MaxValue - lastIndex);
     258      for (i = lastIndex; i < MaxValue; i++) {
     259        float redValue   = 0xffff * (dRdI * (i - lastIndex) + lastRed);
     260        float blueValue  = 0xffff * (dBdI * (i - lastIndex) + lastBlue);
     261        float greenValue = 0xffff * (dGdI * (i - lastIndex) + lastGreen);
     262        SETVALUE (graphic[0].cmap[i].red,   redValue,   0, 0xffff);
     263        SETVALUE (graphic[0].cmap[i].blue,  blueValue,  0, 0xffff);
     264        SETVALUE (graphic[0].cmap[i].green, greenValue, 0, 0xffff);
     265      }
     266    }
     267    goto store_colors;
     268  }
     269
    168270  return (FALSE);
    169271
  • trunk/Ohana/src/kapa2/src/bDrawObjects.c

    r38062 r38153  
    198198 
    199199  /* connect first point to second point */
    200   sxa = sx0 - 0.5*(sx1 - sx0);
     200  sxa = MIN (MAX (sx0 - 0.5*(sx1 - sx0), X0), X1);
    201201  sya = MAX (sy0, Y0);
    202202  DrawLine (buffer, sx0, sy0, sxa, sy0);
     
    204204 
    205205  /* draw segment equal distance behind first point and down to x-axis */
    206   sxa = 0.5*(sx0 + sx1);
     206  sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
    207207  DrawLine (buffer, sx0, sy0, sxa, sy0);
    208208  DrawLine (buffer, sxa, sy0, sxa, sy1);
     
    219219    sx1 = MIN (MAX (sx1, X0), X1);
    220220    sy1 = MAX (MIN (sy1, Y0), Y1);
    221     sxa = 0.5*(sx0 + sx1);
     221    sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
    222222    DrawLine (buffer, sx0, sy0, sxa, sy0);
    223223    DrawLine (buffer, sxa, sy0, sxa, sy1);
     
    228228 
    229229  /* draw segment equal distance after last point and down to x-axis */
    230   sxa = sx1 + 0.5*(sx1 - sxo);
     230  sxa = MIN (MAX (sx1 + 0.5*(sx1 - sxo), X0), X1);
    231231  sya = MAX (sy1, Y0);
    232232  DrawLine (buffer, sx1, sy1, sxa, sy1);
  • trunk/Ohana/src/libautocode/Makefile.Targets

    r37995 r38153  
    4848$(ASRC)/lensing-ps1-v5-r1.$(ARCH).o \
    4949$(ASRC)/lensing-ps1-v5-r2.$(ARCH).o \
     50$(ASRC)/lensing-ps1-v5-r3.$(ARCH).o \
    5051$(ASRC)/lensobj.$(ARCH).o \
    51 $(ASRC)/lensobj-ps1-v5.$(ARCH).o \
     52$(ASRC)/lensobj-ps1-v5-r0.$(ARCH).o \
     53$(ASRC)/lensobj-ps1-v5-r1.$(ARCH).o \
    5254$(ASRC)/starpar.$(ARCH).o \
    5355$(ASRC)/starpar-ps1-v5.$(ARCH).o \
     
    156158$(AINC)/lensing-ps1-v5-r1.h \
    157159$(AINC)/lensing-ps1-v5-r2.h \
     160$(AINC)/lensing-ps1-v5-r3.h \
    158161$(AINC)/lensobj.h \
    159 $(AINC)/lensobj-ps1-v5.h \
     162$(AINC)/lensobj-ps1-v5-r0.h \
     163$(AINC)/lensobj-ps1-v5-r1.h \
    160164$(AINC)/starpar.h \
    161165$(AINC)/starpar-ps1-v5.h \
  • trunk/Ohana/src/libautocode/def/lensing.d

    r37992 r38153  
    22EXTNAME      DVO_LENSING
    33TYPE         BINTABLE
    4 SIZE         144
     4SIZE         160
    55DESCRIPTION  DVO Lensing Table
    66
     
    3232FIELD  E2_psf,         E2_PSF,       float,          polarization psf stars E2
    3333
    34 FIELD F_ApR5,        FLUX_AP_R5,    float,          Flux inside r = 5
     34FIELD  F_ApR5,           FLUX_AP_R5, float,          Flux inside r = 5
    3535FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
    3636FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
    3737FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for Flux inside r = 5
    3838
    39 FIELD F_ApR6,        FLUX_AP_R6,     float,          Flux inside r = 5
    40 FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 5
    41 FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 5
    42 FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 5
     39FIELD  F_ApR6,           FLUX_AP_R6, float,          Flux inside r = 6
     40FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 6
     41FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 6
     42FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 6
     43
     44FIELD  F_ApR7,           FLUX_AP_R7, float,          Flux inside r = 7
     45FIELD dF_ApR7,       FLUX_ERR_AP_R7, float,          error on Flux inside r = 7
     46FIELD sF_ApR7,       FLUX_STD_AP_R7, float,          stdev of Flux inside r = 7
     47FIELD fF_ApR7,       FLUX_FIL_AP_R7, float,          fill factor for Flux inside r = 7
    4348
    4449FIELD   detID,          DET_ID,      int,            detection ID
     
    4853
    4954FIELD imageID,         IMAGE_ID,     int,            reference to DVO image ID
    50 FIELD padding,         PADDING,      int,            padding
     55FIELD padding,          PADDING,     int,            filler
    5156
    52 # 28 x float
    53 # 5 x int + padding
    54 # = 136 bytes / detection
     57# 160 bytes / detection
    5558# for 2.5G objects + 60 overlaps, expect 15TB for forced warp
  • trunk/Ohana/src/libautocode/def/lensobj.d

    r37807 r38153  
    22EXTNAME      DVO_LENSOBJ
    33TYPE         BINTABLE
    4 SIZE         136
     4SIZE         152
    55DESCRIPTION  DVO Lensobj Table
    66
     
    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
     31FIELD  F_ApR5,           FLUX_AP_R5, float,          Flux inside r = 5
    3232FIELD dF_ApR5,       FLUX_ERR_AP_R5, float,          error on Flux inside r = 5
    3333FIELD sF_ApR5,       FLUX_STD_AP_R5, float,          stdev of Flux inside r = 5
    3434FIELD fF_ApR5,       FLUX_FIL_AP_R5, float,          fill factor for 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,          error on Flux inside r = 5
    38 FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 5
    39 FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 5
     36FIELD  F_ApR6,           FLUX_AP_R6, float,          Flux inside r = 6
     37FIELD dF_ApR6,       FLUX_ERR_AP_R6, float,          error on Flux inside r = 6
     38FIELD sF_ApR6,       FLUX_STD_AP_R6, float,          stdev of Flux inside r = 6
     39FIELD fF_ApR6,       FLUX_FIL_AP_R6, float,          fill factor for Flux inside r = 6
     40
     41FIELD  F_ApR7,           FLUX_AP_R7, float,          Flux inside r = 7
     42FIELD dF_ApR7,       FLUX_ERR_AP_R7, float,          error on Flux inside r = 7
     43FIELD sF_ApR7,       FLUX_STD_AP_R7, float,          stdev of Flux inside r = 7
     44FIELD fF_ApR7,       FLUX_FIL_AP_R7, float,          fill factor for Flux inside r = 7
    4045
    4146FIELD      gamma,        GAMMA,      float
  • trunk/Ohana/src/libdvo/include/dvo.h

    r38062 r38153  
    11501150LENSFIELD(E2_sh_psf)
    11511151
     1152LENSFIELD( F_ApR5);
     1153LENSFIELD(dF_ApR5);
     1154LENSFIELD(sF_ApR5);
     1155LENSFIELD(fF_ApR5);
     1156
     1157LENSFIELD( F_ApR6);
     1158LENSFIELD(dF_ApR6);
     1159LENSFIELD(sF_ApR6);
     1160LENSFIELD(fF_ApR6);
     1161
     1162LENSFIELD( F_ApR7);
     1163LENSFIELD(dF_ApR7);
     1164LENSFIELD(sF_ApR7);
     1165LENSFIELD(fF_ApR7);
     1166
     1167LENSFIELD(E1);
     1168LENSFIELD(E2);
     1169
    11521170# undef LENSFIELD
    11531171
  • trunk/Ohana/src/libdvo/include/dvodb.h

    r38062 r38153  
    8989  MAG_OPTION_F_STDEV_AP_R6,
    9090  MAG_OPTION_F_FILL_AP_R6,
     91
     92  MAG_OPTION_F_AP_R7,
     93  MAG_OPTION_F_ERR_AP_R7,
     94  MAG_OPTION_F_STDEV_AP_R7,
     95  MAG_OPTION_F_FILL_AP_R7,
     96
     97  MAG_OPTION_E1,
     98  MAG_OPTION_E2,
    9199} dvoMagOptionType;
    92100
     
    207215      MEAS_REF_COLOR_BLUE,
    208216      MEAS_REF_COLOR_RED,
     217
    209218      MEAS_X11_SM_OBJ,
    210219      MEAS_X12_SM_OBJ,
     
    227236      MEAS_E1_SH_PSF,
    228237      MEAS_E2_SH_PSF,
     238
     239      MEAS_F_AP_R5,
     240      MEAS_F_ERR_AP_R5,
     241      MEAS_F_STDEV_AP_R5,
     242      MEAS_F_FILL_AP_R5,
     243
     244      MEAS_F_AP_R6,
     245      MEAS_F_ERR_AP_R6,
     246      MEAS_F_STDEV_AP_R6,
     247      MEAS_F_FILL_AP_R6,
     248
     249      MEAS_F_AP_R7,
     250      MEAS_F_ERR_AP_R7,
     251      MEAS_F_STDEV_AP_R7,
     252      MEAS_F_FILL_AP_R7,
     253
    229254      MEAS_E_BV,                      // extinction (mags)
    230255      MEAS_E_BV_ERR,
  • trunk/Ohana/src/libdvo/include/ps1_v5_defs.h

    r37995 r38153  
    88SecFilt_PS1_V5          *SecFiltInternalTo_PS1_V5 (SecFilt *in, off_t Nvalues);
    99
    10 typedef Lensing_PS1_V5_R2 Lensing_PS1_V5;
     10Lensobj                 *Lensobj_PS1_V5_R0_ToInternal (Lensobj_PS1_V5_R0 *in, off_t Nvalues);
     11Lensobj                 *Lensobj_PS1_V5_R1_ToInternal (Lensobj_PS1_V5_R1 *in, off_t Nvalues);
    1112
    12 Lensing                 *Lensing_PS1_V5_ToInternal (Lensing_PS1_V5 *in, off_t Nvalues);
    13 Lensing_PS1_V5_R2       *LensingInternalTo_PS1_V5_R2 (Lensing *in, off_t Nvalues);
    14 Lensobj                 *Lensobj_PS1_V5_ToInternal (Lensobj_PS1_V5 *in, off_t Nvalues);
    15 Lensobj_PS1_V5          *LensobjInternalTo_PS1_V5 (Lensobj *in, off_t Nvalues);
     13Lensobj_PS1_V5_R1       *LensobjInternalTo_PS1_V5_R1 (Lensobj *in, off_t Nvalues);
    1614
    1715Lensing                 *Lensing_PS1_V5_R0_ToInternal (Lensing_PS1_V5_R0 *in, off_t Nvalues);
    1816Lensing                 *Lensing_PS1_V5_R1_ToInternal (Lensing_PS1_V5_R1 *in, off_t Nvalues);
    1917Lensing                 *Lensing_PS1_V5_R2_ToInternal (Lensing_PS1_V5_R2 *in, off_t Nvalues);
     18Lensing                 *Lensing_PS1_V5_R3_ToInternal (Lensing_PS1_V5_R3 *in, off_t Nvalues);
     19
     20Lensing_PS1_V5_R3       *LensingInternalTo_PS1_V5_R3 (Lensing *in, off_t Nvalues);
    2021
    2122StarPar                 *StarPar_PS1_V5_ToInternal (StarPar_PS1_V5 *in, off_t Nvalues);
  • trunk/Ohana/src/libdvo/src/dbExtractAverages.c

    r38062 r38153  
    386386        case MAG_OPTION_E1_SH_PSF:  { value.Flt = LensValue_E1_sh_psf  (field->photcode, lensobj); break; }
    387387        case MAG_OPTION_E2_SH_PSF:  { value.Flt = LensValue_E2_sh_psf  (field->photcode, lensobj); break; }
     388
     389        case MAG_OPTION_F_AP_R5:       { value.Flt = LensValue_F_ApR5  (field->photcode, lensobj); break; }
     390        case MAG_OPTION_F_ERR_AP_R5:   { value.Flt = LensValue_dF_ApR5 (field->photcode, lensobj); break; }
     391        case MAG_OPTION_F_STDEV_AP_R5: { value.Flt = LensValue_sF_ApR5 (field->photcode, lensobj); break; }
     392        case MAG_OPTION_F_FILL_AP_R5:  { value.Flt = LensValue_fF_ApR5 (field->photcode, lensobj); break; }
     393
     394        case MAG_OPTION_F_AP_R6:       { value.Flt = LensValue_F_ApR6  (field->photcode, lensobj); break; }
     395        case MAG_OPTION_F_ERR_AP_R6:   { value.Flt = LensValue_dF_ApR6 (field->photcode, lensobj); break; }
     396        case MAG_OPTION_F_STDEV_AP_R6: { value.Flt = LensValue_sF_ApR6 (field->photcode, lensobj); break; }
     397        case MAG_OPTION_F_FILL_AP_R6:  { value.Flt = LensValue_fF_ApR6 (field->photcode, lensobj); break; }
     398
     399        case MAG_OPTION_F_AP_R7:       { value.Flt = LensValue_F_ApR7  (field->photcode, lensobj); break; }
     400        case MAG_OPTION_F_ERR_AP_R7:   { value.Flt = LensValue_dF_ApR7 (field->photcode, lensobj); break; }
     401        case MAG_OPTION_F_STDEV_AP_R7: { value.Flt = LensValue_sF_ApR7 (field->photcode, lensobj); break; }
     402        case MAG_OPTION_F_FILL_AP_R7:  { value.Flt = LensValue_fF_ApR7 (field->photcode, lensobj); break; }
     403
     404        case MAG_OPTION_E1:            { value.Flt = LensValue_E1      (field->photcode, lensobj); break; }
     405        case MAG_OPTION_E2:            { value.Flt = LensValue_E2      (field->photcode, lensobj); break; }
    388406
    389407        case MAG_OPTION_NONE:
  • trunk/Ohana/src/libdvo/src/dbExtractMeasures.c

    r38062 r38153  
    277277        case MAG_OPTION_F_STDEV_AP_R6:
    278278        case MAG_OPTION_F_FILL_AP_R6:
     279        case MAG_OPTION_F_AP_R7:
     280        case MAG_OPTION_F_ERR_AP_R7:
     281        case MAG_OPTION_F_STDEV_AP_R7:
     282        case MAG_OPTION_F_FILL_AP_R7:
     283        case MAG_OPTION_E1:
     284        case MAG_OPTION_E2:
    279285
    280286        case MAG_OPTION_NONE:
     
    735741      }
    736742      break;
     743
     744    case MEAS_X11_SM_OBJ: { value.Flt = lensing->X11_sm_obj; break; }
     745    case MEAS_X12_SM_OBJ: { value.Flt = lensing->X12_sm_obj; break; }
     746    case MEAS_X22_SM_OBJ: { value.Flt = lensing->X22_sm_obj; break; }
     747    case MEAS_E1_SM_OBJ:  { value.Flt = lensing->E1_sm_obj; break; }
     748    case MEAS_E2_SM_OBJ:  { value.Flt = lensing->E2_sm_obj; break; }
     749    case MEAS_X11_SH_OBJ: { value.Flt = lensing->X11_sh_obj; break; }
     750    case MEAS_X12_SH_OBJ: { value.Flt = lensing->X12_sh_obj; break; }
     751    case MEAS_X22_SH_OBJ: { value.Flt = lensing->X22_sh_obj; break; }
     752    case MEAS_E1_SH_OBJ:  { value.Flt = lensing->E1_sh_obj; break; }
     753    case MEAS_E2_SH_OBJ:  { value.Flt = lensing->E2_sh_obj; break; }
     754    case MEAS_X11_SM_PSF: { value.Flt = lensing->X11_sm_psf; break; }
     755    case MEAS_X12_SM_PSF: { value.Flt = lensing->X12_sm_psf; break; }
     756    case MEAS_X22_SM_PSF: { value.Flt = lensing->X22_sm_psf; break; }
     757    case MEAS_E1_SM_PSF:  { value.Flt = lensing->E1_sm_psf; break; }
     758    case MEAS_E2_SM_PSF:  { value.Flt = lensing->E2_sm_psf; break; }
     759    case MEAS_X11_SH_PSF: { value.Flt = lensing->X11_sh_psf; break; }
     760    case MEAS_X12_SH_PSF: { value.Flt = lensing->X12_sh_psf; break; }
     761    case MEAS_X22_SH_PSF: { value.Flt = lensing->X22_sh_psf; break; }
     762    case MEAS_E1_SH_PSF:  { value.Flt = lensing->E1_sh_psf; break; }
     763    case MEAS_E2_SH_PSF:  { value.Flt = lensing->E2_sh_psf; break; }
     764
     765    case MEAS_F_AP_R5:       { value.Flt = lensing-> F_ApR5; break; }
     766    case MEAS_F_ERR_AP_R5:   { value.Flt = lensing->dF_ApR5; break; }
     767    case MEAS_F_STDEV_AP_R5: { value.Flt = lensing->sF_ApR5; break; }
     768    case MEAS_F_FILL_AP_R5:  { value.Flt = lensing->fF_ApR5; break; }
     769    case MEAS_F_AP_R6:       { value.Flt = lensing-> F_ApR6; break; }
     770    case MEAS_F_ERR_AP_R6:   { value.Flt = lensing->dF_ApR6; break; }
     771    case MEAS_F_STDEV_AP_R6: { value.Flt = lensing->sF_ApR6; break; }
     772    case MEAS_F_FILL_AP_R6:  { value.Flt = lensing->fF_ApR6; break; }
     773    case MEAS_F_AP_R7:       { value.Flt = lensing-> F_ApR7; break; }
     774    case MEAS_F_ERR_AP_R7:   { value.Flt = lensing->dF_ApR7; break; }
     775    case MEAS_F_STDEV_AP_R7: { value.Flt = lensing->sF_ApR7; break; }
     776    case MEAS_F_FILL_AP_R7:  { value.Flt = lensing->fF_ApR7; break; }
    737777
    738778    case MEAS_E_BV:             { value.Flt = starpar->Ebv;      break; }
  • trunk/Ohana/src/libdvo/src/dbFields.c

    r38062 r38153  
    6161    if (fields[i].ID == MEAS_E1_SH_PSF)  return TRUE;
    6262    if (fields[i].ID == MEAS_E2_SH_PSF)  return TRUE;
     63
     64    if (fields[i].ID == MEAS_F_AP_R5)       return TRUE;
     65    if (fields[i].ID == MEAS_F_ERR_AP_R5)   return TRUE;
     66    if (fields[i].ID == MEAS_F_STDEV_AP_R5) return TRUE;
     67    if (fields[i].ID == MEAS_F_FILL_AP_R5)  return TRUE;
     68
     69    if (fields[i].ID == MEAS_F_AP_R6)       return TRUE;
     70    if (fields[i].ID == MEAS_F_ERR_AP_R6)   return TRUE;
     71    if (fields[i].ID == MEAS_F_STDEV_AP_R6) return TRUE;
     72    if (fields[i].ID == MEAS_F_FILL_AP_R6)  return TRUE;
     73
     74    if (fields[i].ID == MEAS_F_AP_R7)       return TRUE;
     75    if (fields[i].ID == MEAS_F_ERR_AP_R7)   return TRUE;
     76    if (fields[i].ID == MEAS_F_STDEV_AP_R7) return TRUE;
     77    if (fields[i].ID == MEAS_F_FILL_AP_R7)  return TRUE;
    6378  }
    6479  return FALSE;
     
    90105    if (fields[i].magOption == MAG_OPTION_E1_SH_PSF)  return TRUE;
    91106    if (fields[i].magOption == MAG_OPTION_E2_SH_PSF)  return TRUE;
     107
     108    if (fields[i].magOption == MAG_OPTION_F_AP_R5)       return TRUE;
     109    if (fields[i].magOption == MAG_OPTION_F_ERR_AP_R5)   return TRUE;
     110    if (fields[i].magOption == MAG_OPTION_F_STDEV_AP_R5) return TRUE;
     111    if (fields[i].magOption == MAG_OPTION_F_FILL_AP_R5)  return TRUE;
     112
     113    if (fields[i].magOption == MAG_OPTION_F_AP_R6)       return TRUE;
     114    if (fields[i].magOption == MAG_OPTION_F_ERR_AP_R6)   return TRUE;
     115    if (fields[i].magOption == MAG_OPTION_F_STDEV_AP_R6) return TRUE;
     116    if (fields[i].magOption == MAG_OPTION_F_FILL_AP_R6)  return TRUE;
     117
     118    if (fields[i].magOption == MAG_OPTION_F_AP_R7)       return TRUE;
     119    if (fields[i].magOption == MAG_OPTION_F_ERR_AP_R7)   return TRUE;
     120    if (fields[i].magOption == MAG_OPTION_F_STDEV_AP_R7) return TRUE;
     121    if (fields[i].magOption == MAG_OPTION_F_FILL_AP_R7)  return TRUE;
     122
     123    if (fields[i].magOption == MAG_OPTION_E1)            return TRUE;
     124    if (fields[i].magOption == MAG_OPTION_E2)            return TRUE;
    92125  }
    93126  return FALSE;
     
    199232  if (!strcasecmp (string, "E1_SH_PSF"))     return MAG_OPTION_E1_SH_PSF;
    200233  if (!strcasecmp (string, "E2_SH_PSF"))     return MAG_OPTION_E2_SH_PSF;
    201   // if (!strcasecmp (string, "F_AP_R5"))       return MAG_OPTION_F_AP_R5;
    202   // if (!strcasecmp (string, "F_ERR_AP_R5"))   return MAG_OPTION_F_ERR_AP_R5;
    203   // if (!strcasecmp (string, "F_STDEV_AP_R5")) return MAG_OPTION_F_STDEV_AP_R5;
    204   // if (!strcasecmp (string, "F_FILL_AP_R5"))  return MAG_OPTION_F_FILL_AP_R5;
    205   // if (!strcasecmp (string, "F_AP_R6"))       return MAG_OPTION_F_AP_R6;
    206   // if (!strcasecmp (string, "F_ERR_AP_R6"))   return MAG_OPTION_F_ERR_AP_R6;
    207   // if (!strcasecmp (string, "F_STDEV_AP_R6")) return MAG_OPTION_F_STDEV_AP_R6;
    208   // if (!strcasecmp (string, "F_FILL_AP_R6"))  return MAG_OPTION_F_FILL_AP_R6;
     234  if (!strcasecmp (string, "F_AP_R5"))       return MAG_OPTION_F_AP_R5;
     235  if (!strcasecmp (string, "F_ERR_AP_R5"))   return MAG_OPTION_F_ERR_AP_R5;
     236  if (!strcasecmp (string, "F_STDEV_AP_R5")) return MAG_OPTION_F_STDEV_AP_R5;
     237  if (!strcasecmp (string, "F_FILL_AP_R5"))  return MAG_OPTION_F_FILL_AP_R5;
     238  if (!strcasecmp (string, "F_AP_R6"))       return MAG_OPTION_F_AP_R6;
     239  if (!strcasecmp (string, "F_ERR_AP_R6"))   return MAG_OPTION_F_ERR_AP_R6;
     240  if (!strcasecmp (string, "F_STDEV_AP_R6")) return MAG_OPTION_F_STDEV_AP_R6;
     241  if (!strcasecmp (string, "F_FILL_AP_R6"))  return MAG_OPTION_F_FILL_AP_R6;
     242  if (!strcasecmp (string, "F_AP_R7"))       return MAG_OPTION_F_AP_R7;
     243  if (!strcasecmp (string, "F_ERR_AP_R7"))   return MAG_OPTION_F_ERR_AP_R7;
     244  if (!strcasecmp (string, "F_STDEV_AP_R7")) return MAG_OPTION_F_STDEV_AP_R7;
     245  if (!strcasecmp (string, "F_FILL_AP_R7"))  return MAG_OPTION_F_FILL_AP_R7;
     246  if (!strcasecmp (string, "E1"))            return MAG_OPTION_E1;
     247  if (!strcasecmp (string, "E2"))            return MAG_OPTION_E2;
    209248
    210249  return MAG_OPTION_NONE;
     
    534573  if (!strcasecmp (fieldName, "E2_SH_PSF"))      ESCAPE (MEAS_E2_SH_PSF,  OPIHI_FLT);
    535574
     575  if (!strcasecmp (fieldName, "F_AP_R5"))        ESCAPE (MEAS_F_AP_R5,       OPIHI_FLT);
     576  if (!strcasecmp (fieldName, "F_ERR_AP_R5"))    ESCAPE (MEAS_F_ERR_AP_R5,   OPIHI_FLT);
     577  if (!strcasecmp (fieldName, "F_STDEV_AP_R5"))  ESCAPE (MEAS_F_STDEV_AP_R5, OPIHI_FLT);
     578  if (!strcasecmp (fieldName, "F_FILL_AP_R5"))   ESCAPE (MEAS_F_FILL_AP_R5,  OPIHI_FLT);
     579  if (!strcasecmp (fieldName, "F_AP_R6"))        ESCAPE (MEAS_F_AP_R6,       OPIHI_FLT);
     580  if (!strcasecmp (fieldName, "F_ERR_AP_R6"))    ESCAPE (MEAS_F_ERR_AP_R6,   OPIHI_FLT);
     581  if (!strcasecmp (fieldName, "F_STDEV_AP_R6"))  ESCAPE (MEAS_F_STDEV_AP_R6, OPIHI_FLT);
     582  if (!strcasecmp (fieldName, "F_FILL_AP_R6"))   ESCAPE (MEAS_F_FILL_AP_R6,  OPIHI_FLT);
     583  if (!strcasecmp (fieldName, "F_AP_R7"))        ESCAPE (MEAS_F_AP_R7,       OPIHI_FLT);
     584  if (!strcasecmp (fieldName, "F_ERR_AP_R7"))    ESCAPE (MEAS_F_ERR_AP_R7,   OPIHI_FLT);
     585  if (!strcasecmp (fieldName, "F_STDEV_AP_R7"))  ESCAPE (MEAS_F_STDEV_AP_R7, OPIHI_FLT);
     586  if (!strcasecmp (fieldName, "F_FILL_AP_R7"))   ESCAPE (MEAS_F_FILL_AP_R7,  OPIHI_FLT);
     587
    536588  if (!strcasecmp (fieldName, "E_BV"))             ESCAPE (MEAS_E_BV          ,   OPIHI_FLT);
    537589  if (!strcasecmp (fieldName, "E_BV_ERR"))         ESCAPE (MEAS_E_BV_ERR      ,   OPIHI_FLT);
  • trunk/Ohana/src/libdvo/src/dvo_catalog_split.c

    r37807 r38153  
    992992    assert (catalog[0].Nlensing_disk >= catalog[0].Nlensing_off);
    993993
    994     // convert to external table format (note that the block above does not damage or free catalog.average)
    995     if (!LensingToFtable (&ftable, &catalog[0].lensing[first], Nrows, catalog[0].catformat)) {
    996       fprintf (stderr, "trouble converting format\n");
    997       goto failure;
    998     }
    999 
    1000     // write out Lensing table
    1001     if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new)) {
    1002       fprintf (stderr, "trouble writing Lensing table\n");
    1003       goto failure;
    1004     }
    1005     gfits_free_header (&header);
    1006     gfits_free_table (&ftable);
     994    if (catalog[0].Nlensing) {
     995      // convert to external table format (note that the block above does not damage or free catalog.average)
     996      if (!LensingToFtable (&ftable, &catalog[0].lensing[first], Nrows, catalog[0].catformat)) {
     997        fprintf (stderr, "trouble converting format\n");
     998        goto failure;
     999      }
     1000
     1001      // write out Lensing table
     1002      if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new)) {
     1003        fprintf (stderr, "trouble writing Lensing table\n");
     1004        goto failure;
     1005      }
     1006      gfits_free_header (&header);
     1007      gfits_free_table (&ftable);
     1008    }
    10071009  }
    10081010
     
    10191021    assert (catalog[0].Nlensobj_disk >= catalog[0].Nlensobj_off);
    10201022
    1021     // convert to external table format (note that the block above does not damage or free catalog.average)
    1022     if (!LensobjToFtable (&ftable, &catalog[0].lensobj[first], Nrows, catalog[0].catformat)) {
    1023       fprintf (stderr, "trouble converting format\n");
    1024       goto failure;
    1025     }
    1026 
    1027     // write out Lensobj table
    1028     if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new)) {
    1029       fprintf (stderr, "trouble writing Lensobj table\n");
    1030       goto failure;
    1031     }
    1032     gfits_free_header (&header);
    1033     gfits_free_table (&ftable);
     1023    if (catalog[0].Nlensobj) {
     1024      // convert to external table format (note that the block above does not damage or free catalog.average)
     1025      if (!LensobjToFtable (&ftable, &catalog[0].lensobj[first], Nrows, catalog[0].catformat)) {
     1026        fprintf (stderr, "trouble converting format\n");
     1027        goto failure;
     1028      }
     1029
     1030      // write out Lensobj table
     1031      if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new)) {
     1032        fprintf (stderr, "trouble writing Lensobj table\n");
     1033        goto failure;
     1034      }
     1035      gfits_free_header (&header);
     1036      gfits_free_table (&ftable);
     1037    }
    10341038  }
    10351039
     
    10461050    assert (catalog[0].Nstarpar_disk >= catalog[0].Nstarpar_off);
    10471051
    1048     // convert to external table format (note that the block above does not damage or free catalog.average)
    1049     if (!StarParToFtable (&ftable, &catalog[0].starpar[first], Nrows, catalog[0].catformat)) {
    1050       fprintf (stderr, "trouble converting format\n");
    1051       goto failure;
    1052     }
    1053 
    1054     // write out StarPar table
    1055     if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new)) {
    1056       fprintf (stderr, "trouble writing StarPar table\n");
    1057       goto failure;
    1058     }
    1059     gfits_free_header (&header);
    1060     gfits_free_table (&ftable);
     1052    if (catalog[0].Nstarpar) {
     1053      // convert to external table format (note that the block above does not damage or free catalog.average)
     1054      if (!StarParToFtable (&ftable, &catalog[0].starpar[first], Nrows, catalog[0].catformat)) {
     1055        fprintf (stderr, "trouble converting format\n");
     1056        goto failure;
     1057      }
     1058
     1059      // write out StarPar table
     1060      if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new)) {
     1061        fprintf (stderr, "trouble writing StarPar table\n");
     1062        goto failure;
     1063      }
     1064      gfits_free_header (&header);
     1065      gfits_free_table (&ftable);
     1066    }
    10611067  }
    10621068
  • trunk/Ohana/src/libdvo/src/dvo_convert.c

    r38062 r38153  
    455455    return (lensing); }
    456456
     457  if (!strcmp (extname, "DVO_LENSING_PS1_V5") && (ftable[0].header[0].Naxis[0] == 144)) {
     458    Lensing_PS1_V5_R2 *tmpLensing;                                             
     459    tmpLensing = gfits_table_get_Lensing_PS1_V5_R2 (ftable, Nlensing, NULL);
     460    if (!tmpLensing) {                                                 
     461      fprintf (stderr, "ERROR: failed to read lensings\n");             
     462      exit (2);                                                         
     463    }                                                                   
     464    lensing = Lensing_PS1_V5_R2_ToInternal (tmpLensing, *Nlensing);
     465    free (tmpLensing);                                                 
     466    *format = DVO_FORMAT_PS1_V5;                                       
     467    return (lensing); }
     468
     469# define SKIPPING_FORMAT(NAME, FORMAT, TYPE)            \
     470  if (!strcmp (extname, NAME)) {                                        \
     471    fprintf (stderr, "ERROR: format %s not defined for lensing, skipping\n", NAME); \
     472    *Nlensing = 0; \
     473    return NULL; \
     474  }
     475
    457476# define CONVERT_FORMAT(NAME, FORMAT, TYPE)             \
    458477  if (!strcmp (extname, NAME)) {                                        \
     
    468487    return (lensing); }
    469488
    470 # define SKIPPING_FORMAT(NAME, FORMAT, TYPE)            \
    471   if (!strcmp (extname, NAME)) {                                        \
    472     fprintf (stderr, "ERROR: format %s not defined for lensing, skipping\n", NAME); \
    473     *Nlensing = 0; \
    474     return NULL; \
    475   }
    476 
    477489  if (!strcmp (extname, "DVO_LENSING")) {
    478490    lensing = gfits_table_get_Lensing (ftable, Nlensing, NULL);
     
    496508  SKIPPING_FORMAT ("DVO_LENSING_PS1_V3",          PS1_V3,          PS1_V3);
    497509  SKIPPING_FORMAT ("DVO_LENSING_PS1_V4",          PS1_V4,          PS1_V4);
    498   CONVERT_FORMAT  ("DVO_LENSING_PS1_V5",          PS1_V5,          PS1_V5_R2);
     510  CONVERT_FORMAT  ("DVO_LENSING_PS1_V5",          PS1_V5,          PS1_V5_R3);
     511  SKIPPING_FORMAT ("DVO_LENSING_PS1_SIM",         PS1_SIM,         PS1_SIM);
    499512# undef CONVERT_FORMAT
     513# undef SKIPPING_FORMAT
    500514
    501515  fprintf (stderr, "table format unknown: %s\n", extname);
     
    533547//    FORMAT_CASE (PS1_V3,          PS1_V3);
    534548//    FORMAT_CASE (PS1_V4,          PS1_V4);
    535       FORMAT_CASE (PS1_V5,          PS1_V5_R2);
     549      FORMAT_CASE (PS1_V5,          PS1_V5_R3);
    536550# undef FORMAT_CASE
    537551
     
    554568    fprintf (stderr, "EXTNAME missing for lensobj table\n");
    555569    return (FALSE);
     570  }
     571
     572  if (!strcmp (extname, "DVO_LENSOBJ_PS1_V5") && (ftable[0].header[0].Naxis[0] == 136)) {
     573    Lensobj_PS1_V5_R0 *tmpLensobj;                                             
     574    tmpLensobj = gfits_table_get_Lensobj_PS1_V5_R0 (ftable, Nlensobj, NULL);
     575    if (!tmpLensobj) {                                                 
     576      fprintf (stderr, "ERROR: failed to read lensobjs\n");             
     577      exit (2);                                                         
     578    }                                                                   
     579    lensobj = Lensobj_PS1_V5_R0_ToInternal (tmpLensobj, *Nlensobj);
     580    free (tmpLensobj);                                                 
     581    *format = DVO_FORMAT_PS1_V5;                                       
     582    return (lensobj); }
     583
     584# define SKIPPING_FORMAT(NAME, FORMAT, TYPE)            \
     585  if (!strcmp (extname, NAME)) {                                        \
     586    fprintf (stderr, "ERROR: format %s not defined for lensobj, skipping\n", NAME); \
     587    *Nlensobj = 0; \
     588    return NULL; \
    556589  }
    557590
     
    579612  }
    580613
    581 // CONVERT_FORMAT ("DVO_LENSOBJ_PS1_REF",         PS1_REF,         PS1_REF);
    582 // CONVERT_FORMAT ("DVO_LENSOBJ_ELIXIR",          ELIXIR,          Elixir);
    583 // CONVERT_FORMAT ("DVO_LENSOBJ_LONEOS",          LONEOS,          Loneos);
    584 // CONVERT_FORMAT ("DVO_LENSOBJ_PANSTARRS_DEV_0", PANSTARRS_DEV_0, Panstarrs_DEV_0);
    585 // CONVERT_FORMAT ("DVO_LENSOBJ_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1);
    586 // CONVERT_FORMAT ("DVO_LENSOBJ_PS1_DEV_1",       PS1_DEV_1,       PS1_DEV_1);
    587 // CONVERT_FORMAT ("DVO_LENSOBJ_PS1_DEV_2",       PS1_DEV_2,       PS1_DEV_2);
    588 // CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V1",          PS1_V1,          PS1_V1);
    589 // CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V2",          PS1_V2,          PS1_V2);
    590 // CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V3",          PS1_V3,          PS1_V3);
    591 // CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V4",          PS1_V4,          PS1_V4);
    592   CONVERT_FORMAT ("DVO_LENSOBJ_PS1_V5",          PS1_V5,          PS1_V5);
     614  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_REF",         PS1_REF,         PS1_REF);
     615  SKIPPING_FORMAT ("DVO_LENSOBJ_ELIXIR",          ELIXIR,          Elixir);
     616  SKIPPING_FORMAT ("DVO_LENSOBJ_LONEOS",          LONEOS,          Loneos);
     617  SKIPPING_FORMAT ("DVO_LENSOBJ_PANSTARRS_DEV_0", PANSTARRS_DEV_0, Panstarrs_DEV_0);
     618  SKIPPING_FORMAT ("DVO_LENSOBJ_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1);
     619  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_DEV_1",       PS1_DEV_1,       PS1_DEV_1);
     620  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_DEV_2",       PS1_DEV_2,       PS1_DEV_2);
     621  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V1",          PS1_V1,          PS1_V1);
     622  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V2",          PS1_V2,          PS1_V2);
     623  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V3",          PS1_V3,          PS1_V3);
     624  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V4",          PS1_V4,          PS1_V4);
     625  CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V5",          PS1_V5,          PS1_V5_R1);
     626  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_SIM",         PS1_SIM,         PS1_SIM);
    593627# undef CONVERT_FORMAT
     628# undef SKIPPING_FORMAT
    594629
    595630  fprintf (stderr, "table format unknown: %s\n", extname);
     
    627662//    FORMAT_CASE (PS1_V3,          PS1_V3);
    628663//    FORMAT_CASE (PS1_V4,          PS1_V4);
    629       FORMAT_CASE (PS1_V5,          PS1_V5);
     664      FORMAT_CASE (PS1_V5,          PS1_V5_R1);
    630665# undef FORMAT_CASE
    631666
     
    648683    fprintf (stderr, "EXTNAME missing for starpar table\n");
    649684    return (FALSE);
     685  }
     686
     687# define SKIPPING_FORMAT(NAME, FORMAT, TYPE)            \
     688  if (!strcmp (extname, NAME)) {                                        \
     689    fprintf (stderr, "ERROR: format %s not defined for starpar, skipping\n", NAME); \
     690    *Nstarpar = 0; \
     691    return NULL; \
    650692  }
    651693
     
    673715  }
    674716
    675    CONVERT_FORMAT ("DVO_STARPAR_PS1_SIM",         PS1_SIM,         PS1_SIM);
    676 // CONVERT_FORMAT ("DVO_STARPAR_PS1_REF",         PS1_REF,         PS1_REF);
    677 // CONVERT_FORMAT ("DVO_STARPAR_ELIXIR",          ELIXIR,          Elixir);
    678 // CONVERT_FORMAT ("DVO_STARPAR_LONEOS",          LONEOS,          Loneos);
    679 // CONVERT_FORMAT ("DVO_STARPAR_PANSTARRS_DEV_0", PANSTARRS_DEV_0, Panstarrs_DEV_0);
    680 // CONVERT_FORMAT ("DVO_STARPAR_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1);
    681 // CONVERT_FORMAT ("DVO_STARPAR_PS1_DEV_1",       PS1_DEV_1,       PS1_DEV_1);
    682 // CONVERT_FORMAT ("DVO_STARPAR_PS1_DEV_2",       PS1_DEV_2,       PS1_DEV_2);
    683 // CONVERT_FORMAT ("DVO_STARPAR_PS1_V1",          PS1_V1,          PS1_V1);
    684 // CONVERT_FORMAT ("DVO_STARPAR_PS1_V2",          PS1_V2,          PS1_V2);
    685 // CONVERT_FORMAT ("DVO_STARPAR_PS1_V3",          PS1_V3,          PS1_V3);
    686 // CONVERT_FORMAT ("DVO_STARPAR_PS1_V4",          PS1_V4,          PS1_V4);
    687   CONVERT_FORMAT ("DVO_STARPAR_PS1_V5",          PS1_V5,          PS1_V5);
    688 //  CONVERT_FORMAT ("DVO_STELLAR_PARAMS_PS1_V5",          PS1_V5,          PS1_V5);
    689   // XXX fix in libauto: STELLAR_PARAMS to STARPAR
     717  CONVERT_FORMAT  ("DVO_STARPAR_PS1_SIM",         PS1_SIM,         PS1_SIM);
     718  SKIPPING_FORMAT ("DVO_STARPAR_PS1_REF",         PS1_REF,         PS1_REF);
     719  SKIPPING_FORMAT ("DVO_STARPAR_ELIXIR",          ELIXIR,          Elixir);
     720  SKIPPING_FORMAT ("DVO_STARPAR_LONEOS",          LONEOS,          Loneos);
     721  SKIPPING_FORMAT ("DVO_STARPAR_PANSTARRS_DEV_0", PANSTARRS_DEV_0, Panstarrs_DEV_0);
     722  SKIPPING_FORMAT ("DVO_STARPAR_PANSTARRS_DEV_1", PANSTARRS_DEV_1, Panstarrs_DEV_1);
     723  SKIPPING_FORMAT ("DVO_STARPAR_PS1_DEV_1",       PS1_DEV_1,       PS1_DEV_1);
     724  SKIPPING_FORMAT ("DVO_STARPAR_PS1_DEV_2",       PS1_DEV_2,       PS1_DEV_2);
     725  SKIPPING_FORMAT ("DVO_STARPAR_PS1_V1",          PS1_V1,          PS1_V1);
     726  SKIPPING_FORMAT ("DVO_STARPAR_PS1_V2",          PS1_V2,          PS1_V2);
     727  SKIPPING_FORMAT ("DVO_STARPAR_PS1_V3",          PS1_V3,          PS1_V3);
     728  SKIPPING_FORMAT ("DVO_STARPAR_PS1_V4",          PS1_V4,          PS1_V4);
     729  CONVERT_FORMAT  ("DVO_STARPAR_PS1_V5",          PS1_V5,          PS1_V5);
    690730# undef CONVERT_FORMAT
     731# undef SKIPPING_FORMAT
    691732
    692733  fprintf (stderr, "table format unknown: %s\n", extname);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c

    r38062 r38153  
    448448}
    449449
    450 Lensing *Lensing_PS1_V5_R2_ToInternal (Lensing_PS1_V5_R2 *in, off_t Nvalues) {
     450Lensing *Lensing_PS1_V5_R0_ToInternal (Lensing_PS1_V5_R0 *in, off_t Nvalues) {
    451451
    452452  off_t i;
     
    481481    out[i].E1_sh_psf   = in[i].E1_sh_psf;
    482482    out[i].E2_sh_psf   = in[i].E2_sh_psf;
    483 
    484     out[i].E1_psf      = in[i].E1_psf;
    485     out[i].E2_psf      = in[i].E2_psf;
    486483
    487484    out[i].F_ApR5      = in[i].F_ApR5;
     
    499496    out[i].catID       = in[i].catID;
    500497    out[i].averef      = in[i].averef;
    501 
    502     out[i].imageID     = in[i].imageID;
    503   }
    504   return (out);
    505 }
    506 
    507 Lensing_PS1_V5_R2 *LensingInternalTo_PS1_V5_R2 (Lensing *in, off_t Nvalues) {
    508 
    509   off_t i;
    510   Lensing_PS1_V5_R2 *out;
    511 
    512   ALLOCATE_ZERO (out, Lensing_PS1_V5, Nvalues);
    513 
    514   for (i = 0; i < Nvalues; i++) {
     498  }
     499  return (out);
     500}
     501
     502Lensing *Lensing_PS1_V5_R1_ToInternal (Lensing_PS1_V5_R1 *in, off_t Nvalues) {
     503
     504  off_t i;
     505  Lensing *out;
     506
     507  ALLOCATE_ZERO (out, Lensing, Nvalues);
     508
     509  for (i = 0; i < Nvalues; i++) {
     510    dvo_lensing_init (&out[i]);
    515511
    516512    out[i].X11_sm_obj  = in[i].X11_sm_obj;     
     
    537533    out[i].E1_sh_psf   = in[i].E1_sh_psf;
    538534    out[i].E2_sh_psf   = in[i].E2_sh_psf;
    539 
    540     out[i].E1_psf      = in[i].E1_psf;
    541     out[i].E2_psf      = in[i].E2_psf;
    542535
    543536    out[i].F_ApR5      = in[i].F_ApR5;
     
    561554}
    562555
    563 Lensobj *Lensobj_PS1_V5_ToInternal (Lensobj_PS1_V5 *in, off_t Nvalues) {
     556Lensing *Lensing_PS1_V5_R2_ToInternal (Lensing_PS1_V5_R2 *in, off_t Nvalues) {
     557
     558  off_t i;
     559  Lensing *out;
     560
     561  ALLOCATE_ZERO (out, Lensing, Nvalues);
     562
     563  for (i = 0; i < Nvalues; i++) {
     564    dvo_lensing_init (&out[i]);
     565
     566    out[i].X11_sm_obj  = in[i].X11_sm_obj;     
     567    out[i].X12_sm_obj  = in[i].X12_sm_obj;     
     568    out[i].X22_sm_obj  = in[i].X22_sm_obj;     
     569    out[i].E1_sm_obj   = in[i].E1_sm_obj;     
     570    out[i].E2_sm_obj   = in[i].E2_sm_obj;     
     571                                         
     572    out[i].X11_sh_obj  = in[i].X11_sh_obj;     
     573    out[i].X12_sh_obj  = in[i].X12_sh_obj;     
     574    out[i].X22_sh_obj  = in[i].X22_sh_obj;     
     575    out[i].E1_sh_obj   = in[i].E1_sh_obj;     
     576    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
     577                                         
     578    out[i].X11_sm_psf  = in[i].X11_sm_psf;
     579    out[i].X12_sm_psf  = in[i].X12_sm_psf;
     580    out[i].X22_sm_psf  = in[i].X22_sm_psf;
     581    out[i].E1_sm_psf   = in[i].E1_sm_psf;
     582    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
     583                                         
     584    out[i].X11_sh_psf  = in[i].X11_sh_psf;
     585    out[i].X12_sh_psf  = in[i].X12_sh_psf;
     586    out[i].X22_sh_psf  = in[i].X22_sh_psf;
     587    out[i].E1_sh_psf   = in[i].E1_sh_psf;
     588    out[i].E2_sh_psf   = in[i].E2_sh_psf;
     589
     590    out[i].E1_psf      = in[i].E1_psf;
     591    out[i].E2_psf      = in[i].E2_psf;
     592
     593    out[i].F_ApR5      = in[i].F_ApR5;
     594    out[i].dF_ApR5     = in[i].dF_ApR5;
     595    out[i].sF_ApR5     = in[i].sF_ApR5;
     596    out[i].fF_ApR5     = in[i].fF_ApR5;
     597                                   
     598    out[i].F_ApR6      = in[i].F_ApR6;
     599    out[i].dF_ApR6     = in[i].dF_ApR6;
     600    out[i].sF_ApR6     = in[i].sF_ApR6;
     601    out[i].fF_ApR6     = in[i].fF_ApR6;
     602                                   
     603    out[i].detID       = in[i].detID;
     604    out[i].objID       = in[i].objID;
     605    out[i].catID       = in[i].catID;
     606    out[i].averef      = in[i].averef;
     607
     608    out[i].imageID     = in[i].imageID;
     609  }
     610  return (out);
     611}
     612
     613Lensing *Lensing_PS1_V5_R3_ToInternal (Lensing_PS1_V5_R3 *in, off_t Nvalues) {
     614
     615  off_t i;
     616  Lensing *out;
     617
     618  ALLOCATE_ZERO (out, Lensing, Nvalues);
     619
     620  for (i = 0; i < Nvalues; i++) {
     621    dvo_lensing_init (&out[i]);
     622
     623    out[i].X11_sm_obj  = in[i].X11_sm_obj;     
     624    out[i].X12_sm_obj  = in[i].X12_sm_obj;     
     625    out[i].X22_sm_obj  = in[i].X22_sm_obj;     
     626    out[i].E1_sm_obj   = in[i].E1_sm_obj;     
     627    out[i].E2_sm_obj   = in[i].E2_sm_obj;     
     628                                         
     629    out[i].X11_sh_obj  = in[i].X11_sh_obj;     
     630    out[i].X12_sh_obj  = in[i].X12_sh_obj;     
     631    out[i].X22_sh_obj  = in[i].X22_sh_obj;     
     632    out[i].E1_sh_obj   = in[i].E1_sh_obj;     
     633    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
     634                                         
     635    out[i].X11_sm_psf  = in[i].X11_sm_psf;
     636    out[i].X12_sm_psf  = in[i].X12_sm_psf;
     637    out[i].X22_sm_psf  = in[i].X22_sm_psf;
     638    out[i].E1_sm_psf   = in[i].E1_sm_psf;
     639    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
     640                                         
     641    out[i].X11_sh_psf  = in[i].X11_sh_psf;
     642    out[i].X12_sh_psf  = in[i].X12_sh_psf;
     643    out[i].X22_sh_psf  = in[i].X22_sh_psf;
     644    out[i].E1_sh_psf   = in[i].E1_sh_psf;
     645    out[i].E2_sh_psf   = in[i].E2_sh_psf;
     646
     647    out[i].E1_psf      = in[i].E1_psf;
     648    out[i].E2_psf      = in[i].E2_psf;
     649
     650    out[i].F_ApR5      = in[i].F_ApR5;
     651    out[i].dF_ApR5     = in[i].dF_ApR5;
     652    out[i].sF_ApR5     = in[i].sF_ApR5;
     653    out[i].fF_ApR5     = in[i].fF_ApR5;
     654                                   
     655    out[i].F_ApR6      = in[i].F_ApR6;
     656    out[i].dF_ApR6     = in[i].dF_ApR6;
     657    out[i].sF_ApR6     = in[i].sF_ApR6;
     658    out[i].fF_ApR6     = in[i].fF_ApR6;
     659                                   
     660    out[i].F_ApR7      = in[i].F_ApR7;
     661    out[i].dF_ApR7     = in[i].dF_ApR7;
     662    out[i].sF_ApR7     = in[i].sF_ApR7;
     663    out[i].fF_ApR7     = in[i].fF_ApR7;
     664                                   
     665    out[i].detID       = in[i].detID;
     666    out[i].objID       = in[i].objID;
     667    out[i].catID       = in[i].catID;
     668    out[i].averef      = in[i].averef;
     669
     670    out[i].imageID     = in[i].imageID;
     671  }
     672  return (out);
     673}
     674
     675Lensing_PS1_V5_R3 *LensingInternalTo_PS1_V5_R3 (Lensing *in, off_t Nvalues) {
     676
     677  off_t i;
     678  Lensing_PS1_V5_R3 *out;
     679
     680  ALLOCATE_ZERO (out, Lensing_PS1_V5_R3, Nvalues);
     681
     682  for (i = 0; i < Nvalues; i++) {
     683
     684    out[i].X11_sm_obj  = in[i].X11_sm_obj;     
     685    out[i].X12_sm_obj  = in[i].X12_sm_obj;     
     686    out[i].X22_sm_obj  = in[i].X22_sm_obj;     
     687    out[i].E1_sm_obj   = in[i].E1_sm_obj;     
     688    out[i].E2_sm_obj   = in[i].E2_sm_obj;     
     689                                         
     690    out[i].X11_sh_obj  = in[i].X11_sh_obj;     
     691    out[i].X12_sh_obj  = in[i].X12_sh_obj;     
     692    out[i].X22_sh_obj  = in[i].X22_sh_obj;     
     693    out[i].E1_sh_obj   = in[i].E1_sh_obj;     
     694    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
     695                                         
     696    out[i].X11_sm_psf  = in[i].X11_sm_psf;
     697    out[i].X12_sm_psf  = in[i].X12_sm_psf;
     698    out[i].X22_sm_psf  = in[i].X22_sm_psf;
     699    out[i].E1_sm_psf   = in[i].E1_sm_psf;
     700    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
     701                                         
     702    out[i].X11_sh_psf  = in[i].X11_sh_psf;
     703    out[i].X12_sh_psf  = in[i].X12_sh_psf;
     704    out[i].X22_sh_psf  = in[i].X22_sh_psf;
     705    out[i].E1_sh_psf   = in[i].E1_sh_psf;
     706    out[i].E2_sh_psf   = in[i].E2_sh_psf;
     707
     708    out[i].E1_psf      = in[i].E1_psf;
     709    out[i].E2_psf      = in[i].E2_psf;
     710
     711    out[i].F_ApR5      = in[i].F_ApR5;
     712    out[i].dF_ApR5     = in[i].dF_ApR5;
     713    out[i].sF_ApR5     = in[i].sF_ApR5;
     714    out[i].fF_ApR5     = in[i].fF_ApR5;
     715                                   
     716    out[i].F_ApR6      = in[i].F_ApR6;
     717    out[i].dF_ApR6     = in[i].dF_ApR6;
     718    out[i].sF_ApR6     = in[i].sF_ApR6;
     719    out[i].fF_ApR6     = in[i].fF_ApR6;
     720                                   
     721    out[i].F_ApR7      = in[i].F_ApR7;
     722    out[i].dF_ApR7     = in[i].dF_ApR7;
     723    out[i].sF_ApR7     = in[i].sF_ApR7;
     724    out[i].fF_ApR7     = in[i].fF_ApR7;
     725                                   
     726    out[i].detID       = in[i].detID;
     727    out[i].objID       = in[i].objID;
     728    out[i].catID       = in[i].catID;
     729    out[i].averef      = in[i].averef;
     730
     731    out[i].imageID     = in[i].imageID;
     732  }
     733  return (out);
     734}
     735
     736Lensobj *Lensobj_PS1_V5_R0_ToInternal (Lensobj_PS1_V5_R0 *in, off_t Nvalues) {
    564737
    565738  off_t i;
     
    618791}
    619792
    620 Lensobj_PS1_V5 *LensobjInternalTo_PS1_V5 (Lensobj *in, off_t Nvalues) {
    621 
    622   off_t i;
    623   Lensobj_PS1_V5 *out;
    624 
    625   ALLOCATE_ZERO (out, Lensobj_PS1_V5, Nvalues);
    626 
    627   for (i = 0; i < Nvalues; i++) {
     793Lensobj *Lensobj_PS1_V5_R1_ToInternal (Lensobj_PS1_V5_R1 *in, off_t Nvalues) {
     794
     795  off_t i;
     796  Lensobj *out;
     797
     798  ALLOCATE_ZERO (out, Lensobj, Nvalues);
     799
     800  for (i = 0; i < Nvalues; i++) {
     801    dvo_lensobj_init (&out[i], FALSE);
    628802
    629803    out[i].X11_sm_obj  = in[i].X11_sm_obj;     
     
    660834    out[i].sF_ApR6     = in[i].sF_ApR6;
    661835    out[i].fF_ApR6     = in[i].fF_ApR6;
     836                                   
     837    out[i].F_ApR7      = in[i].F_ApR7;
     838    out[i].dF_ApR7     = in[i].dF_ApR7;
     839    out[i].sF_ApR7     = in[i].sF_ApR7;
     840    out[i].fF_ApR7     = in[i].fF_ApR7;
     841                                   
     842    out[i].gamma       = in[i].gamma;
     843    out[i].E1          = in[i].E1;
     844    out[i].E2          = in[i].E2;
     845
     846    out[i].objID       = in[i].objID;
     847    out[i].catID       = in[i].catID;
     848
     849    out[i].photcode    = in[i].photcode;
     850    out[i].Nmeas       = in[i].Nmeas;
     851  }
     852  return (out);
     853}
     854
     855Lensobj_PS1_V5_R1 *LensobjInternalTo_PS1_V5_R1 (Lensobj *in, off_t Nvalues) {
     856
     857  off_t i;
     858  Lensobj_PS1_V5_R1 *out;
     859
     860  ALLOCATE_ZERO (out, Lensobj_PS1_V5_R1, Nvalues);
     861
     862  for (i = 0; i < Nvalues; i++) {
     863
     864    out[i].X11_sm_obj  = in[i].X11_sm_obj;     
     865    out[i].X12_sm_obj  = in[i].X12_sm_obj;     
     866    out[i].X22_sm_obj  = in[i].X22_sm_obj;     
     867    out[i].E1_sm_obj   = in[i].E1_sm_obj;     
     868    out[i].E2_sm_obj   = in[i].E2_sm_obj;     
     869                                         
     870    out[i].X11_sh_obj  = in[i].X11_sh_obj;     
     871    out[i].X12_sh_obj  = in[i].X12_sh_obj;     
     872    out[i].X22_sh_obj  = in[i].X22_sh_obj;     
     873    out[i].E1_sh_obj   = in[i].E1_sh_obj;     
     874    out[i].E2_sh_obj   = in[i].E2_sh_obj;     
     875                                         
     876    out[i].X11_sm_psf  = in[i].X11_sm_psf;
     877    out[i].X12_sm_psf  = in[i].X12_sm_psf;
     878    out[i].X22_sm_psf  = in[i].X22_sm_psf;
     879    out[i].E1_sm_psf   = in[i].E1_sm_psf;
     880    out[i].E2_sm_psf   = in[i].E2_sm_psf;     
     881                                         
     882    out[i].X11_sh_psf  = in[i].X11_sh_psf;
     883    out[i].X12_sh_psf  = in[i].X12_sh_psf;
     884    out[i].X22_sh_psf  = in[i].X22_sh_psf;
     885    out[i].E1_sh_psf   = in[i].E1_sh_psf;
     886    out[i].E2_sh_psf   = in[i].E2_sh_psf;
     887
     888    out[i].F_ApR5      = in[i].F_ApR5;
     889    out[i].dF_ApR5     = in[i].dF_ApR5;
     890    out[i].sF_ApR5     = in[i].sF_ApR5;
     891    out[i].fF_ApR5     = in[i].fF_ApR5;
     892                                   
     893    out[i].F_ApR6      = in[i].F_ApR6;
     894    out[i].dF_ApR6     = in[i].dF_ApR6;
     895    out[i].sF_ApR6     = in[i].sF_ApR6;
     896    out[i].fF_ApR6     = in[i].fF_ApR6;
     897                                   
     898    out[i].F_ApR7      = in[i].F_ApR7;
     899    out[i].dF_ApR7     = in[i].dF_ApR7;
     900    out[i].sF_ApR7     = in[i].sF_ApR7;
     901    out[i].fF_ApR7     = in[i].fF_ApR7;
    662902                                   
    663903    out[i].gamma       = in[i].gamma;
     
    12711511  }
    12721512  return (data);
    1273 }
    1274 
    1275 Lensing *Lensing_PS1_V5_R0_ToInternal (Lensing_PS1_V5_R0 *in, off_t Nvalues) {
    1276 
    1277   off_t i;
    1278   Lensing *out;
    1279 
    1280   ALLOCATE_ZERO (out, Lensing, Nvalues);
    1281 
    1282   for (i = 0; i < Nvalues; i++) {
    1283     dvo_lensing_init (&out[i]);
    1284 
    1285     out[i].X11_sm_obj  = in[i].X11_sm_obj;     
    1286     out[i].X12_sm_obj  = in[i].X12_sm_obj;     
    1287     out[i].X22_sm_obj  = in[i].X22_sm_obj;     
    1288     out[i].E1_sm_obj   = in[i].E1_sm_obj;     
    1289     out[i].E2_sm_obj   = in[i].E2_sm_obj;     
    1290                                          
    1291     out[i].X11_sh_obj  = in[i].X11_sh_obj;     
    1292     out[i].X12_sh_obj  = in[i].X12_sh_obj;     
    1293     out[i].X22_sh_obj  = in[i].X22_sh_obj;     
    1294     out[i].E1_sh_obj   = in[i].E1_sh_obj;     
    1295     out[i].E2_sh_obj   = in[i].E2_sh_obj;     
    1296                                          
    1297     out[i].X11_sm_psf  = in[i].X11_sm_psf;
    1298     out[i].X12_sm_psf  = in[i].X12_sm_psf;
    1299     out[i].X22_sm_psf  = in[i].X22_sm_psf;
    1300     out[i].E1_sm_psf   = in[i].E1_sm_psf;
    1301     out[i].E2_sm_psf   = in[i].E2_sm_psf;     
    1302                                          
    1303     out[i].X11_sh_psf  = in[i].X11_sh_psf;
    1304     out[i].X12_sh_psf  = in[i].X12_sh_psf;
    1305     out[i].X22_sh_psf  = in[i].X22_sh_psf;
    1306     out[i].E1_sh_psf   = in[i].E1_sh_psf;
    1307     out[i].E2_sh_psf   = in[i].E2_sh_psf;
    1308 
    1309     out[i].F_ApR5      = in[i].F_ApR5;
    1310     out[i].dF_ApR5     = in[i].dF_ApR5;
    1311     out[i].sF_ApR5     = in[i].sF_ApR5;
    1312     out[i].fF_ApR5     = in[i].fF_ApR5;
    1313                                    
    1314     out[i].F_ApR6      = in[i].F_ApR6;
    1315     out[i].dF_ApR6     = in[i].dF_ApR6;
    1316     out[i].sF_ApR6     = in[i].sF_ApR6;
    1317     out[i].fF_ApR6     = in[i].fF_ApR6;
    1318                                    
    1319     out[i].detID       = in[i].detID;
    1320     out[i].objID       = in[i].objID;
    1321     out[i].catID       = in[i].catID;
    1322     out[i].averef      = in[i].averef;
    1323   }
    1324   return (out);
    1325 }
    1326 
    1327 Lensing *Lensing_PS1_V5_R1_ToInternal (Lensing_PS1_V5_R1 *in, off_t Nvalues) {
    1328 
    1329   off_t i;
    1330   Lensing *out;
    1331 
    1332   ALLOCATE_ZERO (out, Lensing, Nvalues);
    1333 
    1334   for (i = 0; i < Nvalues; i++) {
    1335     dvo_lensing_init (&out[i]);
    1336 
    1337     out[i].X11_sm_obj  = in[i].X11_sm_obj;     
    1338     out[i].X12_sm_obj  = in[i].X12_sm_obj;     
    1339     out[i].X22_sm_obj  = in[i].X22_sm_obj;     
    1340     out[i].E1_sm_obj   = in[i].E1_sm_obj;     
    1341     out[i].E2_sm_obj   = in[i].E2_sm_obj;     
    1342                                          
    1343     out[i].X11_sh_obj  = in[i].X11_sh_obj;     
    1344     out[i].X12_sh_obj  = in[i].X12_sh_obj;     
    1345     out[i].X22_sh_obj  = in[i].X22_sh_obj;     
    1346     out[i].E1_sh_obj   = in[i].E1_sh_obj;     
    1347     out[i].E2_sh_obj   = in[i].E2_sh_obj;     
    1348                                          
    1349     out[i].X11_sm_psf  = in[i].X11_sm_psf;
    1350     out[i].X12_sm_psf  = in[i].X12_sm_psf;
    1351     out[i].X22_sm_psf  = in[i].X22_sm_psf;
    1352     out[i].E1_sm_psf   = in[i].E1_sm_psf;
    1353     out[i].E2_sm_psf   = in[i].E2_sm_psf;     
    1354                                          
    1355     out[i].X11_sh_psf  = in[i].X11_sh_psf;
    1356     out[i].X12_sh_psf  = in[i].X12_sh_psf;
    1357     out[i].X22_sh_psf  = in[i].X22_sh_psf;
    1358     out[i].E1_sh_psf   = in[i].E1_sh_psf;
    1359     out[i].E2_sh_psf   = in[i].E2_sh_psf;
    1360 
    1361     out[i].F_ApR5      = in[i].F_ApR5;
    1362     out[i].dF_ApR5     = in[i].dF_ApR5;
    1363     out[i].sF_ApR5     = in[i].sF_ApR5;
    1364     out[i].fF_ApR5     = in[i].fF_ApR5;
    1365                                    
    1366     out[i].F_ApR6      = in[i].F_ApR6;
    1367     out[i].dF_ApR6     = in[i].dF_ApR6;
    1368     out[i].sF_ApR6     = in[i].sF_ApR6;
    1369     out[i].fF_ApR6     = in[i].fF_ApR6;
    1370                                    
    1371     out[i].detID       = in[i].detID;
    1372     out[i].objID       = in[i].objID;
    1373     out[i].catID       = in[i].catID;
    1374     out[i].averef      = in[i].averef;
    1375 
    1376     out[i].imageID     = in[i].imageID;
    1377   }
    1378   return (out);
    13791513}
    13801514
  • trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c

    r37807 r38153  
    18221822LENSFIELD(E1_sh_psf);
    18231823LENSFIELD(E2_sh_psf);
     1824
     1825LENSFIELD( F_ApR5);
     1826LENSFIELD(dF_ApR5);
     1827LENSFIELD(sF_ApR5);
     1828LENSFIELD(fF_ApR5);
     1829
     1830LENSFIELD( F_ApR6);
     1831LENSFIELD(dF_ApR6);
     1832LENSFIELD(sF_ApR6);
     1833LENSFIELD(fF_ApR6);
     1834
     1835LENSFIELD( F_ApR7);
     1836LENSFIELD(dF_ApR7);
     1837LENSFIELD(sF_ApR7);
     1838LENSFIELD(fF_ApR7);
     1839
     1840LENSFIELD(E1);
     1841LENSFIELD(E2);
  • trunk/Ohana/src/libkapa/src/KapaColors.c

    r27817 r38153  
    11# include <kapa_internal.h>
    22
    3 # define N_KAPA_COLORS 23
     3# define N_KAPA_COLORS 42
    44
    55static char KAPA_COLORS[N_KAPA_COLORS][3][16] = {
     
    1414{"green",        "green",        "0.00 1.00 0.00"},
    1515{"darkgreen",    "darkgreen",    "0.00 0.40 0.00"},
     16{"darkblue",     "darkblue",     "0.50 0.50 1.00"},
    1617{"blue",         "blue",         "0.00 0.00 1.00"},
    1718{"skyblue",      "skyblue",      "0.53 0.81 0.92"},
    1819{"indigo",       "mediumpurple", "0.57 0.44 0.86"},
    1920{"violet",       "darkviolet",   "0.58 0.00 0.88"},
     21{"blue10",       "rgb:00/00/33", "0.00 0.00 0.20"},
     22{"blue20",       "rgb:00/00/66", "0.00 0.00 0.40"},
     23{"blue30",       "rgb:00/00/99", "0.00 0.00 0.60"},
     24{"blue40",       "rgb:00/00/cc", "0.00 0.00 0.80"},
     25{"blue50",       "rgb:00/00/ff", "0.00 0.00 1.00"},
     26{"blue60",       "rgb:33/33/ff", "0.20 0.20 1.00"},
     27{"blue70",       "rgb:66/66/ff", "0.40 0.40 1.00"},
     28{"blue80",       "rgb:99/99/ff", "0.60 0.60 1.00"},
     29{"blue90",       "rgb:cc/cc/ff", "0.80 0.80 1.00"},
     30{"red10",        "rgb:33/00/00",         "0.20 0.00 0.00"},
     31{"red20",        "rgb:66/00/00",         "0.40 0.00 0.00"},
     32{"red30",        "rgb:99/00/00",         "0.60 0.00 0.00"},
     33{"red40",        "rgb:cc/00/00",         "0.80 0.00 0.00"},
     34{"red50",        "rgb:ff/00/00",         "1.00 0.00 0.00"},
     35{"red60",        "rgb:ff/33/33",         "1.00 0.20 0.20"},
     36{"red70",        "rgb:ff/66/66",         "1.00 0.40 0.40"},
     37{"red80",        "rgb:ff/99/99",         "1.00 0.60 0.60"},
     38{"red90",        "rgb:ff/cc/cc",         "1.00 0.80 0.80"},
    2039{"grey10",       "grey10",       "0.10 0.10 0.10"},
    2140{"grey20",       "grey20",       "0.20 0.20 0.20"},
  • trunk/Ohana/src/opihi/cmd.data

  • trunk/Ohana/src/opihi/cmd.data/imhist.c

    r20936 r38153  
    33int imhist (int argc, char **argv) {
    44 
    5   int i, j, N, Nbins, Quiet;
    6   int sx, sy, nx, ny, bin;
    7   float *V, delta;
    8   double max, min, dx;
     5  int i, j, N, Nbins;
     6  int bin;
     7  float *V;
     8  double dx;
    99  Vector *vec1, *vec2;
    1010  Buffer *buf;
    1111
    12   Quiet = FALSE;
     12  int Quiet = FALSE;
    1313  if ((N = get_argument (argc, argv, "-q"))) {
    1414    Quiet = TRUE;
     
    2020  }
    2121
    22   delta = 0;
     22  float delta = 0;
    2323  if ((N = get_argument (argc, argv, "-delta"))) {
    2424    remove_argument (N, &argc, argv);
     
    2727  }
    2828
    29   min = max = 0.0;
     29  int ClipNAN = FALSE;
     30  if ((N = get_argument (argc, argv, "-clip-nan"))) {
     31    remove_argument (N, &argc, argv);
     32    ClipNAN = TRUE;
     33  } 
     34
     35  double min = 0.0, max = 0.0;
    3036  if ((N = get_argument (argc, argv, "-range"))) {
    3137    remove_argument (N, &argc, argv);
     
    3642  }
    3743
    38   sx = sy = 0.0;
    39   nx = ny = 0.0;
     44  int sx = 0, sy = 0;
     45  int nx = 0, ny = 0;
    4046  if ((N = get_argument (argc, argv, "-region"))) {
    4147    remove_argument (N, &argc, argv);
     
    8490      V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx;
    8591      for (i = 0; i < nx; i++, V++) {
     92        if (ClipNAN && isnan(*V)) continue;
    8693        max = MAX (max, *V);
    8794        min = MIN (min, *V);
     
    113120    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx;
    114121    for (i = 0; i < nx; i++, V++) {
     122      if (ClipNAN && isnan(*V)) continue;
    115123      bin = MAX (MIN (Nbins, (*V - min) / dx), 0);
    116124      vec2[0].elements.Flt[bin] += 1.0;
  • trunk/Ohana/src/opihi/lib.data/graphtools.c

    r31160 r38153  
    1010  if (xvec != NULL) {
    1111    if (xvec->type == OPIHI_FLT) {
    12       maxX = minX = xvec[0].elements.Flt[0];
    13       for (i = 1; i < xvec[0].Nelements; i++) {
     12      maxX = DBL_MIN;
     13      minX = DBL_MAX;
     14      for (i = 0; i < xvec[0].Nelements; i++) {
    1415        if (!finite(xvec[0].elements.Flt[i])) continue;
    1516        maxX = MAX (maxX, xvec[0].elements.Flt[i]);
     
    1920      maxX = minX = xvec[0].elements.Int[0];
    2021      for (i = 1; i < xvec[0].Nelements; i++) {
    21         if (!finite(xvec[0].elements.Int[i])) continue;
    2222        maxX = MAX (maxX, xvec[0].elements.Int[i]);
    2323        minX = MIN (minX, xvec[0].elements.Int[i]);
     
    3333  if (yvec != NULL) {
    3434    if (yvec->type == OPIHI_FLT) {
    35       maxY = minY = yvec[0].elements.Flt[0];
    36       for (i = 1; i < yvec[0].Nelements; i++) {
     35      maxY = DBL_MIN;
     36      minY = DBL_MAX;
     37      for (i = 0; i < yvec[0].Nelements; i++) {
    3738        if (!finite(yvec[0].elements.Flt[i])) continue;
    3839        maxY = MAX (maxY, yvec[0].elements.Flt[i]);
     
    4243      maxY = minY = yvec[0].elements.Int[0];
    4344      for (i = 1; i < yvec[0].Nelements; i++) {
    44         if (!finite(yvec[0].elements.Int[i])) continue;
    4545        maxY = MAX (maxY, yvec[0].elements.Int[i]);
    4646        minY = MIN (minY, yvec[0].elements.Int[i]);
  • trunk/Ohana/src/relphot/src/setMrelCatalog.c

    r37924 r38153  
    756756
    757757      if (IS_DIFF_DB) {
    758         if (!MatchImageSkycellID (meas, cat, priTessID, priProjID, priSkycellID)) continue;
     758        if (MatchImageSkycellID (meas, cat, priTessID, priProjID, priSkycellID)) {
     759          measure[k].dbFlags |= ID_MEAS_STACK_PRIMARY;
     760        } else {
     761          continue;
     762        }
    759763      } else {
    760764        if (!MatchImageSkycellID (meas, cat, stkTessID, stkProjID, stkSkycellID)) continue;
  • trunk/dbconfig/changes.txt

  • trunk/ippconfig

  • trunk/psModules/src/objects

Note: See TracChangeset for help on using the changeset viewer.