IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12008


Ignore:
Timestamp:
Feb 22, 2007, 4:05:39 PM (19 years ago)
Author:
eugene
Message:

adding fields needed by DVO for PS1 support; pre-calculating Xccd, Yccd

Location:
branches/dvo-mods-2007-02/Ohana/src
Files:
104 edited

Legend:

Unmodified
Added
Removed
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/FilterStars.c

    r10937 r12008  
    2525    while (stars[N].R >= 360.0) stars[N].R -= 360.0;
    2626    stars[N].found = -1;
    27     stars[N].code = image[0].source;
     27    stars[N].code = image[0].photcode;
    2828
    2929    /** additional quantities to supply to Stars based on the image data **/
    3030
    3131    /* calculate accurate per-star airmass */
    32     stars[N].airmass = airmass (image[0].secz_PS, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude);
    33     stars[N].Mcal    = image[0].Mcal_PS;
     32    stars[N].airmass = airmass (image[0].secz, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude);
     33    stars[N].Mcal    = image[0].Mcal;
    3434    stars[N].t       = image[0].tzero + 1e-4*stars[N].Y*image[0].trate;  /* trate is in 0.1 msec / row */
    3535
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/ImageOptions.c

    r10937 r12008  
    2424    if (!strcmp (&images[0].coords.ctype[4], "-DIS")) continue;
    2525
    26     photcode = GetPhotcodebyCode (images[i].source);
     26    photcode = GetPhotcodebyCode (images[i].photcode);
    2727
    2828    if (equivPhotcode) {
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/LoadStars.c

    r10897 r12008  
    5252    exit (1);
    5353  }
    54   image[0].source = photcode;
     54  image[0].photcode = photcode;
    5555
    5656  image[0].NX -= XOVERSCAN;
     
    6262  tmp = 0;
    6363  /* gfits_scan (&header, "APMIFIT",  "%lf", 1, &tmp); */
    64   image[0].apmifit_PS = tmp;
     64  image[0].apmifit = tmp;
    6565
    6666  tmp = 0;
    6767  /* gfits_scan (&header, "dAPMIFIT", "%lf", 1, &tmp); */
    68   image[0].dapmifit_PS = tmp;
     68  image[0].dapmifit = tmp;
    6969
    7070  tmp = 0;
     
    108108  tmp = 0;
    109109  gfits_scan (&header, AirmassKeyword, "%lf", 1, &tmp);
    110   image[0].secz_PS = MIN (NO_MAG, tmp);
     110  image[0].secz = MIN (NO_MAG, tmp);
    111111
    112112  if (!gfits_scan (&header, CCDNumKeyword, "%d", 1, &itmp)) {
     
    120120
    121121  /* secz is in units milli-airmass */
    122   image[0].Mcal_PS = 0.0;
     122  image[0].Mcal = 0.0;
    123123  image[0].Xm   = NO_MAG;
    124124  image[0].code = 0;
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/ReadImageHeader.c

    r10937 r12008  
    6666    exit (1);
    6767  }
    68   image[0].source = photcode;
     68  image[0].photcode = photcode;
    6969
    7070  image[0].NX -= XOVERSCAN;
     
    7676  tmp = 0;
    7777  /* gfits_scan (header, "APMIFIT",  "%lf", 1, &tmp); */
    78   image[0].apmifit_PS = tmp;
     78  image[0].apmifit = tmp;
    7979
    8080  tmp = 0;
    8181  /* gfits_scan (header, "dAPMIFIT", "%lf", 1, &tmp); */
    82   image[0].dapmifit_PS = tmp;
     82  image[0].dapmifit = tmp;
    8383
    8484  tmp = 0;
     
    118118  tmp = 0;
    119119  gfits_scan (header, AirmassKeyword, "%lf", 1, &tmp);
    120   image[0].secz_PS = MIN (NO_MAG, tmp);
     120  image[0].secz = MIN (NO_MAG, tmp);
    121121
    122122  if (!gfits_scan (header, CCDNumKeyword, "%d", 1, &ccdnum)) {
     
    130130
    131131  /* secz is in units milli-airmass */
    132   image[0].Mcal_PS = 0.0;
     132  image[0].Mcal = 0.0;
    133133  image[0].Xm   = NO_MAG;
    134134  image[0].code = 0;
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/ReadStarsFITS.c

    r10937 r12008  
    9393  PS1Data *ps1data;
    9494
    95   ps1data = gfits_table_get_PS1Data (table, &Nstars, NULL);
     95  ps1data = gfits_table_get1Data (table, &Nstars, NULL);
    9696
    9797  ALLOCATE (stars, Stars, Nstars);
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/SEDfit.c

    r8361 r12008  
    8080    Nphot = 0;
    8181    for (j = 0; j < incat[0].average[i].Nm; j++) {
    82       idx = table[0].hashcode[incat[0].measure[m+j].source];
     82      idx = table[0].hashcode[incat[0].measure[m+j].photcode];
    8383      if (idx == -1) continue;
    8484      // only fit the selected photcodes (mode == "fit")
     
    8686      if (table[0].mode[idx] == SED_SAMPLE) continue;
    8787      // XXX do something more clever if more than one value exists per photcode
    88       sourceValue.mags[idx] = incat[0].measure[m+j].M_PS + table[0].vegaToAB[idx];
    89       sourceError.mags[idx] = incat[0].measure[m+j].dM_PS;
    90       if (incat[0].measure[m+j].source == USNOred) sourceError.mags[idx] = 0.3;
    91       if (incat[0].measure[m+j].source == USNOblu) sourceError.mags[idx] = 0.3;
     88      sourceValue.mags[idx] = incat[0].measure[m+j].M + table[0].vegaToAB[idx];
     89      sourceError.mags[idx] = incat[0].measure[m+j].dM;
     90      if (incat[0].measure[m+j].photcode == USNOred) sourceError.mags[idx] = 0.3;
     91      if (incat[0].measure[m+j].photcode == USNOblu) sourceError.mags[idx] = 0.3;
    9292      found[idx] = TRUE;
    9393      Nphot ++;
     
    171171
    172172    for (j = 0; j < Nsec; j++) {
    173       outcat[0].secfilt[Nave*Nsec+j].M_PS  = NO_MAG;
    174       outcat[0].secfilt[Nave*Nsec+j].dM_PS = NO_MAG;
     173      outcat[0].secfilt[Nave*Nsec+j].M  = NO_MAG;
     174      outcat[0].secfilt[Nave*Nsec+j].dM = NO_MAG;
    175175      outcat[0].secfilt[Nave*Nsec+j].Xm    = NO_MAG;
    176176    }
     
    185185    for (j = 0; valid && (j < Nmodel); j++) {
    186186      n = modelRow[j];
    187       outcat[0].measure[Nmeas].dR_PS       = 0.0;
    188       outcat[0].measure[Nmeas].dD_PS       = 0.0;
    189       outcat[0].measure[Nmeas].M_PS        = MIN (table[0].row[minFit.row][0].mags[n] + minFit.Md,  NO_MAG);
    190       outcat[0].measure[Nmeas].dM_PS       = 0.0;
    191       outcat[0].measure[Nmeas].Mcal_PS     = 0;
     187      outcat[0].measure[Nmeas].dR       = 0.0;
     188      outcat[0].measure[Nmeas].dD       = 0.0;
     189      outcat[0].measure[Nmeas].M        = MIN (table[0].row[minFit.row][0].mags[n] + minFit.Md,  NO_MAG);
     190      outcat[0].measure[Nmeas].dM       = 0.0;
     191      outcat[0].measure[Nmeas].Mcal     = 0;
    192192      outcat[0].measure[Nmeas].t           = TIMEREF;
    193193      outcat[0].measure[Nmeas].averef      = Nave;
    194       outcat[0].measure[Nmeas].source      = table[0].code[n];
     194      outcat[0].measure[Nmeas].photcode      = table[0].code[n];
    195195      outcat[0].measure[Nmeas].dophot      = 0;
    196196      outcat[0].measure[Nmeas].flags       = 0;
    197       outcat[0].measure[Nmeas].dt_PS       = 0xffff;
    198 
    199       outcat[0].measure[Nmeas].Mgal_PS     = NO_MAG;
    200       outcat[0].measure[Nmeas].airmass_PS  = 0;
     197      outcat[0].measure[Nmeas].dt       = 0xffff;
     198
     199      outcat[0].measure[Nmeas].Mgal     = NO_MAG;
     200      outcat[0].measure[Nmeas].airmass  = 0;
    201201      outcat[0].measure[Nmeas].FWx         = NO_MAG;
    202202      outcat[0].measure[Nmeas].FWy         = NO_ERR;
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/calibrate.c

    r5585 r12008  
    6060  //  - calibrate to external system (Mref)
    6161
    62   mycode = GetPhotcodebyCode (new[0].source);
     62  mycode = GetPhotcodebyCode (new[0].photcode);
    6363  incode = GetPhotcodebyCode (mycode[0].equiv);
    6464  excode = GetPhotcodebyCode (incode[0].equiv);
     
    7474  m = average[0].offset;
    7575  for (i = 0; i < average[0].Nm; i++) {
    76     if (measure[m].source == CalC0) {
     76    if (measure[m].photcode == CalC0) {
    7777      found0 = TRUE;
    78       CalM0  = measure[m].M_PS;
    79       dCalM  = measure[m].dM_PS;
     78      CalM0  = measure[m].M;
     79      dCalM  = measure[m].dM;
    8080    }
    81     if (measure[m].source == CalC1) {
     81    if (measure[m].photcode == CalC1) {
    8282      found1 = TRUE;
    83       CalM1  = measure[m].M_PS;
     83      CalM1  = measure[m].M;
    8484    }
    85     if (measure[m].source == CalC2) {
     85    if (measure[m].photcode == CalC2) {
    8686      found2 = TRUE;
    87       CalM2  = measure[m].M_PS;
     87      CalM2  = measure[m].M;
    8888    }
    8989    if (found0 && found1 && found2) {
    90       Mcal   = new[0].M_PS + 0.001*mycode[0].C + mycode[0].K*(new[0].airmass_PS - 1.0) - ZeroPt;
     90      Mcal   = new[0].M + 0.001*mycode[0].C + mycode[0].K*(new[0].airmass - 1.0) - ZeroPt;
    9191      color  = CalM1 - CalM2 - 0.001*mycode[0].dX;
    9292      factor = color;
     
    9999      }
    100100      // if we want to apply a Mcal -> Mref color correction, we need the additional color term
    101       SaveCalibration (Mcal, new[0].dM_PS, CalM0, dCalM, new[0].M_PS - ZeroPt - new[0].dt_PS, Nstar);
     101      SaveCalibration (Mcal, new[0].dM, CalM0, dCalM, new[0].M - ZeroPt - new[0].dt, Nstar);
    102102      return;
    103103    }
     
    121121  if (MaxN == -1) {
    122122    fprintf (stderr, "no clean stars\n");
    123     image[0].Mcal_PS = 10.000;
    124     image[0].dMcal_PS = 10.000;
     123    image[0].Mcal = 10.000;
     124    image[0].dMcal = 10.000;
    125125    return;
    126126  }
     
    155155  if (Nkeep < 5) {
    156156    fprintf (stderr, "too few stars\n");
    157     image[0].Mcal_PS = 10.000;
    158     image[0].dMcal_PS = 10.000;
     157    image[0].Mcal = 10.000;
     158    image[0].dMcal = 10.000;
    159159    return;
    160160  }
     
    187187    Mw = W1 / W2;
    188188    fprintf (stderr, "N: %.0f, mean: %f, wt mean: %f, stdev: %f, precision: %f\n", N, M1, Mw, M2, M2 / sqrt (N));
    189     image[0].Mcal_PS = M1;
    190     image[0].dMcal_PS = M2 / sqrt (N);
     189    image[0].Mcal = M1;
     190    image[0].dMcal = M2 / sqrt (N);
    191191    image[0].Mxxxx = N;
    192192  } else {
    193193    fprintf (stderr, "too few stars\n");
    194     image[0].Mcal_PS = 10.000;
    195     image[0].dMcal_PS = 10.000;
     194    image[0].Mcal = 10.000;
     195    image[0].dMcal = 10.000;
    196196    image[0].Mxxxx = 0;
    197197  }
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/fakeimage.c

    r11081 r12008  
    111111    image[i+1].NY = Ny;
    112112
    113     image[i+1].source = photcode;
     113    image[i+1].photcode = photcode;
    114114
    115115    image[i+1].exptime = 0.0;
    116116 
    117     image[i+1].apmifit_PS = 0.0;
    118     image[i+1].dapmifit_PS = 0.0;
     117    image[i+1].apmifit = 0.0;
     118    image[i+1].dapmifit = 0.0;
    119119
    120120    image[i+1].detection_limit = 0.0;
     
    124124    image[i+1].tzero = MosaicTime;
    125125    image[i+1].trate = 0;
    126     image[i+1].secz_PS = 1.0;
     126    image[i+1].secz = 1.0;
    127127    image[i+1].ccdnum = 0xff;
    128128
    129     image[i+1].Mcal_PS = 0.0;
     129    image[i+1].Mcal = 0.0;
    130130    image[i+1].Xm   = NO_MAG;
    131131    image[i+1].code = 0;
     
    173173  image[0].NY = Dmax - Dmin;
    174174
    175   image[0].source = photcode;
     175  image[0].photcode = photcode;
    176176
    177177  image[0].exptime = 0.0;
    178   image[0].apmifit_PS = 0.0;
    179   image[0].dapmifit_PS = 0.0;
     178  image[0].apmifit = 0.0;
     179  image[0].dapmifit = 0.0;
    180180  image[0].detection_limit = 0.0;
    181181  image[0].saturation_limit = 0.0;
     
    184184  image[0].tzero = MosaicTime;
    185185  image[0].trate = 0;
    186   image[0].secz_PS = 1.0;
     186  image[0].secz = 1.0;
    187187  image[0].ccdnum = 0xff;
    188   image[0].Mcal_PS = 0.0;
     188  image[0].Mcal = 0.0;
    189189  image[0].Xm   = NO_MAG;
    190190  image[0].code = 0;
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/find_matches.c

    r10939 r12008  
    142142      /** add measurements for this star **/
    143143      /** dR,dD now represent arcsec **/
    144       catalog[0].measure[Nmeas].dR_PS       = 3600.0*(catalog[0].average[n].R - stars[N].R);
    145       if (catalog[0].measure[Nmeas].dR_PS > +180.0*3600.0) {
     144      catalog[0].measure[Nmeas].dR       = 3600.0*(catalog[0].average[n].R - stars[N].R);
     145      if (catalog[0].measure[Nmeas].dR > +180.0*3600.0) {
    146146          // average on high end of boundary, move star up
    147147          stars[N].R += 360.0;
    148           catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R);
    149       }
    150       if (catalog[0].measure[Nmeas].dR_PS < -180.0*3600.0) {
     148          catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R);
     149      }
     150      if (catalog[0].measure[Nmeas].dR < -180.0*3600.0) {
    151151          // average on low end of boundary, move star down
    152152          stars[N].R -= 360.0;
    153           catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R);
    154       }
    155       if (fabs(catalog[0].measure[Nmeas].dR_PS) > 10*RADIUS) {
     153          catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R);
     154      }
     155      if (fabs(catalog[0].measure[Nmeas].dR) > 10*RADIUS) {
    156156          fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n",
    157157                   catalog[0].average[n].R, catalog[0].average[n].D,
     
    160160                   Y1[i], Y2[J]);
    161161      }
    162       catalog[0].measure[Nmeas].dD_PS       = 3600.0*(catalog[0].average[n].D - stars[N].D);
    163       catalog[0].measure[Nmeas].M_PS        = stars[N].M;
    164       catalog[0].measure[Nmeas].dM_PS       = stars[N].dM;  /* error in input files stored in thousandths of mag */
    165       catalog[0].measure[Nmeas].Mcal_PS     = stars[N].Mcal;
    166       catalog[0].measure[Nmeas].t           = stars[N].t;
    167       catalog[0].measure[Nmeas].averef      = n;              /* this must be an absolute sequence number, if partial average is loaded */
    168       catalog[0].measure[Nmeas].source      = stars[N].code;  /* photcode */
    169       catalog[0].measure[Nmeas].dophot      = stars[N].dophot; 
    170       catalog[0].measure[Nmeas].flags       = 0;
    171       catalog[0].measure[Nmeas].dt_PS       = stars[N].dt;
    172       catalog[0].measure[Nmeas].airmass_PS  = stars[N].airmass;
    173 
    174       catalog[0].measure[Nmeas].Mgal_PS     = stars[N].Mgal;
    175       catalog[0].measure[Nmeas].FWx         = MIN (100*stars[N].fx, NO_MAG);
    176       catalog[0].measure[Nmeas].FWy         = MIN (100*stars[N].fy, NO_MAG);
    177       catalog[0].measure[Nmeas].theta       = MIN ((255/360)*stars[N].df, NO_ERR);
     162      catalog[0].measure[Nmeas].dD       = 3600.0*(catalog[0].average[n].D - stars[N].D);
     163
     164      /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     165      /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     166      catalog[0].measure[Nmeas].Xccd     = stars[N].X;
     167      catalog[0].measure[Nmeas].Yccd     = stars[N].Y;
     168
     169      catalog[0].measure[Nmeas].M        = stars[N].M;
     170      catalog[0].measure[Nmeas].dM       = stars[N].dM;  /* error in input files stored in thousandths of mag */
     171      catalog[0].measure[Nmeas].Mcal     = stars[N].Mcal;
     172      catalog[0].measure[Nmeas].t        = stars[N].t;
     173      catalog[0].measure[Nmeas].averef   = n;              /* this must be an absolute sequence number, if partial average is loaded */
     174      catalog[0].measure[Nmeas].photcode = stars[N].code;  /* photcode */
     175      catalog[0].measure[Nmeas].dophot   = stars[N].dophot; 
     176      catalog[0].measure[Nmeas].flags    = 0;
     177      catalog[0].measure[Nmeas].dt       = stars[N].dt;
     178      catalog[0].measure[Nmeas].airmass  = stars[N].airmass;
     179
     180      catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
     181      catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
     182      catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
     183      catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_MAG);
    178184       
    179185      /* it is not valid to pass PRI/SEC/REF photcodes to this routine */
    180186      /* check for entries in the secfilt lists */
    181187      Mcat = PhotCat (&catalog[0].measure[Nmeas]);
    182       Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M_PS;
     188      Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M;
    183189      if (*Mval == NO_MAG) *Mval = Mcat;
    184190      /* in UPDATE mode, this value is not saved; use relphot to recalculate */
     
    263269
    264270    for (j = 0; j < Nsecfilt; j++) {
    265       catalog[0].secfilt[Nave*Nsecfilt+j].M_PS  = NO_MAG;
    266       catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG;
    267       catalog[0].secfilt[Nave*Nsecfilt+j].Xm    = NO_MAG;
    268     }
    269 
    270     catalog[0].measure[Nmeas].dR_PS       = 0.0;
    271     catalog[0].measure[Nmeas].dD_PS       = 0.0;
    272     catalog[0].measure[Nmeas].M_PS        = stars[N].M;
    273     catalog[0].measure[Nmeas].dM_PS       = stars[N].dM;
    274     catalog[0].measure[Nmeas].Mcal_PS     = stars[N].Mcal;
    275     catalog[0].measure[Nmeas].t           = stars[N].t;
    276     catalog[0].measure[Nmeas].averef      = Nave;           /* XXX EAM : must be absolute Nave if partial read */
    277     catalog[0].measure[Nmeas].source      = stars[N].code;  /* photcode */
    278     catalog[0].measure[Nmeas].dophot      = stars[N].dophot; 
    279     catalog[0].measure[Nmeas].flags       = 0;
    280     catalog[0].measure[Nmeas].dt_PS       = stars[N].dt;
    281     catalog[0].measure[Nmeas].airmass_PS  = stars[N].airmass;
    282 
    283     catalog[0].measure[Nmeas].Mgal_PS     = stars[N].Mgal;
    284     catalog[0].measure[Nmeas].FWx         = MIN (100*stars[N].fx, NO_MAG);
    285     catalog[0].measure[Nmeas].FWy         = MIN (100*stars[N].fy, NO_MAG);
    286     catalog[0].measure[Nmeas].theta       = MIN ((255/360)*stars[N].df, NO_ERR);
     271      catalog[0].secfilt[Nave*Nsecfilt+j].M  = NO_MAG;
     272      catalog[0].secfilt[Nave*Nsecfilt+j].dM = NO_MAG;
     273      catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG;
     274    }
     275
     276    /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     277    /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     278    catalog[0].measure[Nmeas].Xccd     = stars[N].X;
     279    catalog[0].measure[Nmeas].Yccd     = stars[N].Y;
     280
     281    catalog[0].measure[Nmeas].dR        = 0.0;
     282    catalog[0].measure[Nmeas].dD        = 0.0;
     283    catalog[0].measure[Nmeas].M         = stars[N].M;
     284    catalog[0].measure[Nmeas].dM        = stars[N].dM;
     285    catalog[0].measure[Nmeas].Mcal      = stars[N].Mcal;
     286    catalog[0].measure[Nmeas].t         = stars[N].t;
     287    catalog[0].measure[Nmeas].averef    = Nave;           /* XXX EAM : must be absolute Nave if partial read */
     288    catalog[0].measure[Nmeas].photcode  = stars[N].code;  /* photcode */
     289    catalog[0].measure[Nmeas].dophot    = stars[N].dophot; 
     290    catalog[0].measure[Nmeas].flags     = 0;
     291    catalog[0].measure[Nmeas].dt        = stars[N].dt;
     292    catalog[0].measure[Nmeas].airmass   = stars[N].airmass;
     293
     294    catalog[0].measure[Nmeas].Mgal      = stars[N].Mgal;
     295    catalog[0].measure[Nmeas].FWx       = MIN (100*stars[N].fx, NO_MAG);
     296    catalog[0].measure[Nmeas].FWy       = MIN (100*stars[N].fy, NO_MAG);
     297    catalog[0].measure[Nmeas].theta     = MIN ((0xffff/360.0)*stars[N].df, NO_MAG);
     298    /* XXX replace df here with theta, right? */
    287299
    288300    Mcat = PhotCat (&catalog[0].measure[Nmeas]);
    289     Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M_PS;
     301    Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M;
    290302    if (*Mval == NO_MAG) *Mval = Mcat;
    291303
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/find_matches_closest.c

    r10939 r12008  
    160160    /** add measurements for this star **/
    161161    /** dR,dD now represent arcsec **/
    162     catalog[0].measure[Nmeas].dR_PS       = 3600.0*(catalog[0].average[n].R - stars[N].R);
    163     if (catalog[0].measure[Nmeas].dR_PS > +180.0*3600.0) {
     162    catalog[0].measure[Nmeas].dR       = 3600.0*(catalog[0].average[n].R - stars[N].R);
     163    if (catalog[0].measure[Nmeas].dR > +180.0*3600.0) {
    164164      // average on high end of boundary, move star up
    165165      stars[N].R += 360.0;
    166       catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R);
    167     }
    168     if (catalog[0].measure[Nmeas].dR_PS < -180.0*3600.0) {
     166      catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R);
     167    }
     168    if (catalog[0].measure[Nmeas].dR < -180.0*3600.0) {
    169169      // average on low end of boundary, move star down
    170170      stars[N].R -= 360.0;
    171       catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R);
    172     }
    173     if (fabs(catalog[0].measure[Nmeas].dR_PS) > 10*RADIUS) {
     171      catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R);
     172    }
     173    if (fabs(catalog[0].measure[Nmeas].dR) > 10*RADIUS) {
    174174      fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n",
    175175               catalog[0].average[n].R, catalog[0].average[n].D,
     
    178178               Y1[i], Y2[Jmin]);
    179179    }
    180     catalog[0].measure[Nmeas].dD_PS       = 3600.0*(catalog[0].average[n].D - stars[N].D);
    181     catalog[0].measure[Nmeas].M_PS        = stars[N].M;
    182     catalog[0].measure[Nmeas].dM_PS       = stars[N].dM;  /* error in input files stored in thousandths of mag */
    183     catalog[0].measure[Nmeas].Mcal_PS     = stars[N].Mcal;
    184     catalog[0].measure[Nmeas].t           = stars[N].t;
    185     catalog[0].measure[Nmeas].averef      = n;
    186     catalog[0].measure[Nmeas].source      = stars[N].code;  /* photcode */
    187     catalog[0].measure[Nmeas].dophot      = stars[N].dophot; 
    188     catalog[0].measure[Nmeas].flags       = 0;
    189     catalog[0].measure[Nmeas].dt_PS       = stars[N].dt;
    190     catalog[0].measure[Nmeas].airmass_PS  = stars[N].airmass;
    191 
    192     catalog[0].measure[Nmeas].Mgal_PS     = stars[N].Mgal;
    193     catalog[0].measure[Nmeas].FWx         = MIN (100*stars[N].fx, NO_MAG);
    194     catalog[0].measure[Nmeas].FWy         = MIN (100*stars[N].fy, NO_MAG);
    195     catalog[0].measure[Nmeas].theta       = MIN ((255/360)*stars[N].df, NO_ERR);
     180    catalog[0].measure[Nmeas].dD       = 3600.0*(catalog[0].average[n].D - stars[N].D);
     181
     182    /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     183    /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     184    catalog[0].measure[Nmeas].Xccd     = stars[N].X;
     185    catalog[0].measure[Nmeas].Yccd     = stars[N].Y;
     186
     187    catalog[0].measure[Nmeas].M        = stars[N].M;
     188    catalog[0].measure[Nmeas].dM       = stars[N].dM;  /* error in input files stored in thousandths of mag */
     189    catalog[0].measure[Nmeas].Mcal     = stars[N].Mcal;
     190    catalog[0].measure[Nmeas].t        = stars[N].t;
     191    catalog[0].measure[Nmeas].averef   = n;
     192    catalog[0].measure[Nmeas].photcode = stars[N].code;  /* photcode */
     193    catalog[0].measure[Nmeas].dophot   = stars[N].dophot; 
     194    catalog[0].measure[Nmeas].flags    = 0;
     195    catalog[0].measure[Nmeas].dt       = stars[N].dt;
     196    catalog[0].measure[Nmeas].airmass  = stars[N].airmass;
     197
     198    catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
     199    catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
     200    catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
     201    catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_MAG);
    196202       
    197203    /* it is not valid to pass PRI/SEC/REF photcodes to this routine */
    198204    /* check for entries in the secfilt lists */
    199205    Mcat = PhotCat (&catalog[0].measure[Nmeas]);
    200     Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M_PS;
     206    Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M;
    201207    if (*Mval == NO_MAG) *Mval = Mcat;
    202208    /* in UPDATE mode, this value is not saved; use relphot to recalculate */
     
    261267
    262268    for (j = 0; j < Nsecfilt; j++) {
    263       catalog[0].secfilt[Nave*Nsecfilt+j].M_PS  = NO_MAG;
    264       catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG;
     269      catalog[0].secfilt[Nave*Nsecfilt+j].M  = NO_MAG;
     270      catalog[0].secfilt[Nave*Nsecfilt+j].dM = NO_MAG;
    265271      catalog[0].secfilt[Nave*Nsecfilt+j].Xm    = NO_MAG;
    266272    }
    267273
    268     catalog[0].measure[Nmeas].dR_PS       = 0.0;
    269     catalog[0].measure[Nmeas].dD_PS       = 0.0;
    270     catalog[0].measure[Nmeas].M_PS        = stars[N].M;
    271     catalog[0].measure[Nmeas].dM_PS       = stars[N].dM;
    272     catalog[0].measure[Nmeas].Mcal_PS     = stars[N].Mcal;
    273     catalog[0].measure[Nmeas].t           = stars[N].t;
    274     catalog[0].measure[Nmeas].averef      = Nave;
    275     catalog[0].measure[Nmeas].source      = stars[N].code;  /* photcode */
    276     catalog[0].measure[Nmeas].dophot      = stars[N].dophot; 
    277     catalog[0].measure[Nmeas].flags       = 0;
    278     catalog[0].measure[Nmeas].dt_PS       = stars[N].dt;
    279     catalog[0].measure[Nmeas].airmass_PS  = stars[N].airmass;
    280 
    281     catalog[0].measure[Nmeas].Mgal_PS     = stars[N].Mgal;
    282     catalog[0].measure[Nmeas].FWx         = MIN (100*stars[N].fx, NO_MAG);
    283     catalog[0].measure[Nmeas].FWy         = MIN (100*stars[N].fy, NO_MAG);
    284     catalog[0].measure[Nmeas].theta       = MIN ((255/360)*stars[N].df, NO_ERR);
     274    /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     275    /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     276    catalog[0].measure[Nmeas].Xccd     = stars[N].X;
     277    catalog[0].measure[Nmeas].Yccd     = stars[N].Y;
     278
     279    catalog[0].measure[Nmeas].dR       = 0.0;
     280    catalog[0].measure[Nmeas].dD       = 0.0;
     281    catalog[0].measure[Nmeas].M        = stars[N].M;
     282    catalog[0].measure[Nmeas].dM       = stars[N].dM;
     283    catalog[0].measure[Nmeas].Mcal     = stars[N].Mcal;
     284    catalog[0].measure[Nmeas].t        = stars[N].t;
     285    catalog[0].measure[Nmeas].averef   = Nave;
     286    catalog[0].measure[Nmeas].photcode = stars[N].code;  /* photcode */
     287    catalog[0].measure[Nmeas].dophot   = stars[N].dophot; 
     288    catalog[0].measure[Nmeas].flags    = 0;
     289    catalog[0].measure[Nmeas].dt       = stars[N].dt;
     290    catalog[0].measure[Nmeas].airmass  = stars[N].airmass;
     291
     292    catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
     293    catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
     294    catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
     295    catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_ERR);
    285296
    286297    Mcat = PhotCat (&catalog[0].measure[Nmeas]);
    287     Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M_PS;
     298    Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M;
    288299    if (*Mval == NO_MAG) *Mval = Mcat;
    289300
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/find_matches_refstars.c

    r8644 r12008  
    131131      /** add measurements for this star **/
    132132      /** *** dR,dD now in arcsec *** **/
    133       catalog[0].measure[Nmeas].dR_PS       = 3600.0*(catalog[0].average[n].R - stars[N][0].R);
    134       catalog[0].measure[Nmeas].dD_PS       = 3600.0*(catalog[0].average[n].D - stars[N][0].D);
    135       catalog[0].measure[Nmeas].M_PS        = MIN (stars[N][0].M,  NO_MAG);
    136       catalog[0].measure[Nmeas].dM_PS       = MIN (stars[N][0].dM, NO_ERR);
    137       catalog[0].measure[Nmeas].Mcal_PS     = 0;
    138       catalog[0].measure[Nmeas].t           = (TIMEREF == 0) ? stars[N][0].t : TIMEREF; /** careful : time_t vs e_time **/
    139       catalog[0].measure[Nmeas].averef      = n;
    140       catalog[0].measure[Nmeas].source      = stars[N][0].code;
    141       catalog[0].measure[Nmeas].dophot      = 0;
    142       catalog[0].measure[Nmeas].flags       = 0;
    143       catalog[0].measure[Nmeas].dt_PS       = 0xffff;
    144 
    145       catalog[0].measure[Nmeas].Mgal_PS     = NO_MAG;
    146       catalog[0].measure[Nmeas].airmass_PS  = 0;
    147       catalog[0].measure[Nmeas].FWx         = NO_MAG;
    148       catalog[0].measure[Nmeas].FWy         = NO_MAG;
    149       catalog[0].measure[Nmeas].theta       = NO_ERR;
     133      catalog[0].measure[Nmeas].dR       = 3600.0*(catalog[0].average[n].R - stars[N][0].R);
     134      catalog[0].measure[Nmeas].dD       = 3600.0*(catalog[0].average[n].D - stars[N][0].D);
     135      catalog[0].measure[Nmeas].M        = MIN (stars[N][0].M,  NO_MAG);
     136      catalog[0].measure[Nmeas].dM       = MIN (stars[N][0].dM, NO_ERR);
     137      catalog[0].measure[Nmeas].Mcal     = 0;
     138      catalog[0].measure[Nmeas].t        = (TIMEREF == 0) ? stars[N][0].t : TIMEREF; /** careful : time_t vs e_time **/
     139      catalog[0].measure[Nmeas].averef   = n;
     140      catalog[0].measure[Nmeas].photcode = stars[N][0].code;
     141      catalog[0].measure[Nmeas].dophot   = 0;
     142      catalog[0].measure[Nmeas].flags    = 0;
     143      catalog[0].measure[Nmeas].dt       = 0xffff;
     144
     145      catalog[0].measure[Nmeas].Mgal     = NO_MAG;
     146      catalog[0].measure[Nmeas].airmass  = 0;
     147      catalog[0].measure[Nmeas].FWx      = NO_MAG;
     148      catalog[0].measure[Nmeas].FWy      = NO_MAG;
     149      catalog[0].measure[Nmeas].theta    = NO_MAG;
    150150       
     151      /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     152      /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     153      catalog[0].measure[Nmeas].Xccd     = 0.0;
     154      catalog[0].measure[Nmeas].Yccd     = 0.0;
     155
    151156      if (ACCEPT_MOTION) {
    152         catalog[0].average[n].uR          = stars[N][0].uR;
    153         catalog[0].average[n].uD          = stars[N][0].uD;
    154         catalog[0].average[n].duR         = stars[N][0].duR;
    155         catalog[0].average[n].duD         = stars[N][0].duD;
    156         catalog[0].average[n].P           = stars[N][0].P;
    157         catalog[0].average[n].dP          = stars[N][0].dP;
     157        catalog[0].average[n].uR         = stars[N][0].uR;
     158        catalog[0].average[n].uD         = stars[N][0].uD;
     159        catalog[0].average[n].duR        = stars[N][0].duR;
     160        catalog[0].average[n].duD        = stars[N][0].duD;
     161        catalog[0].average[n].P          = stars[N][0].P;
     162        catalog[0].average[n].dP         = stars[N][0].dP;
    158163      }
    159164
     
    240245
    241246    for (j = 0; j < Nsecfilt; j++) {
    242       catalog[0].secfilt[Nave*Nsecfilt+j].M_PS  = NO_MAG;
    243       catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG;
    244       catalog[0].secfilt[Nave*Nsecfilt+j].Xm    = NO_MAG;
    245     }
    246 
    247     catalog[0].measure[Nmeas].dR_PS       = 0.0;
    248     catalog[0].measure[Nmeas].dD_PS       = 0.0;
    249     catalog[0].measure[Nmeas].M_PS        = MIN (stars[N][0].M,  NO_MAG);
    250     catalog[0].measure[Nmeas].dM_PS       = MIN (stars[N][0].dM, NO_ERR);
    251     catalog[0].measure[Nmeas].Mcal_PS     = 0;
    252     catalog[0].measure[Nmeas].t           = (stars[N][0].t == 0) ? TIMEREF : stars[N][0].t; /** careful : time_t vs e_time **/
    253     catalog[0].measure[Nmeas].averef      = Nave;
    254     catalog[0].measure[Nmeas].source      = stars[N][0].code;
    255     catalog[0].measure[Nmeas].dophot      = 0;
    256     catalog[0].measure[Nmeas].flags       = 0;
    257     catalog[0].measure[Nmeas].dt_PS       = 0xffff;
    258 
    259     catalog[0].measure[Nmeas].Mgal_PS     = NO_MAG;
    260     catalog[0].measure[Nmeas].airmass_PS  = 0;
    261     catalog[0].measure[Nmeas].FWx         = NO_MAG;
    262     catalog[0].measure[Nmeas].FWy         = NO_ERR;
    263     catalog[0].measure[Nmeas].theta       = NO_ERR;
     247      catalog[0].secfilt[Nave*Nsecfilt+j].M  = NO_MAG;
     248      catalog[0].secfilt[Nave*Nsecfilt+j].dM = NO_MAG;
     249      catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG;
     250    }
     251
     252    catalog[0].measure[Nmeas].dR       = 0.0;
     253    catalog[0].measure[Nmeas].dD       = 0.0;
     254    catalog[0].measure[Nmeas].M        = MIN (stars[N][0].M,  NO_MAG);
     255    catalog[0].measure[Nmeas].dM       = MIN (stars[N][0].dM, NO_ERR);
     256    catalog[0].measure[Nmeas].Mcal     = 0;
     257    catalog[0].measure[Nmeas].t        = (stars[N][0].t == 0) ? TIMEREF : stars[N][0].t; /** careful : time_t vs e_time **/
     258    catalog[0].measure[Nmeas].averef   = Nave;
     259    catalog[0].measure[Nmeas].photcode = stars[N][0].code;
     260    catalog[0].measure[Nmeas].dophot   = 0;
     261    catalog[0].measure[Nmeas].flags    = 0;
     262    catalog[0].measure[Nmeas].dt       = 0xffff;
     263
     264    catalog[0].measure[Nmeas].airmass  = 0;
     265    catalog[0].measure[Nmeas].Mgal     = NO_MAG;
     266    catalog[0].measure[Nmeas].FWx      = NO_MAG;
     267    catalog[0].measure[Nmeas].FWy      = NO_MAG;
     268    catalog[0].measure[Nmeas].theta    = NO_MAG;
     269
     270    /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     271    /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     272    catalog[0].measure[Nmeas].Xccd     = 0.0;
     273    catalog[0].measure[Nmeas].Yccd     = 0.0;
    264274
    265275    stars[N][0].found = Nmeas;
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/find_proper.c

    r3339 r12008  
    111111        catalog[0].measure[Nmeas].t   = 0;    /* a flag: if 0, image is not in database */
    112112        catalog[0].measure[Nmeas].averef  = n;
    113         catalog[0].measure[Nmeas].source = USNO_RED;
     113        catalog[0].measure[Nmeas].photcode = USNO_RED;
    114114        catalog[0].measure[Nmeas+1].dR  = catalog[0].measure[Nmeas].dR;
    115115        catalog[0].measure[Nmeas+1].dD  = catalog[0].measure[Nmeas].dD;
     
    119119        catalog[0].measure[Nmeas+1].t   = 0;    /* a flag: if 0, image is not in database */
    120120        catalog[0].measure[Nmeas+1].averef  = n;
    121         catalog[0].measure[Nmeas+1].source = USNO_BLUE;
     121        catalog[0].measure[Nmeas+1].photcode = USNO_BLUE;
    122122        /* add flag in average to mark as matched with the USNO catalog */
    123123        catalog[0].average[n].code |= (ID_PROPER | ID_USNO);
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/load2mass_catalog.c

    r7780 r12008  
    4444
    4545    for (j = 0; j < Nsec; j++) {
    46       catalog[0].secfilt[Nave*Nsec+j].M_PS  = NO_MAG;
    47       catalog[0].secfilt[Nave*Nsec+j].dM_PS = NO_MAG;
     46      catalog[0].secfilt[Nave*Nsec+j].M  = NO_MAG;
     47      catalog[0].secfilt[Nave*Nsec+j].dM = NO_MAG;
    4848      catalog[0].secfilt[Nave*Nsec+j].Xm    = NO_MAG;
    4949    }
     
    5151    // we now have the min chisq row. use this to supply the other filter values....
    5252    for (j = 0; j < 3; j++) {
    53       catalog[0].measure[Nmeas].dR_PS       = 0.0;
    54       catalog[0].measure[Nmeas].dD_PS       = 0.0;
    55       catalog[0].measure[Nmeas].M_PS        = MIN (stars[i+j].M,  NO_MAG);
    56       catalog[0].measure[Nmeas].dM_PS       = MIN (stars[i+j].dM,  NO_ERR);
    57       catalog[0].measure[Nmeas].Mcal_PS     = 0;
     53      catalog[0].measure[Nmeas].dR       = 0.0;
     54      catalog[0].measure[Nmeas].dD       = 0.0;
     55      catalog[0].measure[Nmeas].M        = MIN (stars[i+j].M,  NO_MAG);
     56      catalog[0].measure[Nmeas].dM       = MIN (stars[i+j].dM,  NO_ERR);
     57      catalog[0].measure[Nmeas].Mcal     = 0;
    5858      catalog[0].measure[Nmeas].t           = stars[i+j].t;
    5959      catalog[0].measure[Nmeas].averef      = Nave;
    60       catalog[0].measure[Nmeas].source      = stars[i+j].code;
     60      catalog[0].measure[Nmeas].photcode      = stars[i+j].code;
    6161      catalog[0].measure[Nmeas].dophot      = 0;
    6262      catalog[0].measure[Nmeas].flags       = 0;
    63       catalog[0].measure[Nmeas].dt_PS       = 0xffff;
     63      catalog[0].measure[Nmeas].dt       = 0xffff;
    6464
    65       catalog[0].measure[Nmeas].Mgal_PS     = NO_MAG;
    66       catalog[0].measure[Nmeas].airmass_PS  = 0;
     65      catalog[0].measure[Nmeas].Mgal     = NO_MAG;
     66      catalog[0].measure[Nmeas].airmass  = 0;
    6767      catalog[0].measure[Nmeas].FWx         = NO_MAG;
    6868      catalog[0].measure[Nmeas].FWy         = NO_ERR;
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/replace_match.c

    r6683 r12008  
    77  /* search for entry and replace values M, dM, R, D */
    88  for (i = 0; i < average[0].Nm; i++) {
    9     if (measure[i].source != star[0].code) continue;
    10     measure[i].dR_PS       = 3600.0*(average[0].R - star[0].R);
    11     measure[i].dD_PS       = 3600.0*(average[0].D - star[0].D);
    12     measure[i].M_PS        = MIN (star[0].M,  NO_MAG);
    13     measure[i].dM_PS       = MIN (star[0].dM, NO_ERR);
     9    if (measure[i].photcode != star[0].code) continue;
     10    measure[i].dR       = 3600.0*(average[0].R - star[0].R);
     11    measure[i].dD       = 3600.0*(average[0].D - star[0].D);
     12    measure[i].M        = MIN (star[0].M,  NO_MAG);
     13    measure[i].dM       = MIN (star[0].dM, NO_ERR);
    1414    star[0].found          = average[0].offset + i;
    1515    return (TRUE);
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/update_coords.c

    r6683 r12008  
    1919      continue;
    2020    }
    21     R = measure[m].dR_PS;
    22     D = measure[m].dD_PS;
     21    R = measure[m].dR;
     22    D = measure[m].dD;
    2323    r += R;
    2424    d += D;
     
    3737  m = average[0].offset;  /* first measurement of this star */
    3838  for (i = 0; i < average[0].Nm; i++) {
    39     measure[m].dR_PS -= r;
    40     measure[m].dD_PS -= d;
     39    measure[m].dR -= r;
     40    measure[m].dD -= d;
    4141    m = next[m];
    4242  }
  • branches/dvo-mods-2007-02/Ohana/src/delstar/src/delete_imagefile.c

    r8555 r12008  
    4545    start = image[0].tzero;
    4646    stop  = image[0].tzero + trange;
    47     find_matches (&catalog, image[0].source, start, stop);
     47    find_matches (&catalog, image[0].photcode, start, stop);
    4848
    4949    dvo_catalog_save (&catalog, VERBOSE);
  • branches/dvo-mods-2007-02/Ohana/src/delstar/src/delete_imagename.c

    r8555 r12008  
    5454      start = image[j].tzero;
    5555      stop  = image[j].tzero + trange;
    56       find_matches (&catalog, image[j].source, start, stop);
     56      find_matches (&catalog, image[j].photcode, start, stop);
    5757
    5858      dvo_catalog_save (&catalog, VERBOSE);
  • branches/dvo-mods-2007-02/Ohana/src/delstar/src/find_image_db.c

    r7080 r12008  
    4646  start = timage[0].tzero - MAX(0.05*timage[0].trate*timage[0].NY, 1);
    4747  stop  = timage[0].tzero + MAX(1.05*timage[0].trate*timage[0].NY, 1);
    48   code  = timage[0].source;
     48  code  = timage[0].photcode;
    4949
    5050  Nlist = 0;
     
    5555    if (image[i].tzero < start) continue;
    5656    if (image[i].tzero > stop) continue;
    57     if (image[i].source != code) continue;
     57    if (image[i].photcode != code) continue;
    5858    list[Nlist] = i;
    5959    Nlist ++;
     
    8282    if (image[i].tzero > END) continue;
    8383    if (code != NULL) {
    84       if (image[i].source != code[0].code) continue;
     84      if (image[i].photcode != code[0].code) continue;
    8585    }
    8686    list[Nlist] = i;
  • branches/dvo-mods-2007-02/Ohana/src/delstar/src/find_matches.c

    r4680 r12008  
    5555    drop &= (catalog[0].measure[i].t >= start);
    5656    drop &= (catalog[0].measure[i].t <= end);
    57     drop &= ((photcode == -1) || (photcode == catalog[0].measure[i].source));
     57    drop &= ((photcode == -1) || (photcode == catalog[0].measure[i].photcode));
    5858    if (!drop) {
    5959      prev = i;
  • branches/dvo-mods-2007-02/Ohana/src/delstar/src/gimages.c

    r7080 r12008  
    5656    Shutdown ("ERROR: photcode %s not found in photcode table", photcode);
    5757  }
    58   image[0].source = Nc;
     58  image[0].photcode = Nc;
    5959
    6060  tmp = 0;
     
    7676  tmp = 0;
    7777  gfits_scan (&header, "AIRMASS", "%lf", 1, &tmp);
    78   image[0].secz_PS = tmp;
     78  image[0].secz = tmp;
    7979
    8080  /* secz is in units milli-airmass */
    81   image[0].Mcal_PS =  ALPHA*(image[0].secz_PS - 1.000);
     81  image[0].Mcal =  ALPHA*(image[0].secz - 1.000);
    8282  image[0].Xm   = NO_MAG;
    8383
  • branches/dvo-mods-2007-02/Ohana/src/elixir/src/DefineProcesses.c

    r10336 r12008  
    2727  GetConfig (config, "global.pending", "%s",  0, global[0].argv[2]);
    2828  GetConfig (config, "global.logfile", "%s",  0, global[0].argv[3]);
    29   GetConfig (config, "global.source",  "%s",  0, global[0].argv[4]);
     29  GetConfig (config, "global.photcode",  "%s",  0, global[0].argv[4]);
    3030  GetConfig (config, "global.msg",     "%s",  0, global[0].argv[5]);
    3131  GetConfig (config, "global.end",     "%s",  0, global[0].argv[6]);
  • branches/dvo-mods-2007-02/Ohana/src/gastro/src/getptolemy.c

    r8514 r12008  
    5050      stars[k].X = catalog.average[j].R;
    5151      stars[k].Y = catalog.average[j].D;
    52       stars[k].mag = catalog.measure[catalog.average[j].offset].M_PS;
     52      stars[k].mag = catalog.measure[catalog.average[j].offset].M;
    5353    }     
    5454    dvo_catalog_free (&catalog);
  • branches/dvo-mods-2007-02/Ohana/src/gastro2/src/getptolemy.c

    r8513 r12008  
    6161      Ref[0].stars[k].R = catalog.average[j].R;
    6262      Ref[0].stars[k].D = catalog.average[j].D;
    63       Ref[0].stars[k].M = catalog.measure[catalog.average[j].offset].M_PS;
     63      Ref[0].stars[k].M = catalog.measure[catalog.average[j].offset].M;
    6464    }     
    6565    dvo_catalog_free (&catalog);
  • branches/dvo-mods-2007-02/Ohana/src/getstar/src/select_by_image.c

    r6812 r12008  
    2121    start = image[0].tzero;
    2222    end   = image[0].tzero + 1e-4*image[0].NY*image[0].trate;  /* trate is in 0.1 msec / row */
    23     photcode = image[0].source;
     23    photcode = image[0].photcode;
    2424  }
    2525  if (VERBOSE) fprintf (stderr, "extracting for range %d to %d (photcode %s)\n", start, end, photcode);
     
    2727  for (i = 0; (i < catalog[0].Nmeasure); i++) {
    2828    if ((i % 10000) == 0) fprintf (stderr, ". ");
    29     if ((catalog[0].measure[i].t >= start) && (catalog[0].measure[i].t <= end) && (photcode == catalog[0].measure[i].source)) {
     29    if ((catalog[0].measure[i].t >= start) && (catalog[0].measure[i].t <= end) && (photcode == catalog[0].measure[i].photcode)) {
    3030      n = catalog[0].measure[i].averef;
    3131      stars[N].R      = catalog[0].average[n].R - catalog[0].measure[i].dR / 360000.0;
  • branches/dvo-mods-2007-02/Ohana/src/imclean/src/ConfigInit.c

    r11903 r12008  
    2020  ScanConfig (config, "DOPHOT_CHAR_LINE",  "%d", 0, &CHAR_LINE);
    2121  ScanConfig (config, "DOPHOT_TYPE_FIELD", "%d", 0, &TYPE_FIELD);
    22   ScanConfig (config, "DOPHOT_PSF_FIELD",  "%d", 0, &PSF_FIELD);
     22  ScanConfig (config, "DOPHOTF_FIELD",  "%d", 0, &PSF_FIELD);
    2323  ScanConfig (config, "DOPHOT_AP_FIELD",   "%d", 0, &AP_FIELD);
    2424  ScanConfig (config, "PHOTCODE_FILE",     "%s", 0, PhotCodeFile);
  • branches/dvo-mods-2007-02/Ohana/src/imregister/base/ConfigInit.c

    r6684 r12008  
    7373                                                   
    7474  WarnConfig (config, "imstats",                     "%s", 0, ElixirBase);
    75   sprintf (ImstatFifo, "%s.source", ElixirBase);   
     75  sprintf (ImstatFifo, "%s.photcode", ElixirBase);   
    7676  WarnConfig (config, "ptolemy",                     "%s", 0, ElixirBase);
    77   sprintf (PtolemyFifo, "%s.source", ElixirBase);
     77  sprintf (PtolemyFifo, "%s.photcode", ElixirBase);
    7878
    7979  if (!ScanConfig (config, "CONNECT", "%s",  0, CONNECT)) {
  • branches/dvo-mods-2007-02/Ohana/src/imregister/imphot/ConfigInit.c

    r6684 r12008  
    6969                                                   
    7070  WarnConfig (config, "imstats",                     "%s", 0, ElixirBase);
    71   sprintf (ImstatFifo, "%s.source", ElixirBase);   
     71  sprintf (ImstatFifo, "%s.photcode", ElixirBase);   
    7272  WarnConfig (config, "ptolemy",                     "%s", 0, ElixirBase);
    73   sprintf (PtolemyFifo, "%s.source", ElixirBase);
     73  sprintf (PtolemyFifo, "%s.photcode", ElixirBase);
    7474
    7575  if (!ScanConfig (config, "CONNECT", "%s",  0, CONNECT)) {
  • branches/dvo-mods-2007-02/Ohana/src/imregister/imphot/dumpfits.c

    r7080 r12008  
    113113    subset   = &image[match[i]];
    114114    startstr = sec_to_date (subset[0].tzero);
    115     filtstr  = GetPhotcodeNamebyCode (subset[0].source);
    116     zp       = subset[0].Mcal_PS;
    117     dzp      = subset[0].dMcal_PS;
     115    filtstr  = GetPhotcodeNamebyCode (subset[0].photcode);
     116    zp       = subset[0].Mcal;
     117    dzp      = subset[0].dMcal;
    118118    XY_to_RD (&ra, &dec, 0.0, 0.0, &subset[0].coords);
    119     airmass  = subset[0].secz_PS;
     119    airmass  = subset[0].secz;
    120120    sky      = subset[0].Myyyy + 0x8000;
    121121
  • branches/dvo-mods-2007-02/Ohana/src/imregister/imphot/output.c

    r5014 r12008  
    3535     
    3636    /* convert photcode to filter name */
    37     photstr = GetPhotcodeNamebyCode (image[i].source);
     37    photstr = GetPhotcodeNamebyCode (image[i].photcode);
    3838    if (photstr == (char *) NULL) photstr = PhotError;
    3939     
    4040    fprintf (stdout, "%s %s %s  %7.4f %7.4f  %7.4f %5d %02x\n", image[i].name, photstr, timestr,
    41              image[i].Mcal_PS, image[i].dMcal_PS, image[i].secz_PS, image[i].nstar, image[i].code);
     41             image[i].Mcal, image[i].dMcal, image[i].secz, image[i].nstar, image[i].code);
    4242    free (timestr);
    4343  }
  • branches/dvo-mods-2007-02/Ohana/src/imregister/imphot/subset.c

    r5386 r12008  
    2323    }
    2424    if (!status && criteria.Ntimes) continue;
    25     if (criteria.PhotcodeSelect && (image[i].source != criteria.photcode)) continue;
     25    if (criteria.PhotcodeSelect && (image[i].photcode != criteria.photcode)) continue;
    2626    if (criteria.CodeSelect     && (image[i].code != criteria.Code)) continue;
    2727    if (criteria.NameSelect     && strncasecmp (image[i].name, criteria.Name, NameSelectLength)) continue;
  • branches/dvo-mods-2007-02/Ohana/src/imregister/src/imphotmerge.c

    r7080 r12008  
    44
    55Image *LoadImageTable (FILE *f, Header *header, int *nimage);
    6 static char *version = "imphotcopy $Revision: 1.5 $";
     6static char *version = "imphotcopy $Revision: 1.5.4.1 $";
    77
    88int main (int argc, char **argv) {
     
    105105    }
    106106    if (!status && Ntimes) continue;
    107     if (PhotCodeSelect && (input[i].source != PHOTCODE)) continue;
     107    if (PhotCodeSelect && (input[i].photcode != PHOTCODE)) continue;
    108108    if ((NameSelect != (char *) NULL) && (strncasecmp (input[i].name, NameSelect, NameSelectLength))) continue;
    109109
  • branches/dvo-mods-2007-02/Ohana/src/libautocode/def/average.d

    r11742 r12008  
    22EXTNAME      DVO_AVERAGE
    33TYPE         BINTABLE
    4 SIZE         76
     4SIZE         84
    55DESCRIPTION  DVO Average Object Table
    66
     
    3030FIELD missing,        missing,    int,              offset to first missing obs
    3131
     32# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
     33FIELD objID_hi,       OBJ_ID_HI,    unsigned int,   ID upper bytes
     34FIELD objID_lo,       OBJ_ID_LO,    unsigned int,   ID lower bytes
     35
    3236# this structure should only be used for internal representations
    3337# the average-FORMAT structures should be used for external representations
    3438# note that the average magnitudes are stored in the 'secfilt' table (change this name??)
    3539# the index for the secfilt table is just Nsecfilt times the index for the average table.
     40
     41# XXX after the rest of the DVO re-org work, remove the magnitude based values from this table
     42# and move them to the secfilt table.
     43
     44# the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs
  • branches/dvo-mods-2007-02/Ohana/src/libautocode/def/image.d

    r6454 r12008  
    2525FIELD     tzero,            TZERO,                e_time,         readout time (row 0)
    2626FIELD     nstar,            NSTAR,                unsigned int,   number of stars on image
    27 FIELD     secz_PS,          SECZ,                 float,          airmass,                   mag
     27FIELD     secz,             SECZ,                 float,          airmass,                   mag
    2828FIELD     NX,               NX,                   short,          image width
    2929FIELD     NY,               NY,                   short,          image height
    30 FIELD     apmifit_PS,       APMIFIT,              float,          aperture correction,       mag
    31 FIELD     dapmifit_PS,      DAPMIFIT,             float,          apmifit error,             mag
    32 FIELD     Mcal_PS,          MCAL,                 float,          calibration mag,           mag
    33 FIELD     dMcal_PS,         DMCAL,                float,          error on Mcal,             mag
     30FIELD     apmifit,          APMIFIT,              float,          aperture correction,       mag
     31FIELD     dapmifit,         DAPMIFIT,             float,          apmifit error,             mag
     32FIELD     Mcal,             MCAL,                 float,          calibration mag,           mag
     33FIELD     dMcal,            DMCAL,                float,          error on Mcal,             mag
    3434FIELD     Xm,               XM,                   short,          image chisq,               10*log(value)
    35 FIELD     source,           SOURCE,               short,          identifier for CCD,
     35FIELD     photcode,         PHOTCODE,             short,          identifier for CCD,
    3636FIELD     exptime,          EXPTIME,              float,          exposure time,             seconds
    3737FIELD     sidtime,          ST,                   float,          sidereal time of exposure
     
    4848FIELD     code,             CODE,                 char,           image quality flag
    4949FIELD     ccdnum,           CCDNUM,               unsigned char,  CCD ID number
    50 # 40 bytes
     50FIELD     imageID_hi,       IMAGE_ID_HI,          unsigned int,   ID upper bytes
     51FIELD     imageID_lo,       IMAGE_ID_LO,          unsigned int,   ID lower bytes
     52# 48 bytes
    5153
    52 FIELD     dummy,            DUMMY,                char[18],       unused
     54FIELD     dummy,            DUMMY,                char[10],       unused
    5355FIELD     order,            ORDER,                short,          Mrel 2D polynomical order
    5456FIELD     Mx,               MX,                   short,          Mrel polyterm
     
    6668FIELD     Mxyyy,            MXYYY,                short,          Mrel polyterm
    6769FIELD     Myyyy,            MYYYY,                short,          Mrel polyterm
    68 # 48 bytes
     70# 40 bytes
  • branches/dvo-mods-2007-02/Ohana/src/libautocode/def/measure.d

    r6454 r12008  
    22EXTNAME      DVO_MEASURE
    33TYPE         BINTABLE
    4 SIZE         50
     4SIZE         96
    55DESCRIPTION  DVO Detection Measurement Table
    66
    7 FIELD dR_PS,          D_RA,       float,          RA offset,                      arcsec
    8 FIELD dD_PS,          D_DEC,      float,          DEC offset,                     arcsec
    9 FIELD M_PS,           MAG,        float,          catalog mag,                    mag
    10 FIELD Mcal_PS,        Mcal,       float,          image cal mag,                  mag
    11 FIELD Mgal_PS,        Mgal,       float,          galaxy mag,                     mag
    12 FIELD dM_PS,          dM,         float,          mag error,                      mag
    13 FIELD airmass_PS,     airmass,    float,          (airmass - 1),                  airmass
    14 FIELD dt_PS,          dt,         float,          exposure time,                  2.5*log(exptime)
    15 FIELD FWx,            FWx,        short,          object fwhm major axis,         1/100 of arcsec
    16 FIELD FWy,            FWy,        short,          object fwhm minor axis,         1/100 of arcsec
    17 FIELD theta,          theta,      unsigned char,  angle wrt ccd X dir,            (0xff/360) deg
    18 FIELD dophot,         dophot,     char,           dophot type
    19 FIELD source,         source,     unsigned short, photcode
    20 FIELD flags,          flags,      unsigned short, flags for various uses 
    21 FIELD t,              t,          unsigned int,   time in seconds (UNIX)
    22 FIELD averef,         averef,     unsigned int,   reference to average entry     
     7FIELD dR,             D_RA,         float,          RA offset,                    arcsec
     8FIELD dD,             D_DEC,        float,          DEC offset,                   arcsec
     9FIELD M,              MAG,          float,          catalog mag,                  mag
     10FIELD Mcal,           Mcal,         float,          image cal mag,                mag
     11FIELD Mgal,           Mgal,         float,          galaxy mag,                   mag
     12FIELD dM,             dM,           float,          mag error,                    mag
     13FIELD airmass,        airmass,      float,          (airmass - 1),                airmass
     14FIELD dt,             dt,           float,          exposure time,                2.5*log(exptime)
     15
     16FIELD t,              t,            unsigned int,   time in seconds (UNIX)
     17FIELD averef,         averef,       unsigned int,   reference to average entry     
     18
     19FIELD FWx,            FWx,          short,          object fwhm major axis,       1/100 of arcsec
     20FIELD FWy,            FWy,          short,          object fwhm minor axis,       1/100 of arcsec
     21FIELD theta,          theta,        short,          angle wrt ccd X dir,          (0xffff/360) deg
     22FIELD photcode,       photcode,     unsigned short, photcode
     23
     24FIELD flags,          flags,        unsigned short, flags for various uses 
     25FIELD dophot,         dophot,       char,           dophot type
     26FIELD stargal,        stargal,      char,           star-galaxy separator
     27
     28# new field elements needed for Pan-STARRS:
     29FIELD Xccd,           X_CCD,        float,          X coord on chip,               pixels
     30FIELD Yccd,           Y_CCD,        float,          Y coord on chip,               pixels
     31
     32# could these be packed into fewer bits?
     33FIELD Sky,            SKY_FLUX,     float,          local estimate of sky flux,    counts/sec
     34FIELD dSky,           SKY_FLUX_ERR, float,          local estimate of sky flux,    counts/sec
     35
     36FIELD dXccd,          X_CCD_ERR,    short,          X coord error on chip,         pixels
     37FIELD dYccd,          Y_CCD_ERR,    short,          Y coord error on chip,         pixels
     38
     39# do we need more resolution than a short? should this be a log?
     40FIELD qPSF,           PSF_QF,       short,          psf coverage/quality factor
     41
     42# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
     43FIELD detID_hi,       DET_ID_HI,    unsigned int,   ID upper bytes
     44FIELD detID_lo,       DET_ID_LO,    unsigned int,   ID lower bytes
     45
     46FIELD imageID_hi,     IMAGE_ID_HI,  unsigned int,   reference to image
     47FIELD imageID_lo,     IMAGE_ID_LO,  unsigned int,   reference to image
     48
     49# we may need 2 extra bytes for padding purposes...
     50FIELD dummy,          dummy,        char[6],        padding
  • branches/dvo-mods-2007-02/Ohana/src/libautocode/def/secfilt.d

    r6454 r12008  
    22EXTNAME      DVO_SECFILT
    33TYPE         BINTABLE
    4 SIZE         12
     4SIZE         16
    55DESCRIPTION  DVO SecFilt : Secondary Filter Data
    66
    77# elements of data structure / FITS table
    8 FIELD  M_PS,  MAG,      float,                other mags,       mags
    9 FIELD  dM_PS, MAG_ERR,  float,                scatter on mag,   mags
     8FIELD  M,     MAG,      float,                other mags,       mags
     9FIELD  dM,    MAG_ERR,  float,                scatter on mag,   mags
    1010FIELD  Xm,    MAG_CHI,  short,                chisq on mag,     [100*log(value)]
     11FIELD  Ncode, NCODE,    short,                number of detections in band
     12FIELD  Nused, NUSED,    short,                number of detections used in average
    1113FIELD  dummy, JUNK,     short,                place holder
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/Makefile

    r11880 r12008  
    4141$(SRC)/dvo_catalog_split.$(ARCH).o     \
    4242$(SRC)/dvo_catalog_create.$(ARCH).o    \
     43$(SRC)/dvo_catalog_chipcoords.$(ARCH).o \
    4344$(SRC)/dvo_convert.$(ARCH).o           \
    4445$(SRC)/dvo_convert_elixir.$(ARCH).o    \
    4546$(SRC)/dvo_convert_loneos.$(ARCH).o    \
    46 $(SRC)/dvo_convert_panstarrs.$(ARCH).o \
    47 $(SRC)/dvo_convert_pmtest.$(ARCH).o \
    4847$(SRC)/skyregion_io.$(ARCH).o    \
    4948$(SRC)/skyregion_gsc.$(ARCH).o    \
    5049$(SRC)/skyregion_ops.$(ARCH).o
     50
     51# $(SRC)/dvo_convert_panstarrs.$(ARCH).o \
     52# $(SRC)/dvo_convert_pmtest.$(ARCH).o \
    5153
    5254include ../libautocode/Makefile.Targets
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/doc/dvo-structures.txt

    r11742 r12008  
     1
     22007.02.22
     3
     4I have several DVO improvements to implement.  I need to plan them a
     5bit carefully.  Here are my thoughts on these updates.
     6
     7- add chip X,Y to measure table
     8
     9  this is a fairly simple addition.  In addstar/find_matches, I just need
     10  to assign the X,Y value from the incoming star data.  For loading
     11  old catalogs which don't include X,Y in the table, I need to
     12  calculate the X,Y position based on the R,D after finding the
     13  matching image.  I have code to do this calculation currently in
     14  dvo/photometry.c for looking up X,Y on the fly.  once this is moved
     15  into the load functions, it will not be needed in photometry.c
     16
     17- remove PRI/SEC and only use secfilt table for mags
     18
     19  this is not a very difficult change, conceptually, but it may be a
     20  fair amount of work.  all of the functions which currently switch on
     21  the case of PRI/SEC just need to look in the secfilt location.  the
     22  value of Nsec needs to increase by 1.  the load from tables which
     23  used PRI/SEC need to move the PRI values to the correct location in
     24  secfilt
     25
     26  eventually, rename 'secfilt' to a better name choice
     27
     28- add image, average, measure IDs
     29
     30  for PS1, the image and measure need to be generated by the external
     31  software.  they would just be part of the input stream.  for the
     32  case were the IDs are not supplied, DVO needs to generate them in a
     33  unique way.  I probably need to understand / define that mechanism
     34  before tackling this problem.
     35
     36  one point: I need to keep the old averef index.  how do this index
     37  and the objID work together?
     38
     39- link measure to image
     40
     41  temporariliy use an index like averef?
     42
     43- move photcode table to catdir (also zero points)
     44
     45  should be fairly easy: just like the SkyTable, look in the catdir
     46  first, then generate from the default text table if it is missing.
     47
     48- color term as a function of mosaic position
     49 
     50- mextract field,field,field
     51
     52  this should not be a very difficult job.  just add a loop to the
     53  avextract / mextract functions.
     54
     55- mextract field(s) where condition
     56
     57  this is a bit trickier, and could make use of the code in the dvo
     58  math functions
     59
     60- dvo select from mysql
     61
     62  not very difficult: need to define the commands to select the
     63  database and set up a connection, then parse the select line into
     64  the appropriate format.  just need to as the db for the type of the
     65  fields that are requested: must be numerical.
     66
     67  select field,field,field from table where condition
     68
     69- change vectors to doubles
     70
     71  probably not a terrible job.  this will depend on how the union is
     72  defined.  I don't want this to explode the size of an image!
     73
     74---------
    175
    276I now have the ability to load and save DVO databases in old formats,
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/LoadPhotcodes.c

    r9631 r12008  
    22
    33# define NCTERMS 4
    4 # define F_PS 0.001
    5 # define NO_MAG_PS 100.0
     4# define F 0.001
     5# define NO_MAG 100.0
    66
    77static PhotCodeData *photcodes = NULL;
     
    489489  float M;
    490490
    491   Np = photcodes[0].hashcode[measure[0].source];
    492   if (Np == -1) return (NO_MAG_PS);
     491  Np = photcodes[0].hashcode[measure[0].photcode];
     492  if (Np == -1) return (NO_MAG);
    493493
    494494  if (photcodes[0].code[Np].type == PHOT_REF) {
    495     M = measure[0].M_PS;
     495    M = measure[0].M;
    496496    return (M);
    497497  }
    498498
    499   M = measure[0].M_PS - measure[0].dt_PS - ZERO_POINT;
     499  M = measure[0].M - measure[0].dt - ZERO_POINT;
    500500         
    501501  return (M);
     
    509509  PhotCode *code;
    510510
    511   Np = photcodes[0].hashcode[measure[0].source];
    512   if (Np == -1) return (NO_MAG_PS);
     511  Np = photcodes[0].hashcode[measure[0].photcode];
     512  if (Np == -1) return (NO_MAG);
    513513
    514514  if (photcodes[0].code[Np].type == PHOT_REF) {
    515     Mcat = measure[0].M_PS;
     515    Mcat = measure[0].M;
    516516    return (Mcat);
    517517  }
    518518  code = &photcodes[0].code[Np];
    519   Mcat = measure[0].M_PS - ZERO_POINT + code[0].K*(measure[0].airmass_PS - 1.000) + F_PS*code[0].C;
     519  Mcat = measure[0].M - ZERO_POINT + code[0].K*(measure[0].airmass - 1.000) + F*code[0].C;
    520520 
    521521  return (Mcat);
     
    528528  PhotCode *code;
    529529
    530   Np = photcodes[0].hashcode[measure[0].source];
    531   if (Np == -1) return (NO_MAG_PS);
     530  Np = photcodes[0].hashcode[measure[0].photcode];
     531  if (Np == -1) return (NO_MAG);
    532532
    533533  if (photcodes[0].code[Np].type == PHOT_REF) {
    534     Msys = measure[0].M_PS;
     534    Msys = measure[0].M;
    535535    return (Msys);
    536536  }
    537537  code = &photcodes[0].code[Np];
    538   Mcat = measure[0].M_PS - ZERO_POINT + code[0].K*(measure[0].airmass_PS - 1.000) + F_PS*code[0].C;
     538  Mcat = measure[0].M - ZERO_POINT + code[0].K*(measure[0].airmass - 1.000) + F*code[0].C;
    539539
    540540  /* for DEP, color must be made of PRI/SEC */
    541541  mc = iPhotColor (average, secfilt, NULL, code);
    542   if (mc == NO_MAG_PS) return (Mcat);
    543   mc = mc - F_PS*code[0].dX;
     542  if (mc == NO_MAG) return (Mcat);
     543  mc = mc - F*code[0].dX;
    544544
    545545  Mc = mc;
     
    559559  PhotCode *code;
    560560
    561   Np = photcodes[0].hashcode[measure[0].source];
    562   if (Np == -1) return (NO_MAG_PS);
     561  Np = photcodes[0].hashcode[measure[0].photcode];
     562  if (Np == -1) return (NO_MAG);
    563563
    564564  if (photcodes[0].code[Np].type == PHOT_REF) {
    565     Mcat = measure[0].M_PS;
     565    Mcat = measure[0].M;
    566566    return (Mcat);
    567567  }
    568568  code = &photcodes[0].code[Np];
    569   Mrel = measure[0].M_PS - ZERO_POINT + code[0].K*(measure[0].airmass_PS - 1.000) + F_PS*code[0].C - measure[0].Mcal_PS;
     569  Mrel = measure[0].M - ZERO_POINT + code[0].K*(measure[0].airmass - 1.000) + F*code[0].C - measure[0].Mcal;
    570570
    571571  /* for DEP, color must be made of PRI/SEC */
    572572  mc = iPhotColor (average, secfilt, NULL, code);
    573   if (mc == NO_MAG_PS) return (Mrel);
    574   mc = mc - F_PS*code[0].dX;
     573  if (mc == NO_MAG) return (Mrel);
     574  mc = mc - F*code[0].dX;
    575575
    576576  Mc = mc;
     
    591591
    592592  /* code must be the matching PRI/SEC code for this measurement or an equivalent ALT */
    593   Np = photcodes[0].hashcode[thisone[0].source];
     593  Np = photcodes[0].hashcode[thisone[0].photcode];
    594594  if (Np == -1) {
    595     return (NO_MAG_PS);
     595    return (NO_MAG);
    596596  }
    597597
    598598  if (photcodes[0].code[Np].type == PHOT_REF) {
    599     Mrel = thisone[0].M_PS;
     599    Mrel = thisone[0].M;
    600600    return (Mrel);
    601601  }
    602602  if (code[0].code != photcodes[0].code[Np].equiv) {
    603     return (NO_MAG_PS);
    604   }
    605 
    606   Mcal = PhotRel (thisone, average, secfilt) + F_PS*code[0].C;
     603    return (NO_MAG);
     604  }
     605
     606  Mcal = PhotRel (thisone, average, secfilt) + F*code[0].C;
    607607
    608608  mc = iPhotColor (average, secfilt, measure, code);
    609   if (mc == NO_MAG_PS) return (Mcal);
    610   mc = mc - F_PS*code[0].dX;
     609  if (mc == NO_MAG) return (Mcal);
     610  mc = mc - F*code[0].dX;
    611611
    612612  Mc = mc;
     
    627627  PhotCode *color;
    628628
    629   m1 = m2 = NO_MAG_PS;
     629  m1 = m2 = NO_MAG;
    630630
    631631  if (measure == NULL) {
     
    633633    Ns2 = photcodes[0].hashNsec[code[0].c2];
    634634 
    635     m1 = (Ns1 == -1) ? average[0].M : secfilt[Ns1].M_PS;
    636     m2 = (Ns2 == -1) ? average[0].M : secfilt[Ns2].M_PS;
    637     mc = ((m1 == NO_MAG_PS) || (m2 == NO_MAG_PS)) ? NO_MAG_PS : (m1 - m2);
     635    m1 = (Ns1 == -1) ? average[0].M : secfilt[Ns1].M;
     636    m2 = (Ns2 == -1) ? average[0].M : secfilt[Ns2].M;
     637    mc = ((m1 == NO_MAG) || (m2 == NO_MAG)) ? NO_MAG : (m1 - m2);
    638638    return (mc);
    639639  }
     
    641641  /* find magnitude matching first color term */
    642642  color = GetPhotcodebyCode (code[0].c1);
    643   if (color == NULL) return (NO_MAG_PS);
     643  if (color == NULL) return (NO_MAG);
    644644  if (color[0].type == PHOT_REF) {
    645     for (i = 0; (i < average[0].Nm) && (m1 == NO_MAG_PS); i++) {
    646       if (measure[i].source == color[0].code) {
    647         m1 = measure[i].M_PS;
     645    for (i = 0; (i < average[0].Nm) && (m1 == NO_MAG); i++) {
     646      if (measure[i].photcode == color[0].code) {
     647        m1 = measure[i].M;
    648648      }
    649649    }
    650650  } else {
    651651    Ns = photcodes[0].hashNsec[color[0].code];
    652     m1 = (Ns == -1) ? average[0].M : secfilt[Ns].M_PS;
     652    m1 = (Ns == -1) ? average[0].M : secfilt[Ns].M;
    653653  }     
    654654
    655655  /* find magnitude matching second color term */
    656656  color = GetPhotcodebyCode (code[0].c2);
    657   if (color == NULL) return (NO_MAG_PS);
     657  if (color == NULL) return (NO_MAG);
    658658  if (color[0].type == PHOT_REF) {
    659     for (i = 0; (i < average[0].Nm) && (m2 == NO_MAG_PS); i++) {
    660       if (measure[i].source == color[0].code) {
    661         m2 = measure[i].M_PS;
     659    for (i = 0; (i < average[0].Nm) && (m2 == NO_MAG); i++) {
     660      if (measure[i].photcode == color[0].code) {
     661        m2 = measure[i].M;
    662662      }
    663663    }
    664664  } else {
    665665    Ns = photcodes[0].hashNsec[color[0].code];
    666     m2 = (Ns == -1) ? average[0].M : secfilt[Ns].M_PS;
     666    m2 = (Ns == -1) ? average[0].M : secfilt[Ns].M;
    667667  }     
    668   mc = ((m1 == NO_MAG_PS) || (m2 == NO_MAG_PS)) ? NO_MAG_PS : (m1 - m2);
     668  mc = ((m1 == NO_MAG) || (m2 == NO_MAG)) ? NO_MAG : (m1 - m2);
    669669  return (mc);
    670670}
     
    678678
    679679  Ns = photcodes[0].hashNsec[code[0].code];
    680   Mave = (Ns == -1) ? average[0].M : secfilt[Ns].M_PS;
    681   Mref = Mave + F_PS*code[0].C;
     680  Mave = (Ns == -1) ? average[0].M : secfilt[Ns].M;
     681  Mref = Mave + F*code[0].C;
    682682
    683683  mc = iPhotColor (average, secfilt, measure, code);
    684   if (mc == NO_MAG_PS) return (Mref);
    685   mc = mc - F_PS*code[0].dX;
     684  if (mc == NO_MAG) return (Mref);
     685  mc = mc - F*code[0].dX;
    686686
    687687  Mc = mc;
     
    702702
    703703  Ns = photcodes[0].hashNsec[code[0].code];
    704   Mave = (Ns == -1) ? average[0].M : secfilt[Ns].M_PS;
     704  Mave = (Ns == -1) ? average[0].M : secfilt[Ns].M;
    705705  return (Mave);
    706706}
     
    713713
    714714  Ns = photcodes[0].hashNsec[code[0].code];
    715   dM  = (Ns == -1) ? average[0].dM : secfilt[Ns].dM_PS;
     715  dM  = (Ns == -1) ? average[0].dM : secfilt[Ns].dM;
    716716  return (dM);
    717717}
     
    726726  Ns = photcodes[0].hashNsec[code[0].code];
    727727  Mi = (Ns == -1) ? average[0].Xm : secfilt[Ns].Xm;
    728   Xm = (Mi == NO_MAG_PS) ? -1.0 : pow (10.0, 0.01*Mi);
     728  Xm = (Mi == NO_MAG) ? -1.0 : pow (10.0, 0.01*Mi);
    729729  return (Xm);
    730730}
     
    741741  if (code[0].type == PHOT_REF) {
    742742    for (i = 0; i < average[0].Nm; i++) {
    743       if (measure[i].source == c1) {
    744         M1 = measure[i].M_PS;
     743      if (measure[i].photcode == c1) {
     744        M1 = measure[i].M;
    745745        goto filter1;
    746746      }
     
    749749  } else {
    750750    Ns = photcodes[0].hashNsec[code[0].code];
    751     M1 = (Ns == -1) ? average[0].M : secfilt[Ns].M_PS;
     751    M1 = (Ns == -1) ? average[0].M : secfilt[Ns].M;
    752752  }     
    753753
     
    757757  if (code[0].type == PHOT_REF) {
    758758    for (i = 0; i < average[0].Nm; i++) {
    759       if (measure[i].source == c2) {
    760         M2 = measure[i].M_PS;
     759      if (measure[i].photcode == c2) {
     760        M2 = measure[i].M;
    761761        goto filter2;
    762762      }
     
    765765  } else {
    766766    Ns = photcodes[0].hashNsec[code[0].code];
    767     M2 = (Ns == -1) ? average[0].M : secfilt[Ns].M_PS;
     767    M2 = (Ns == -1) ? average[0].M : secfilt[Ns].M;
    768768  }     
    769769 
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/coordops.update.c

    r8638 r12008  
    651651    case PROJ_GLS:
    652652    case PROJ_PAR:
    653       return PROJ_MODE_PSEUDOCLY;
     653      return PROJ_MODEEUDOCLY;
    654654  }
    655655  return PROJ_MODE_NONE;
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/dvo_catalog.c

    r8520 r12008  
    340340    for (in = out = i = 0; i < catalog[0].Naverage; i++) {
    341341      for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) {
    342         outsec[out].M_PS  = insec[in].M_PS;
    343         outsec[out].dM_PS = insec[in].dM_PS;
     342        outsec[out].M  = insec[in].M;
     343        outsec[out].dM = insec[in].dM;
    344344        outsec[out].Xm = insec[in].Xm;
    345345      }
    346346      for (j = 0; j < Nextra; j++, out++) {
    347         outsec[out].M_PS  = NO_MAG;
    348         outsec[out].dM_PS = NO_MAG;
     347        outsec[out].M  = NO_MAG;
     348        outsec[out].dM = NO_MAG;
    349349        outsec[out].Xm    = NO_MAG;
    350350      }
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/dvo_catalog_raw.c

    r8456 r12008  
    3131    if (!strcmp (format, "LONEOS")) catalog[0].catformat = DVO_FORMAT_LONEOS;
    3232    if (!strcmp (format, "ELIXIR")) catalog[0].catformat = DVO_FORMAT_ELIXIR;
    33     if (!strcmp (format, "PANSTARRS")) catalog[0].catformat = DVO_FORMAT_PANSTARRS;
    34     if (!strcmp (format, "PMTEST")) catalog[0].catformat = DVO_FORMAT_PMTEST;
     33    // if (!strcmp (format, "PANSTARRS")) catalog[0].catformat = DVO_FORMAT_PANSTARRS;
     34    // if (!strcmp (format, "PMTEST")) catalog[0].catformat = DVO_FORMAT_PMTEST;
    3535    if (catalog[0].catformat != DVO_FORMAT_UNDEF) goto got_format;
    3636  }
     
    7171      SecFiltSize = sizeof (SecFiltElixir);
    7272      break;
     73# if 0
    7374    case DVO_FORMAT_PANSTARRS:
    7475      AverageSize = sizeof(AveragePanstarrs);
     
    8182      SecFiltSize = sizeof (SecFiltPanstarrs);
    8283      break;
     84# endif
    8385    default:
    8486      fprintf (stderr, "programming error in phot_catalog_raw\n");
     
    210212  if (catalog[0].catformat == DVO_FORMAT_LONEOS)    gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "LONEOS");
    211213  if (catalog[0].catformat == DVO_FORMAT_ELIXIR)    gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "ELIXIR");
    212   if (catalog[0].catformat == DVO_FORMAT_PANSTARRS) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PANSTARRS");
    213   if (catalog[0].catformat == DVO_FORMAT_PMTEST)    gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PMTEST");
     214  // if (catalog[0].catformat == DVO_FORMAT_PANSTARRS) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PANSTARRS");
     215  // if (catalog[0].catformat == DVO_FORMAT_PMTEST)    gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PMTEST");
    214216
    215217  /* rewind file pointers and truncate file */
     
    256258  AverageElixir *tmpAverageElixir;
    257259  AverageLoneos *tmpAverageLoneos;
    258   AveragePanstarrs *tmpAveragePanstarrs;
    259   AveragePMtest *tmpAveragePMtest;
     260  // AveragePanstarrs *tmpAveragePanstarrs;
     261  // AveragePMtest *tmpAveragePMtest;
    260262
    261263  switch (format) {
     
    291293      free (tmpAverageLoneos);
    292294      break;
     295# if 0
    293296    case DVO_FORMAT_PANSTARRS:
    294297      ALLOCATE (tmpAveragePanstarrs, AveragePanstarrs, MAX (Naverage, 1));
     
    313316      free (tmpAveragePMtest);
    314317      break;
     318# endif
    315319    default:
    316320      fprintf (stderr, "error reading measures\n");
     
    327331  AverageElixir *tmpAverageElixir;
    328332  AverageLoneos *tmpAverageLoneos;
    329   AveragePanstarrs *tmpAveragePanstarrs;
    330   AveragePMtest *tmpAveragePMtest;
     333  // AveragePanstarrs *tmpAveragePanstarrs;
     334  // AveragePMtest *tmpAveragePMtest;
    331335
    332336  switch (format) {
     
    359363      }
    360364      break;
     365# if 0
    361366    case DVO_FORMAT_PANSTARRS:
    362367      tmpAveragePanstarrs = AverageInternalToPanstarrs (average, Naverage);
     
    379384      }
    380385      break;
     386# endif
    381387    default:
    382388      fprintf (stderr, "error writing averages\n");
     
    394400  MeasureElixir *tmpMeasureElixir;
    395401  MeasureLoneos *tmpMeasureLoneos;
    396   MeasurePanstarrs *tmpMeasurePanstarrs;
     402  // MeasurePanstarrs *tmpMeasurePanstarrs;
    397403
    398404  switch (format) {
     
    428434      free (tmpMeasureLoneos);
    429435      break;
     436# if 0
    430437    case DVO_FORMAT_PANSTARRS:
    431438    case DVO_FORMAT_PMTEST:
     
    440447      free (tmpMeasurePanstarrs);
    441448      break;
     449# endif
    442450    default:
    443451      fprintf (stderr, "error reading measures\n");
     
    454462  MeasureElixir *tmpMeasureElixir;
    455463  MeasureLoneos *tmpMeasureLoneos;
    456   MeasurePanstarrs *tmpMeasurePanstarrs;
     464  // MeasurePanstarrs *tmpMeasurePanstarrs;
    457465
    458466  switch (format) {
     
    485493      }
    486494      break;
     495# if 0
    487496    case DVO_FORMAT_PANSTARRS:
    488497    case DVO_FORMAT_PMTEST:
     
    496505      }
    497506      break;
     507# endif
    498508    default:
    499509      fprintf (stderr, "error writing measures\n");
     
    511521  SecFiltElixir *tmpSecFiltElixir;
    512522  SecFiltLoneos *tmpSecFiltLoneos;
    513   SecFiltPanstarrs *tmpSecFiltPanstarrs;
     523  // SecFiltPanstarrs *tmpSecFiltPanstarrs;
    514524
    515525  switch (format) {
     
    545555      free (tmpSecFiltLoneos);
    546556      break;
     557# if 0
    547558    case DVO_FORMAT_PANSTARRS:
    548559    case DVO_FORMAT_PMTEST:
     
    557568      free (tmpSecFiltPanstarrs);
    558569      break;
     570# endif
    559571    default:
    560572      fprintf (stderr, "error reading measures\n");
     
    571583  SecFiltElixir *tmpSecFiltElixir;
    572584  SecFiltLoneos *tmpSecFiltLoneos;
    573   SecFiltPanstarrs *tmpSecFiltPanstarrs;
     585  // SecFiltPanstarrs *tmpSecFiltPanstarrs;
    574586
    575587  switch (format) {
     
    602614      }
    603615      break;
     616# if 0
    604617    case DVO_FORMAT_PANSTARRS:
    605618    case DVO_FORMAT_PMTEST:
     
    613626      }
    614627      break;
     628# endif
    615629    default:
    616630      fprintf (stderr, "error writing secfilts\n");
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/dvo_convert.c

    r8456 r12008  
    4444    return (average);
    4545  }
     46/* disable the new and minimally-used versions for now. 
     47   put them back in after dev work is further along
     48   OR replace with other output formats */
     49# if 0
    4650  if (!strcmp (extname, "DVO_AVERAGE_PANSTARRS")) {
    4751    AveragePanstarrs *tmpAverage;
     
    6064    return (average);
    6165  }
     66# endif
    6267
    6368  fprintf (stderr, "table format unknown: %s\n", extname);
     
    7176  AverageElixir *tmpAverageElixir;
    7277  AverageLoneos *tmpAverageLoneos ;
    73   AveragePanstarrs *tmpAveragePanstarrs;
    74   AveragePMtest *tmpAveragePMtest;
     78  // AveragePanstarrs *tmpAveragePanstarrs;
     79  // AveragePMtest *tmpAveragePMtest;
    7580
    7681  /* convert from the internal format */
     
    8994      free (tmpAverageLoneos );
    9095      break;
     96# if 0
    9197    case DVO_FORMAT_PANSTARRS:
    9298      tmpAveragePanstarrs = AverageInternalToPanstarrs (average, Naverage);
     
    99105      free (tmpAveragePMtest);
    100106      break;
     107# endif
    101108    default:
    102109      fprintf (stderr, "table format unknown (average)\n");
     
    139146    return (measure);
    140147  }
     148# if 0
    141149  if (!strcmp (extname, "DVO_MEASURE_PANSTARRS") || !strcmp (extname, "DVO_MEASURE_PMTEST")) {
    142150    MeasurePanstarrs *tmpMeasure;
     
    147155    return (measure);
    148156  }
     157# endif
    149158
    150159  fprintf (stderr, "table format unknown: %s\n", extname);
     
    158167  MeasureElixir *tmpMeasureElixir;
    159168  MeasureLoneos *tmpMeasureLoneos;
    160   MeasurePanstarrs *tmpMeasurePanstarrs;
     169  // MeasurePanstarrs *tmpMeasurePanstarrs;
    161170
    162171  /* convert from the internal format */
     
    175184      free (tmpMeasureLoneos);
    176185      break;
     186# if 0
    177187    case DVO_FORMAT_PANSTARRS:
    178188    case DVO_FORMAT_PMTEST:
     
    181191      free (tmpMeasurePanstarrs);
    182192      break;
     193# endif
    183194    default:
    184195      fprintf (stderr, "table format unknown (measure)\n");
     
    221232    return (secfilt);
    222233  }
     234# if 0
    223235  if (!strcmp (extname, "DVO_SECFILT_PANSTARRS") || !strcmp (extname, "DVO_SECFILT_PMTEST")) {
    224236    SecFiltPanstarrs *tmpSecFilt;
     
    229241    return (secfilt);
    230242  }
     243# endif
    231244
    232245  fprintf (stderr, "table format unknown: %s\n", extname);
     
    240253  SecFiltElixir *tmpSecFiltElixir;
    241254  SecFiltLoneos *tmpSecFiltLoneos;
    242   SecFiltPanstarrs *tmpSecFiltPanstarrs;
     255  // SecFiltPanstarrs *tmpSecFiltPanstarrs;
    243256
    244257  /* convert from the internal format */
     
    257270      free (tmpSecFiltLoneos);
    258271      break;
     272# if 0
    259273    case DVO_FORMAT_PANSTARRS:
    260274    case DVO_FORMAT_PMTEST:
     
    263277      free (tmpSecFiltPanstarrs);
    264278      break;
     279# endif
    265280    default:
    266281      fprintf (stderr, "table format unknown (secfilt)\n");
     
    313328    goto set_header;
    314329  }
     330# if 0
    315331  if (!strcmp (extname, "DVO_IMAGE_PANSTARRS") || !strcmp (extname, "DVO_IMAGE_PMTEST")) {
    316332    ImagePanstarrs *tmpimage;
     
    321337    goto set_header;
    322338  }
     339# endif
    323340  fprintf (stderr, "table format unknown: %s\n", extname);
    324341  return (FALSE);
     
    338355  ImageElixir *tmpImageElixir;
    339356  ImageLoneos *tmpImageLoneos;
    340   ImagePanstarrs *tmpImagePanstarrs;
     357  // ImagePanstarrs *tmpImagePanstarrs;
    341358
    342359  Nimage = theader[0].Naxis[1];
     
    359376      free (tmpImageLoneos);
    360377      break;
     378# if 0
    361379    case DVO_FORMAT_PANSTARRS:
    362380    case DVO_FORMAT_PMTEST:
     
    366384      free (tmpImagePanstarrs);
    367385      break;
     386# endif
    368387    default:
    369388      fprintf (stderr, "table format unknown (image ftable)\n");
     
    377396  ImageElixir *tmpImageElixir;
    378397  ImageLoneos *tmpImageLoneos;
    379   ImagePanstarrs *tmpImagePanstarrs;
     398  // ImagePanstarrs *tmpImagePanstarrs;
    380399  int i, Nrow, Nimage;
    381400
     
    427446      vtable[0].size = gfits_matrix_size (theader);
    428447      return (TRUE);
     448# if 0
    429449    case DVO_FORMAT_PANSTARRS:
    430450    case DVO_FORMAT_PMTEST:
     
    436456        vtable[0].buffer[i] = (char *) tmpImagePanstarrs;
    437457      }
     458# endif
    438459
    439460      /* convert header from old format to new format */
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/dvo_convert_elixir.c

    r6683 r12008  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
    12     out[i].dR_PS   = in[i].dR * 0.01;
    13     out[i].dD_PS   = in[i].dD * 0.01;
    14     out[i].M_PS    = in[i].M  * 0.001;
    15     out[i].dM_PS   = in[i].dM * 0.001;
    16     out[i].dt_PS      = in[i].dt * 0.001;
    17     out[i].Mcal_PS    = in[i].Mcal * 0.001;
    18     out[i].Mgal_PS    = in[i].Mgal * 0.001;
    19     out[i].airmass_PS = in[i].airmass * 0.001;
    20     out[i].FWx     = in[i].FWx;
    21     out[i].FWy     = in[i].fwy * in[i].FWx * 0.01;
    22     out[i].theta   = in[i].theta;
    23     out[i].dophot  = in[i].dophot;
    24     out[i].source  = in[i].source;
    25     out[i].t       = in[i].t;
    26     out[i].averef  = in[i].averef;
    27     out[i].flags   = in[i].flags;
     12    out[i].dR       = in[i].dR * 0.01;
     13    out[i].dD       = in[i].dD * 0.01;
     14    out[i].M        = in[i].M  * 0.001;
     15    out[i].dM       = in[i].dM * 0.001;
     16    out[i].dt       = in[i].dt * 0.001;
     17    out[i].Mcal     = in[i].Mcal * 0.001;
     18    out[i].Mgal     = in[i].Mgal * 0.001;
     19    out[i].airmass  = in[i].airmass * 0.001;
     20    out[i].FWx      = in[i].FWx;
     21    out[i].FWy      = in[i].fwy * in[i].FWx * 0.01;
     22    out[i].theta    = in[i].theta*(0x10000 / 0x100);
     23    out[i].dophot   = in[i].dophot;
     24    out[i].photcode = in[i].source;
     25    out[i].t        = in[i].t;
     26    out[i].averef   = in[i].averef;
     27    out[i].flags    = in[i].flags;
     28   
     29    /* these can be determined if needed / desired */
     30    out[i].Xccd     = 0;
     31    out[i].Yccd     = 0;
     32    out[i].dXccd    = 0;
     33    out[i].dYccd    = 0;
     34
     35    /* these do not have a corresponding value */
     36    out[i].stargal  = 0;
     37    out[i].Sky      = 0;
     38    out[i].dSky     = 0;
     39    out[i].qPSF     = 0;
     40
     41    /* XXX add these later */
     42    out[i].detID_hi = 0;
     43    out[i].detID_lo = 0;
     44    out[i].imageID_hi = 0;
     45    out[i].imageID_lo = 0;
    2846  }
    2947  return (out);
     
    3957
    4058  for (i = 0; i < Nvalues; i++) {
    41     out[i].dR      = in[i].dR_PS * 100.0;
    42     out[i].dD      = in[i].dD_PS * 100.0;
    43     out[i].M       = in[i].M_PS  * 1000.0;
    44     out[i].dM      = in[i].dM_PS * 1000.0;
    45     out[i].dt      = in[i].dt_PS * 1000.0;
    46     out[i].Mcal    = in[i].Mcal_PS * 1000.0;
    47     out[i].Mgal    = in[i].Mgal_PS * 1000.0;
    48     out[i].airmass = in[i].airmass_PS * 1000.0;
     59    out[i].dR      = in[i].dR * 100.0;
     60    out[i].dD      = in[i].dD * 100.0;
     61    out[i].M       = in[i].M  * 1000.0;
     62    out[i].dM      = in[i].dM * 1000.0;
     63    out[i].dt      = in[i].dt * 1000.0;
     64    out[i].Mcal    = in[i].Mcal * 1000.0;
     65    out[i].Mgal    = in[i].Mgal * 1000.0;
     66    out[i].airmass = in[i].airmass * 1000.0;
    4967    out[i].FWx     = in[i].FWx;
    50     out[i].fwy     = 100.0 * in[i].FWy / in[i].FWx;
    51     out[i].theta   = in[i].theta;
     68    out[i].fwy     = in[i].FWy * 100.0 / in[i].FWx;
     69    out[i].theta   = in[i].theta*(0x100/ 0x10000);
    5270    out[i].dophot  = in[i].dophot;
    53     out[i].source  = in[i].source;
     71    out[i].source  = in[i].photcode;
    5472    out[i].t       = in[i].t;
    5573    out[i].averef  = in[i].averef;
     
    90108    out[i].P       = 0;
    91109    out[i].dP      = 0;
     110
     111    /* XXX add these later */
     112    out[i].objID_hi = 0;
     113    out[i].objID_lo = 0;
    92114  }
    93115  return (out);
     
    128150
    129151  for (i = 0; i < Nvalues; i++) {
    130     out[i].M_PS    = in[i].M  * 0.001;     
    131     out[i].dM_PS   = in[i].dM * 0.001;     
    132     out[i].Xm      = in[i].Xm;     
     152    out[i].M     = in[i].M  * 0.001;     
     153    out[i].dM    = in[i].dM * 0.001;     
     154    out[i].Xm    = in[i].Xm;     
     155    out[i].Ncode = 0;
     156    out[i].Nused = 0;
    133157  }
    134158  return (out);
     
    144168
    145169  for (i = 0; i < Nvalues; i++) {
    146     out[i].M       = in[i].M_PS  * 1000.0;     
    147     out[i].dM      = in[i].dM_PS * 1000.0;
     170    out[i].M       = in[i].M  * 1000.0;     
     171    out[i].dM      = in[i].dM * 1000.0;
    148172    out[i].Xm      = in[i].Xm;     
    149173  }
     
    166190    out[i].tzero            = in[i].tzero;
    167191    out[i].nstar            = in[i].nstar;
    168     out[i].secz_PS          = in[i].secz * 0.001;
     192    out[i].secz             = in[i].secz * 0.001;
    169193    out[i].NX               = in[i].NX;
    170194    out[i].NY               = in[i].NY;
    171     out[i].apmifit_PS       = in[i].apmifit * 0.001;
    172     out[i].dapmifit_PS      = in[i].dapmifit * 0.001;
    173     out[i].Mcal_PS          = in[i].Mcal * 0.001;
    174     out[i].dMcal_PS         = in[i].dMcal * 0.001;
     195    out[i].apmifit          = in[i].apmifit * 0.001;
     196    out[i].dapmifit         = in[i].dapmifit * 0.001;
     197    out[i].Mcal             = in[i].Mcal * 0.001;
     198    out[i].dMcal            = in[i].dMcal * 0.001;
    175199    out[i].Xm               = in[i].Xm;
    176     out[i].source           = in[i].source;
     200    out[i].photcode         = in[i].source;
    177201    out[i].exptime          = in[i].exptime;
    178202    out[i].detection_limit  = in[i].detection_limit;
     
    199223    out[i].Mxyyy            = in[i].Mxyyy;
    200224    out[i].Myyyy            = in[i].Myyyy;
     225
     226    /* XXX add these later */
     227    out[i].imageID_hi = 0;
     228    out[i].imageID_lo = 0;
    201229  }
    202230  return (out);
     
    218246    out[i].tzero            = in[i].tzero;
    219247    out[i].nstar            = in[i].nstar;
    220     out[i].secz             = in[i].secz_PS * 1000.0;
     248    out[i].secz             = in[i].secz * 1000.0;
    221249    out[i].NX               = in[i].NX;
    222250    out[i].NY               = in[i].NY;
    223     out[i].apmifit          = in[i].apmifit_PS * 1000.0;
    224     out[i].dapmifit         = in[i].dapmifit_PS * 1000.0;
    225     out[i].Mcal             = in[i].Mcal_PS * 1000.0;
    226     out[i].dMcal            = in[i].dMcal_PS * 1000.0;
     251    out[i].apmifit          = in[i].apmifit * 1000.0;
     252    out[i].dapmifit         = in[i].dapmifit * 1000.0;
     253    out[i].Mcal             = in[i].Mcal * 1000.0;
     254    out[i].dMcal            = in[i].dMcal * 1000.0;
    227255    out[i].Xm               = in[i].Xm;
    228     out[i].source           = in[i].source;
     256    out[i].source           = in[i].photcode;
    229257    out[i].exptime          = in[i].exptime;
    230258    out[i].detection_limit  = in[i].detection_limit;
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/dvo_convert_loneos.c

    r6683 r12008  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
    12     out[i].dR_PS   = in[i].dR * 0.01;
    13     out[i].dD_PS   = in[i].dD * 0.01;
    14     out[i].M_PS    = in[i].M  * 0.001;
    15     out[i].dM_PS   = in[i].dM * 0.001;
    16     out[i].Mcal_PS = in[i].Mcal * 0.001;
     12    out[i].dR   = in[i].dR * 0.01;
     13    out[i].dD   = in[i].dD * 0.01;
     14    out[i].M    = in[i].M  * 0.001;
     15    out[i].dM   = in[i].dM * 0.001;
     16    out[i].Mcal = in[i].Mcal * 0.001;
    1717    out[i].dophot  = in[i].dophot;
    18     out[i].source  = in[i].source;
     18    out[i].photcode  = in[i].source;
    1919    out[i].t       = in[i].t;
    2020
     
    2424
    2525    /* these values don't exist in the Loneos format */
    26     out[i].Mgal_PS    = in[i].M;
    27     out[i].dt_PS      = 0;
    28     out[i].airmass_PS = 0;
     26    out[i].Mgal    = in[i].M;
     27    out[i].dt      = 0;
     28    out[i].airmass = 0;
    2929    out[i].FWx        = 0;
    3030    out[i].FWy        = 0;
    3131    out[i].theta      = 0;
     32    out[i].stargal  = 0;
     33    out[i].Sky      = 0;
     34    out[i].dSky     = 0;
     35    out[i].qPSF     = 0;
     36
     37    /* these can be determined if needed / desired */
     38    out[i].Xccd     = 0;
     39    out[i].Yccd     = 0;
     40    out[i].dXccd    = 0;
     41    out[i].dYccd    = 0;
     42
     43    /* XXX add these later */
     44    out[i].detID_hi = 0;
     45    out[i].detID_lo = 0;
     46    out[i].imageID_hi = 0;
     47    out[i].imageID_lo = 0;
    3248  }
    3349  return (out);
     
    4359
    4460  for (i = 0; i < Nvalues; i++) {
    45     out[i].dR     = in[i].dR_PS * 100.0;
    46     out[i].dD     = in[i].dD_PS * 100.0;
    47     out[i].M      = in[i].M_PS  * 1000.0;
    48     out[i].dM     = in[i].dM_PS * 1000.0;
    49     out[i].Mcal   = in[i].Mcal_PS * 1000.0;
     61    out[i].dR     = in[i].dR * 100.0;
     62    out[i].dD     = in[i].dD * 100.0;
     63    out[i].M      = in[i].M  * 1000.0;
     64    out[i].dM     = in[i].dM * 1000.0;
     65    out[i].Mcal   = in[i].Mcal * 1000.0;
    5066    out[i].dophot = in[i].dophot;
    51     out[i].source = in[i].source;
     67    out[i].source = in[i].photcode;
    5268    out[i].t      = in[i].t;
    5369
     
    89105    out[i].dM      = 0xffff;
    90106    out[i].Xg      = 0xffff;
     107
     108    /* XXX add these later */
     109    out[i].objID_hi = 0;
     110    out[i].objID_lo = 0;
    91111  }
    92112  return (out);
     
    125145
    126146  for (i = 0; i < Nvalues; i++) {
    127     out[i].M_PS  = in[i].M*0.001;     
    128     out[i].dM_PS = 0xffff;
     147    out[i].M     = in[i].M*0.001;     
    129148    out[i].Xm    = in[i].Xm;     
     149    out[i].dM    = 0xffff;
     150    out[i].Ncode = 0;
     151    out[i].Nused = 0;
    130152  }
    131153  return (out);
     
    141163
    142164  for (i = 0; i < Nvalues; i++) {
    143     out[i].M    = in[i].M_PS*1000.0;     
     165    out[i].M    = in[i].M*1000.0;     
    144166    out[i].Xm   = in[i].Xm;     
    145167  }
     
    162184    out[i].tzero            = in[i].tzero;
    163185    out[i].nstar            = in[i].nstar;
    164     out[i].secz_PS          = in[i].secz * 0.001;
     186    out[i].secz             = in[i].secz * 0.001;
    165187    out[i].NX               = in[i].NX;
    166188    out[i].NY               = in[i].NY;
    167     out[i].apmifit_PS       = in[i].apmifit * 0.001;
    168     out[i].dapmifit_PS      = in[i].dapmifit * 0.001;
    169     out[i].Mcal_PS          = in[i].Mcal * 0.001;
    170     out[i].dMcal_PS         = in[i].dMcal * 0.001;
     189    out[i].apmifit          = in[i].apmifit * 0.001;
     190    out[i].dapmifit         = in[i].dapmifit * 0.001;
     191    out[i].Mcal     = in[i].Mcal * 0.001;
     192    out[i].dMcal            = in[i].dMcal * 0.001;
    171193    out[i].Xm               = in[i].Xm;
    172     out[i].source           = in[i].source;
     194    out[i].photcode         = in[i].source;
    173195    out[i].exptime          = in[i].exptime;
    174196    out[i].detection_limit  = in[i].detection_limit;
     
    195217    out[i].Mxyyy            = in[i].Mxyyy;
    196218    out[i].Myyyy            = in[i].Myyyy;
     219
     220    /* XXX add these later */
     221    out[i].imageID_hi = 0;
     222    out[i].imageID_lo = 0;
    197223  }
    198224  return (out);
     
    214240    out[i].tzero            = in[i].tzero;
    215241    out[i].nstar            = in[i].nstar;
    216     out[i].secz             = in[i].secz_PS * 1000.0;
     242    out[i].secz             = in[i].secz * 1000.0;
    217243    out[i].NX               = in[i].NX;
    218244    out[i].NY               = in[i].NY;
    219     out[i].apmifit          = in[i].apmifit_PS * 1000.0;
    220     out[i].dapmifit         = in[i].dapmifit_PS * 1000.0;
    221     out[i].Mcal             = in[i].Mcal_PS * 1000.0;
    222     out[i].dMcal            = in[i].dMcal_PS * 1000.0;
     245    out[i].apmifit          = in[i].apmifit * 1000.0;
     246    out[i].dapmifit         = in[i].dapmifit * 1000.0;
     247    out[i].Mcal             = in[i].Mcal * 1000.0;
     248    out[i].dMcal            = in[i].dMcal * 1000.0;
    223249    out[i].Xm               = in[i].Xm;
    224     out[i].source           = in[i].source;
     250    out[i].source           = in[i].photcode;
    225251    out[i].exptime          = in[i].exptime;
    226252    out[i].detection_limit  = in[i].detection_limit;
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/dvo_convert_panstarrs.c

    r6683 r12008  
    11# include <dvo.h>
    22
    3 /*** note that these structures are identical ***/
     3/*** XXX is this format actually used by anyone?? ***/
    44
    55/* convert panstarrs-format measures to internal measures */
     
    1212
    1313  for (i = 0; i < Nvalues; i++) {
    14     out[i].dR_PS      = in[i].dR;
    15     out[i].dD_PS      = in[i].dD;
    16     out[i].M_PS       = in[i].M;
    17     out[i].dM_PS      = in[i].dM;
    18     out[i].Mcal_PS    = in[i].Mcal;
    19     out[i].Mgal_PS    = in[i].Mgal;
    20     out[i].airmass_PS = in[i].airmass;
    21     out[i].dt_PS      = in[i].dt;
     14    out[i].dR         = in[i].dR;
     15    out[i].dD         = in[i].dD;
     16    out[i].M          = in[i].M;
     17    out[i].dM         = in[i].dM;
     18    out[i].Mcal       = in[i].Mcal;
     19    out[i].Mgal       = in[i].Mgal;
     20    out[i].airmass    = in[i].airmass;
     21    out[i].dt         = in[i].dt;
    2222    out[i].FWx        = in[i].FWx;
    2323    out[i].FWy        = in[i].FWy;
    2424    out[i].theta      = in[i].theta;
    2525    out[i].dophot     = in[i].dophot;
    26     out[i].source     = in[i].source;
     26    out[i].photcode   = in[i].source;
    2727    out[i].t          = in[i].t;
    2828    out[i].averef     = in[i].averef;
    2929    out[i].flags      = in[i].flags;
     30   
     31    /* these can be determined if needed / desired */
     32    out[i].Xccd     = 0;
     33    out[i].Yccd     = 0;
     34    out[i].dXccd    = 0;
     35    out[i].dYccd    = 0;
     36
     37    /* these do not have a corresponding value */
     38    out[i].stargal  = 0;
     39    out[i].Sky      = 0;
     40    out[i].dSky     = 0;
     41    out[i].qPSF     = 0;
     42
     43    /* XXX add these later */
     44    out[i].detID_hi = 0;
     45    out[i].detID_lo = 0;
     46    out[i].imageID_hi = 0;
     47    out[i].imageID_lo = 0;
    3048  }
    3149  return (out);
     
    4159
    4260  for (i = 0; i < Nvalues; i++) {
    43     out[i].dR      = in[i].dR_PS;
    44     out[i].dD      = in[i].dD_PS;
    45     out[i].M       = in[i].M_PS;
    46     out[i].dM      = in[i].dM_PS;
    47     out[i].Mcal    = in[i].Mcal_PS;
    48     out[i].Mgal    = in[i].Mgal_PS;
    49     out[i].airmass = in[i].airmass_PS;
    50     out[i].dt      = in[i].dt_PS;
     61    out[i].dR      = in[i].dR;
     62    out[i].dD      = in[i].dD;
     63    out[i].M       = in[i].M;
     64    out[i].dM      = in[i].dM;
     65    out[i].Mcal    = in[i].Mcal;
     66    out[i].Mgal    = in[i].Mgal;
     67    out[i].airmass = in[i].airmass;
     68    out[i].dt      = in[i].dt;
    5169    out[i].FWx     = in[i].FWx;
    5270    out[i].FWy     = in[i].FWy;
    5371    out[i].theta   = in[i].theta;
    5472    out[i].dophot  = in[i].dophot;
    55     out[i].source  = in[i].source;
     73    out[i].source  = in[i].photcode;
    5674    out[i].t       = in[i].t;
    5775    out[i].averef  = in[i].averef;
     
    92110    out[i].P       = 0;
    93111    out[i].dP      = 0;
     112
     113    /* XXX add these later */
     114    out[i].objID_hi = 0;
     115    out[i].objID_lo = 0;
    94116  }
    95117  return (out);
     
    130152
    131153  for (i = 0; i < Nvalues; i++) {
    132     out[i].M_PS    = in[i].M;     
    133     out[i].dM_PS   = in[i].dM;     
    134     out[i].Xm      = in[i].Xm;     
    135   }
     154    out[i].M    = in[i].M;     
     155    out[i].dM   = in[i].dM;     
     156    out[i].Xm      = in[i].Xm;     
     157     out[i].Ncode = 0;
     158    out[i].Nused = 0;
     159 }
    136160  return (out);
    137161}
     
    146170
    147171  for (i = 0; i < Nvalues; i++) {
    148     out[i].M       = in[i].M_PS;     
    149     out[i].dM      = in[i].dM_PS;
     172    out[i].M       = in[i].M;     
     173    out[i].dM      = in[i].dM;
    150174    out[i].Xm      = in[i].Xm;     
    151175  }
     
    168192    out[i].tzero            = in[i].tzero;
    169193    out[i].nstar            = in[i].nstar;
    170     out[i].secz_PS                  = in[i].secz;
     194    out[i].secz             = in[i].secz;
    171195    out[i].NX               = in[i].NX;
    172196    out[i].NY               = in[i].NY;
    173     out[i].apmifit_PS       = in[i].apmifit;
    174     out[i].dapmifit_PS      = in[i].dapmifit;
    175     out[i].Mcal_PS                  = in[i].Mcal;
    176     out[i].dMcal_PS         = in[i].dMcal;
     197    out[i].apmifit          = in[i].apmifit;
     198    out[i].dapmifit         = in[i].dapmifit;
     199    out[i].Mcal             = in[i].Mcal;
     200    out[i].dMcal            = in[i].dMcal;
    177201    out[i].Xm               = in[i].Xm;
    178     out[i].source           = in[i].source;
     202    out[i].photcode         = in[i].source;
    179203    out[i].exptime          = in[i].exptime;
    180204    out[i].detection_limit  = in[i].detection_limit;
     
    201225    out[i].Mxyyy            = in[i].Mxyyy;
    202226    out[i].Myyyy            = in[i].Myyyy;
     227
     228    /* XXX add these later */
     229    out[i].imageID_hi = 0;
     230    out[i].imageID_lo = 0;
    203231  }
    204232  return (out);
     
    220248    out[i].tzero            = in[i].tzero;
    221249    out[i].nstar            = in[i].nstar;
    222     out[i].secz             = in[i].secz_PS;
     250    out[i].secz             = in[i].secz;
    223251    out[i].NX               = in[i].NX;
    224252    out[i].NY               = in[i].NY;
    225     out[i].apmifit          = in[i].apmifit_PS;
    226     out[i].dapmifit         = in[i].dapmifit_PS;
    227     out[i].Mcal             = in[i].Mcal_PS;
    228     out[i].dMcal            = in[i].dMcal_PS;
     253    out[i].apmifit          = in[i].apmifit;
     254    out[i].dapmifit         = in[i].dapmifit;
     255    out[i].Mcal             = in[i].Mcal;
     256    out[i].dMcal            = in[i].dMcal;
    229257    out[i].Xm               = in[i].Xm;
    230     out[i].source           = in[i].source;
     258    out[i].source           = in[i].photcode;
    231259    out[i].exptime          = in[i].exptime;
    232260    out[i].detection_limit  = in[i].detection_limit;
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/dvo_convert_pmtest.c

    r6683 r12008  
    11# include <dvo.h>
     2
     3/* convert elixir-format measures to internal measures */
     4Measure *MeasureElixirToInternal (MeasureElixir *in, int Nvalues) {
     5
     6  int i;
     7  Measure *out;
     8
     9  ALLOCATE (out, Measure, Nvalues);
     10
     11  for (i = 0; i < Nvalues; i++) {
     12    out[i].dR         = in[i].dR;
     13    out[i].dD         = in[i].dD;
     14    out[i].M          = in[i].M;
     15    out[i].dM         = in[i].dM;
     16    out[i].dt         = in[i].dt;
     17    out[i].Mcal       = in[i].Mcal;
     18    out[i].Mgal       = in[i].Mgal;
     19    out[i].airmass    = in[i].airmass;
     20    out[i].FWx        = in[i].FWx;
     21    out[i].FWy        = in[i].FWy;
     22    out[i].theta      = in[i].theta;
     23    out[i].dophot     = in[i].dophot;
     24    out[i].photcode   = in[i].source;
     25    out[i].t          = in[i].t;
     26    out[i].averef     = in[i].averef;
     27    out[i].flags      = in[i].flags;
     28
     29    out[i].Xccd       = in[i].Xccd;
     30    out[i].Yccd       = in[i].Yccd;
     31    out[i].dXccd      = in[i].dXccd;
     32    out[i].dYccd      = in[i].dYccd;
     33                                           
     34    out[i].stargal    = in[i].stargal;
     35    out[i].Sky        = in[i].Sky;
     36    out[i].dSky       = in[i].dSky;
     37    out[i].qPSF       = in[i].qPSF;
     38                                           
     39    out[i].detID_hi   = in[i].detID_hi;
     40    out[i].detID_lo   = in[i].detID_lo;
     41    out[i].imageID_hi = in[i].imageID_hi;
     42    out[i].imageID_lo = in[i].imageID_lo;
     43  }
     44  return (out);
     45}
     46
     47/* convert internal measures to elixir-format measures */
     48MeasureElixir *MeasureInternalToElixir (Measure *in, int Nvalues) {
     49
     50  int i;
     51  MeasureElixir *out;
     52
     53  ALLOCATE (out, MeasureElixir, Nvalues);
     54
     55  for (i = 0; i < Nvalues; i++) {
     56    out[i].dR         = in[i].dR;
     57    out[i].dD         = in[i].dD;
     58    out[i].M          = in[i].M;
     59    out[i].dM         = in[i].dM;
     60    out[i].dt         = in[i].dt;
     61    out[i].Mcal       = in[i].Mcal;
     62    out[i].Mgal       = in[i].Mgal;
     63    out[i].airmass    = in[i].airmass;
     64    out[i].FWx        = in[i].FWx;
     65    out[i].FWy        = in[i].FWy;
     66    out[i].theta      = in[i].theta;
     67    out[i].dophot     = in[i].dophot;
     68    out[i].photcode   = in[i].source;
     69    out[i].t          = in[i].t;
     70    out[i].averef     = in[i].averef;
     71    out[i].flags      = in[i].flags;
     72
     73    out[i].Xccd       = in[i].Xccd;
     74    out[i].Yccd       = in[i].Yccd;
     75    out[i].dXccd      = in[i].dXccd;
     76    out[i].dYccd      = in[i].dYccd;
     77                                           
     78    out[i].stargal    = in[i].stargal;
     79    out[i].Sky        = in[i].Sky;
     80    out[i].dSky       = in[i].dSky;
     81    out[i].qPSF       = in[i].qPSF;
     82                                           
     83    out[i].detID_hi   = in[i].detID_hi;
     84    out[i].detID_lo   = in[i].detID_lo;
     85    out[i].imageID_hi = in[i].imageID_hi;
     86    out[i].imageID_lo = in[i].imageID_lo;
     87  }
     88  return (out);
     89}
    290
    391/* convert panstarrs-format averages to internal averages */
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/photfits.c

    r5241 r12008  
    6161  switch (image[0].order) {
    6262  case 0:
    63     c[0] = image[0].Mcal_PS;
    64     return;
    65   case 1:
    66     c[0] = image[0].Mcal_PS;
     63    c[0] = image[0].Mcal;
     64    return;
     65  case 1:
     66    c[0] = image[0].Mcal;
    6767    c[1] = getMi (image[0].Mx);
    6868    c[2] = getMi (image[0].My);
    6969    return;
    7070  case 2:
    71     c[0] = image[0].Mcal_PS;
     71    c[0] = image[0].Mcal;
    7272    c[1] = getMi (image[0].Mx);
    7373    c[2] = getMi (image[0].Mxx);
     
    7777    return;
    7878  case 3:
    79     c[0] = image[0].Mcal_PS;
     79    c[0] = image[0].Mcal;
    8080    c[1] = getMi (image[0].Mx);
    8181    c[2] = getMi (image[0].Mxx);
     
    8989    return;
    9090  case 4:
    91     c[0] = image[0].Mcal_PS;
     91    c[0] = image[0].Mcal;
    9292    c[1] = getMi (image[0].Mx);
    9393    c[2] = getMi (image[0].Mxx);
     
    117117  switch (order) {
    118118  case 0:
    119     image[0].Mcal_PS = c[0];
    120     return;
    121   case 1:
    122     image[0].Mcal_PS = c[0];
     119    image[0].Mcal = c[0];
     120    return;
     121  case 1:
     122    image[0].Mcal = c[0];
    123123    image[0].Mx    = putMi(c[1]);
    124124    image[0].My    = putMi(c[2]);
    125125    return;
    126126  case 2:
    127     image[0].Mcal_PS = c[0];
     127    image[0].Mcal = c[0];
    128128    image[0].Mx    = putMi(c[1]);
    129129    image[0].Mxx   = putMi(c[2]);
     
    133133    return;
    134134  case 3:
    135     image[0].Mcal_PS = c[0];
     135    image[0].Mcal = c[0];
    136136    image[0].Mx    = putMi(c[1]);
    137137    image[0].Mxx   = putMi(c[2]);
     
    145145    return;
    146146  case 4:
    147     image[0].Mcal_PS = c[0];
     147    image[0].Mcal = c[0];
    148148    image[0].Mx    = putMi(c[1]);
    149149    image[0].Mxx   = putMi(c[2]);
     
    162162    return;
    163163  default:
    164     image[0].Mcal_PS = 0.0;
     164    image[0].Mcal = 0.0;
    165165    image[0].order = 0;
    166166    return;
  • branches/dvo-mods-2007-02/Ohana/src/markstar/src/match_images.c

    r2489 r12008  
    2424    start[j] = image[j].tzero - MAX(0.05*image[j].trate*image[j].NY, 1);
    2525    stop[j]  = image[j].tzero + MAX(1.05*image[j].trate*image[j].NY, 1);
    26     source[j] = image[j].source;
     26    source[j] = image[j].photcode;
    2727  }
    2828
     
    3636      if ((catalog[0].measure[j].t >= start[k]) &&
    3737          (catalog[0].measure[j].t <= stop[k])  &&
    38           (catalog[0].measure[j].source == source[k])) {
     38          (catalog[0].measure[j].photcode == source[k])) {
    3939        catalog[0].image[j] = k;
    4040        found = TRUE;
     
    4343    if (!found) {
    4444      fprintf (stderr, "ERROR: can't find source image for this measurement: %d %d)\n",
    45                catalog[0].measure[j].t, catalog[0].measure[j].source);
     45               catalog[0].measure[j].t, catalog[0].measure[j].photcode);
    4646      exit (0);
    4747    }
  • branches/dvo-mods-2007-02/Ohana/src/mosastro/src/getptolemy.c

    r8515 r12008  
    5050      stars[k].R = catalog.average[j].R;
    5151      stars[k].D = catalog.average[j].D;
    52       stars[k].M = catalog.measure[catalog.average[j].offset].M_PS;
     52      stars[k].M = catalog.measure[catalog.average[j].offset].M;
    5353    }     
    5454    dvo_catalog_free (&catalog);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/calextract.c

    r8455 r12008  
    8383      dM2 = NO_MAG;
    8484      for (j = 0; j < catalog.average[i].Nm; j++) {
    85         if (catalog.measure[m+j].source != code[1][0].code) continue;
     85        if (catalog.measure[m+j].photcode != code[1][0].code) continue;
    8686        M2 = PhotCat  (&catalog.measure[m+j]);
    87         dM2 = catalog.measure[m+j].dM_PS;
     87        dM2 = catalog.measure[m+j].dM;
    8888      }
    8989      if (M2 == NO_MAG) continue;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/calmextract.c

    r8455 r12008  
    9696      dM2 = NO_MAG;
    9797      for (j = 0; j < catalog.average[i].Nm; j++) {
    98         if (catalog.measure[m+j].source != code[1][0].code) continue;
     98        if (catalog.measure[m+j].photcode != code[1][0].code) continue;
    9999        M2 = PhotCat  (&catalog.measure[m+j]);
    100         dM2 = catalog.measure[m+j].dM_PS;
     100        dM2 = catalog.measure[m+j].dM;
    101101      }
    102102      if (M2 == NO_MAG) continue;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/catalog.c

    r8427 r12008  
    197197        dparse (&D, Ad, tbuffer);
    198198        dparse (&M, Am, tbuffer);
    199         catalog.average[nstar].R_PS = R;
    200         catalog.average[nstar].D_PS = D;
    201         catalog.average[nstar].M_PS = M;
     199        catalog.average[nstar].R = R;
     200        catalog.average[nstar].D = D;
     201        catalog.average[nstar].M = M;
    202202        nstar++;
    203203        if (nstar == NSTARS - 1) {
     
    239239          dparse (&D, Ad, &tbuffer[i*Bytes_Star]);
    240240          dparse (&M, Am, &tbuffer[i*Bytes_Star]);
    241           catalog.average[nstar].R_PS = R;
    242           catalog.average[nstar].D_PS = D;
    243           catalog.average[nstar].M_PS = M;
     241          catalog.average[nstar].R = R;
     242          catalog.average[nstar].D = D;
     243          catalog.average[nstar].M = M;
    244244          nstar++;
    245245          if (nstar == NSTARS - 1) {
     
    289289          dparse (&D, 2, &tbuffer[i*BYTES_STAR]);
    290290          dparse (&M, 3, &tbuffer[i*BYTES_STAR]);
    291           catalog.average[nstar].R_PS = R;
    292           catalog.average[nstar].D_PS = D;
    293           catalog.average[nstar].M_PS = M;
     291          catalog.average[nstar].R = R;
     292          catalog.average[nstar].D = D;
     293          catalog.average[nstar].M = M;
    294294          nstar++;
    295295          if (nstar == NSTARS - 1) {
     
    342342        if (IDclip && (catalog.average[i].code != IDchoice))
    343343          continue;
    344         Zvec.elements[N] = MIN (1.0, MAX (0.01, (catalog.average[i].M_PS - Mz) / Mr));
     344        Zvec.elements[N] = MIN (1.0, MAX (0.01, (catalog.average[i].M - Mz) / Mr));
    345345        if (LimExclude && (Zvec.elements[N] > 0.99)) continue;
    346346        if (Zvec.elements[N] < 0.011) continue;
    347         while (catalog.average[i].R_PS < Rmin) catalog.average[i].R_PS += 360.0;
    348         while (catalog.average[i].R_PS > Rmax) catalog.average[i].R_PS -= 360.0;
    349         if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R_PS, catalog.average[i].D_PS, &graphmode.coords)) N ++;
     347        while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
     348        while (catalog.average[i].R > Rmax) catalog.average[i].R -= 360.0;
     349        if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R, catalog.average[i].D, &graphmode.coords)) N ++;
    350350      }
    351351      break;
    352352    case (NUMSCALE):
    353353      for (N = i = 0; i < catalog.Naverage; i++) {
    354         if (clip && ((catalog.average[i].M_PS > Mz) || (catalog.average[i].M_PS < Mr+Mz)))
     354        if (clip && ((catalog.average[i].M > Mz) || (catalog.average[i].M < Mr+Mz)))
    355355          continue;
    356356        if (IDclip && (catalog.average[i].code != IDchoice))
     
    360360        if (Zvec.elements[N] == 0.01)
    361361          continue;
    362         while (catalog.average[i].R_PS < Rmin) catalog.average[i].R_PS += 360.0;
    363         while (catalog.average[i].R_PS > Rmax) catalog.average[i].R_PS -= 360.0;
    364         if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R_PS, catalog.average[i].D_PS, &graphmode.coords)) N++;
     362        while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
     363        while (catalog.average[i].R > Rmax) catalog.average[i].R -= 360.0;
     364        if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R, catalog.average[i].D, &graphmode.coords)) N++;
    365365      }
    366366      break;
    367367    case (MISSCALE):
    368368      for (N = i = 0; i < catalog.Naverage; i++) {
    369         if (clip && ((catalog.average[i].M_PS > Mz) || (catalog.average[i].M_PS < Mr+Mz)))
     369        if (clip && ((catalog.average[i].M > Mz) || (catalog.average[i].M < Mr+Mz)))
    370370          continue;
    371371        if (IDclip && (catalog.average[i].code != IDchoice))
     
    375375        if (Zvec.elements[N] == 0.01)
    376376          continue;
    377         while (catalog.average[i].R_PS < Rmin) catalog.average[i].R_PS += 360.0;
    378         while (catalog.average[i].R_PS > Rmax) catalog.average[i].R_PS -= 360.0;
    379         if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R_PS, catalog.average[i].D_PS, &graphmode.coords)) N++;
     377        while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
     378        while (catalog.average[i].R > Rmax) catalog.average[i].R -= 360.0;
     379        if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R, catalog.average[i].D, &graphmode.coords)) N++;
    380380      }
    381381      break;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/cmatch.c

    r8427 r12008  
    5151      dparse (&D, 2, &tbuffer[i*BYTES_STAR]);
    5252      dparse (&M, 3, &tbuffer[i*BYTES_STAR]);
    53       catalog2.average[nstar].R_PS = R;
    54       catalog2.average[nstar].D_PS = D;
     53      catalog2.average[nstar].R = R;
     54      catalog2.average[nstar].D = D;
    5555      catalog2.average[nstar].M = M * 1000.0;
    5656      nstar++;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/dmt.c

    r8455 r12008  
    8282      if (catalog.average[i].Nm != 3) continue;
    8383      m = catalog.average[i].offset;
    84       M0 = (Ns == -1) ? catalog.average[i].M : catalog.secfilt[i*Nsec+Ns].M_PS;
     84      M0 = (Ns == -1) ? catalog.average[i].M : catalog.secfilt[i*Nsec+Ns].M;
    8585      M1 = PhotCat (&catalog.measure[m+0]);
    8686      M2 = PhotCat (&catalog.measure[m+1]);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/extract.c

    r7917 r12008  
    341341          Ncode = 0;
    342342          for (k = 0; k < catalog.average[i].Nm; k++, m++) {
    343             if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].source)) continue;
     343            if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].photcode)) continue;
    344344            Ncode ++;
    345345          }
     
    357357          Ncode = 0;
    358358          for (k = 0; k < catalog.average[i].Nm; k++, m++) {
    359             if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].source)) continue;
    360             if (catalog.measure[m].source & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue;
     359            if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].photcode)) continue;
     360            if (catalog.measure[m].photcode & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue;
    361361            Ncode ++;
    362362          }
     
    407407          vec[0].elements[N] = -32;
    408408          for (k = 0; k < catalog.average[i].Nm; k++) {
    409             if (catalog.measure[m+k].source == N1) {
     409            if (catalog.measure[m+k].photcode == N1) {
    410410              vec[0].elements[N] = PhotCat (&catalog.measure[m+k]);
    411411              k = catalog.average[i].Nm;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/fitsed.c

    r8455 r12008  
    203203      m = catalog.average[i].offset;
    204204      for (j = 0; j < catalog.average[i].Nm; j++) {
    205         idx = hashcode[catalog.measure[m+j].source];
     205        idx = hashcode[catalog.measure[m+j].photcode];
    206206        if (idx == -1) continue;
    207207        // XXX do something more clever if more than one value exists per photcode
    208         sourceValue.mags[idx] = catalog.measure[m+j].M_PS + vegaToAB[idx];
    209         sourceError.mags[idx] = catalog.measure[m+j].dM_PS;
    210         if ((catalog.measure[m+j].source == USNOred) || (catalog.measure[m+j].source == USNOblu)) {
     208        sourceValue.mags[idx] = catalog.measure[m+j].M + vegaToAB[idx];
     209        sourceError.mags[idx] = catalog.measure[m+j].dM;
     210        if ((catalog.measure[m+j].photcode == USNOred) || (catalog.measure[m+j].photcode == USNOblu)) {
    211211          sourceError.mags[idx] = 0.3;
    212212        }
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/gimages.c

    r7917 r12008  
    8181    if (PhotCodeSelect) {
    8282      if ((code[0].type == PHOT_REF) || (code[0].type == PHOT_DEP)) {
    83         if (code[0].code != image[i].source) continue;
     83        if (code[0].code != image[i].photcode) continue;
    8484      }
    8585      if ((code[0].type == PHOT_PRI) || (code[0].type == PHOT_SEC)) {
    86         if (code[0].code != GetPhotcodeEquivCodebyCode (image[i].source)) continue;
     86        if (code[0].code != GetPhotcodeEquivCodebyCode (image[i].photcode)) continue;
    8787      }
    8888    }     
     
    104104    if (PixelCoords) {
    105105      gprint (GP_LOG, "%3d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n",
    106                Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].source, image[i].secz_PS, image[i].Mcal_PS, image[i].dMcal_PS, image[i].exptime, image[i].code);
     106               Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].code);
    107107    } else {
    108108      XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
    109109      gprint (GP_LOG, "%3d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n",
    110                Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].source, image[i].secz_PS, image[i].Mcal_PS, image[i].dMcal_PS, image[i].exptime, image[i].code);
     110               Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].code);
    111111    }
    112112    sprintf (name, "IMAGEx:%d", Nfound);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/gstar.c

    r8455 r12008  
    170170            date = sec_to_date (catalog.measure[m].t);
    171171            gprint (GP_LOG, "%6.3f %6.3f %5.3f  %20s  %5.2f %5.2f %2d %3x %3d %-20s\n",
    172                      Mcat, Mrel, catalog.measure[m].dM_PS,
    173                      date, catalog.measure[m].dR_PS, catalog.measure[m].dD_PS,
     172                     Mcat, Mrel, catalog.measure[m].dM,
     173                     date, catalog.measure[m].dR, catalog.measure[m].dD,
    174174                     catalog.measure[m].dophot, catalog.measure[m].flags,
    175                      catalog.measure[m].source, GetPhotcodeNamebyCode (catalog.measure[m].source));
     175                     catalog.measure[m].photcode, GetPhotcodeNamebyCode (catalog.measure[m].photcode));
    176176            free (date);
    177177          }
     
    180180            vec1[0].elements[N] = Mcat;
    181181            vec2[0].elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat);
    182             vec3[0].elements[N] = catalog.measure[m].airmass_PS;
    183             vec4[0].elements[N] = catalog.measure[m].source;
     182            vec3[0].elements[N] = catalog.measure[m].airmass;
     183            vec4[0].elements[N] = catalog.measure[m].photcode;
    184184            N ++;
    185185            if (N == NPTS - 1) {
     
    261261        print_value (average[0].M, average[0].M);
    262262      } else {
    263         print_value (secfilt[seq].M_PS, secfilt[seq].M_PS);
     263        print_value (secfilt[seq].M, secfilt[seq].M);
    264264      }
    265265      break;
     
    269269        print_value (average[0].dM, average[0].dM);
    270270      } else {
    271         print_value (secfilt[seq].dM_PS, secfilt[seq].dM_PS);
     271        print_value (secfilt[seq].dM, secfilt[seq].dM);
    272272      }
    273273      break;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/imdata.c

    r8455 r12008  
    137137          if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
    138138          n = catalog.measure[i].averef;
    139           vec[0].elements[N] = catalog.average[n].R - catalog.measure[i].dR_PS / 3600.0;
     139          vec[0].elements[N] = catalog.average[n].R - catalog.measure[i].dR / 3600.0;
    140140          N++;
    141141          CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
     
    146146          if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
    147147          n = catalog.measure[i].averef;
    148           vec[0].elements[N] = catalog.average[n].D - catalog.measure[i].dD_PS / 3600.0;
     148          vec[0].elements[N] = catalog.average[n].D - catalog.measure[i].dD / 3600.0;
    149149          N++;
    150150          CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
     
    154154        for (i = 0; i < catalog.Nmeasure; i++) {
    155155          if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
    156           vec[0].elements[N] = catalog.measure[i].M_PS;
     156          vec[0].elements[N] = catalog.measure[i].M;
    157157          N++;
    158158          CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
     
    162162        for (i = 0; i < catalog.Nmeasure; i++) {
    163163          if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
    164           vec[0].elements[N] = catalog.measure[i].dM_PS;
     164          vec[0].elements[N] = catalog.measure[i].dM;
    165165          N++;
    166166          CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
     
    170170        for (i = 0; i < catalog.Nmeasure; i++) {
    171171          if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
    172           vec[0].elements[N] = catalog.measure[i].Mcal_PS;
     172          vec[0].elements[N] = catalog.measure[i].Mcal;
    173173          N++;
    174174          CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
     
    186186        for (i = 0; i < catalog.Nmeasure; i++) {
    187187          if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
    188           vec[0].elements[N] = catalog.measure[i].source;
     188          vec[0].elements[N] = catalog.measure[i].photcode;
    189189          N++;
    190190          CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/imextract.c

    r7917 r12008  
    114114    if (PhotcodeSelect) {
    115115      if (code[0].type == PHOT_DEP) {
    116         if (code[0].code != image[j].source) continue;
     116        if (code[0].code != image[j].photcode) continue;
    117117      } else {
    118         if (code[0].code != GetPhotcodeEquivCodebyCode (image[j].source)) continue;
     118        if (code[0].code != GetPhotcodeEquivCodebyCode (image[j].photcode)) continue;
    119119      }
    120120    }
     
    139139      break;
    140140    case (AIRMASS):
    141       vec[0].elements[N] = image[j].secz_PS;
     141      vec[0].elements[N] = image[j].secz;
    142142      break;
    143143    case (MCAL):
    144       vec[0].elements[N] = image[j].Mcal_PS;
     144      vec[0].elements[N] = image[j].Mcal;
    145145      break;
    146146    case (dMCAL):
    147       vec[0].elements[N] = image[j].dMcal_PS;
     147      vec[0].elements[N] = image[j].dMcal;
    148148      break;
    149149    case (PHOTCODE):
    150       vec[0].elements[N] = image[j].source;
     150      vec[0].elements[N] = image[j].photcode;
    151151      break;
    152152    case (TIME):
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/imlist.c

    r10929 r12008  
    7777    if (PhotcodeSelect) {
    7878      if (PhotcodeValue[0].type == PHOT_DEP) {
    79         if (PhotcodeValue[0].code != image[i].source) continue;
     79        if (PhotcodeValue[0].code != image[i].photcode) continue;
    8080      } else {
    81         if (PhotcodeValue[0].code != GetPhotcodeEquivCodebyCode (image[i].source)) continue;
     81        if (PhotcodeValue[0].code != GetPhotcodeEquivCodebyCode (image[i].photcode)) continue;
    8282      }
    8383    }
     
    9090    }
    9191    gprint (GP_LOG, "%3d %s %8.4f %8.4f %f %5d %2d %4.2f %5.3f %5.3f\n",
    92              i, image[i].name, r, d, t, image[i].nstar, image[i].source, image[i].secz_PS, image[i].Mcal_PS, image[i].dMcal_PS);
     92             i, image[i].name, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal);
    9393  }
    9494
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/imphot.c

    r9362 r12008  
    6565    switch (image[i].order) {
    6666    case 0:
    67       gprint (GP_ERR, "%s: %d - %f\n", image[i].name, image[i].order, image[i].Mcal_PS);
     67      gprint (GP_ERR, "%s: %d - %f\n", image[i].name, image[i].order, image[i].Mcal);
    6868      break;
    6969    case 1:
    70       gprint (GP_ERR, "%s: %d - %f, %d %d\n", image[i].name, image[i].order, image[i].Mcal_PS, image[i].Mx, image[i].My);
     70      gprint (GP_ERR, "%s: %d - %f, %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My);
    7171      break;
    7272    case 2:
    73       gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d\n", image[i].name, image[i].order, image[i].Mcal_PS, image[i].Mx, image[i].My, image[i].Mxx, image[i].Mxy, image[i].Myy);
     73      gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My, image[i].Mxx, image[i].Mxy, image[i].Myy);
    7474      break;
    7575    case 3:
    76       gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal_PS, image[i].Mx, image[i].My,
     76      gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My,
    7777               image[i].Mxx, image[i].Mxy, image[i].Myy, image[i].Mxxx, image[i].Mxxy, image[i].Mxyy, image[i].Myyy);
    7878      break;
    7979    case 4:
    80       gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d, %d %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal_PS, image[i].Mx, image[i].My,
     80      gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d, %d %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My,
    8181               image[i].Mxx, image[i].Mxy, image[i].Myy, image[i].Mxxx, image[i].Mxxy, image[i].Mxyy, image[i].Myyy,
    8282               image[i].Mxxxx, image[i].Mxxxy, image[i].Mxxyy, image[i].Mxyyy, image[i].Myyyy);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/imstats.c

    r7917 r12008  
    4545  gprint (GP_LOG, "seq  ra (J2000) dec    time (s)   Nstars\n");
    4646  for (i = 0; i < Nimage; i++) {
    47     Xvec.elements[i] = image[i].secz_PS;
     47    Xvec.elements[i] = image[i].secz;
    4848    if (Mcal)
    49       Yvec.elements[i] = image[i].Mcal_PS;
     49      Yvec.elements[i] = image[i].Mcal;
    5050    else
    51       Yvec.elements[i] = image[i].dMcal_PS;
     51      Yvec.elements[i] = image[i].dMcal;
    5252    if (!FindMosaicForImage (image, Nimage, i)) continue;
    5353    XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
    5454    gprint (GP_ERR, "%d %8.4f %8.4f %10d %6d  %5.3f %6.3f %6.3f\n",
    5555             i, r, d, image[i].tzero, image[i].nstar, Xvec.elements[i],
    56              image[i].Mcal_PS, image[i].dMcal_PS);
     56             image[i].Mcal, image[i].dMcal);
    5757  }
    5858  if (AutoLimits) SetLimits (&Xvec, &Yvec, &graphmode);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/lcurve.c

    r8455 r12008  
    130130      m = catalog.average[N1[i]].offset;
    131131      for (j = 0; j < catalog.average[N1[i]].Nm; j++, m++) {
    132         if (ErrorBars) dYvec.elements[N] = catalog.measure[m].dM_PS;
     132        if (ErrorBars) dYvec.elements[N] = catalog.measure[m].dM;
    133133        Xvec.elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat);
    134134        Yvec.elements[N] = PhotCat (&catalog.measure[m]);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/lightcurve.c

    r8455 r12008  
    110110        if (PhotCodeSelect) {
    111111          if ((code[0].type == PHOT_REF) || (code[0].type == PHOT_DEP)) {
    112             if (code[0].code != catalog.measure[m].source) continue;
     112            if (code[0].code != catalog.measure[m].photcode) continue;
    113113          }
    114114          if ((code[0].type == PHOT_PRI) || (code[0].type == PHOT_SEC)) {
    115             if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].source)) continue;
     115            if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].photcode)) continue;
    116116          }
    117117        }     
    118118
    119119        tvec[0].elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat);
    120         dmvec[0].elements[N] = catalog.measure[m].dM_PS;
     120        dmvec[0].elements[N] = catalog.measure[m].dM;
    121121        if (RELPHOT) {
    122122          mvec[0].elements[N] = PhotCat (&catalog.measure[m]);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/match_image.c

    r7680 r12008  
    3030
    3131  for (N = N1; N < N2; N++) {
    32     if ((image[N].tzero == T) && (image[N].source == S)) {
     32    if ((image[N].tzero == T) && (image[N].photcode == S)) {
    3333      return (N);
    3434    }
     
    6666
    6767  for (N = N1; N < N2; N++) {
    68     if ((image[subset[N]].tzero == T) && (image[subset[N]].source == S)) {
     68    if ((image[subset[N]].tzero == T) && (image[subset[N]].photcode == S)) {
    6969      return (subset[N]);
    7070    }
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/mextract.c

    r8455 r12008  
    6666    dvo_catalog_unlock (&catalog);
    6767
     68    /* XXX need to call dvo_catalog_chipcoords here passing the loaded images */
     69
    6870    for (j = 0; j < catalog.Naverage; j++) {
    6971      M1 = NULL;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/paverage.c

    r10793 r12008  
    116116      while (average[i].R > Rmax) average[i].R -= 360.0;
    117117
    118       mag = (Nsec == -1) ? average[i].M : secfilt[i*Nsecfilt+Nsec].M_PS;
     118      mag = (Nsec == -1) ? average[i].M : secfilt[i*Nsecfilt+Nsec].M;
    119119      Zvec[Npts] = MIN (1.0, MAX (0.01, (mag - Mz) / Mr));
    120120      if (LimExclude && (Zvec[Npts] > 0.99)) continue;
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/photometry.c

    r8427 r12008  
    77    case PHOT_DEP: \
    88    case PHOT_REF: \
    9       if (C[0].code != M.source) continue; \
     9      if (C[0].code != M.photcode) continue; \
    1010      break; \
    1111    case PHOT_PRI: \
    1212    case PHOT_SEC: \
    13       if (C[0].code != GetPhotcodeEquivCodebyCode (M.source)) continue; \
     13      if (C[0].code != GetPhotcodeEquivCodebyCode (M.photcode)) continue; \
    1414      break; \
    1515    default: \
     
    2222    if (TimeSelect && (M.t < tzero)) continue; \
    2323    if (TimeSelect && (M.t > tend)) continue; \
    24     if (ErrSelect  && (M.dM_PS > ErrValue)) continue; \
     24    if (ErrSelect  && (M.dM > ErrValue)) continue; \
    2525    if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \
    2626    if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \
     
    3434  if (MODE == MAG_SYS)  MOUT = PhotSys  (&MEAS, average, secfilt); \
    3535  if (MODE == MAG_REL)  MOUT = PhotRel  (&MEAS, average, secfilt); \
    36   if (MODE == MAG_CAL)  MOUT = PhotCal  (&MEAS, average, secfilt, measure, GetPhotcodeEquivbyCode (MEAS.source)); \
    37   if (MODE == MAG_AVE)  MOUT = PhotAve  (GetPhotcodeEquivbyCode (MEAS.source), average, secfilt); \
    38   if (MODE == MAG_REF)  MOUT = PhotRef  (GetPhotcodeEquivbyCode (MEAS.source), average, secfilt, measure); \
     36  if (MODE == MAG_CAL)  MOUT = PhotCal  (&MEAS, average, secfilt, measure, GetPhotcodeEquivbyCode (MEAS.photcode)); \
     37  if (MODE == MAG_AVE)  MOUT = PhotAve  (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt); \
     38  if (MODE == MAG_REF)  MOUT = PhotRef  (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt, measure); \
    3939  if (ApplySelections[SelectionParam]) { \
    4040    if (MagSelect && (MOUT > MagMax)) continue; \
     
    676676      value = 0;
    677677      for (i = 0; i < average[0].Nm; i++) {
    678         if (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].source)) continue;
     678        if (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode)) continue;
    679679        value ++;
    680680      }
     
    683683      value = 0;
    684684      for (i = 0; i < average[0].Nm; i++) {
    685         if (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].source)) continue;
     685        if (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode)) continue;
    686686        if (measure[i].flags & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue;
    687687        value ++;
     
    691691      value = 0;
    692692      for (i = 0; i < average[0].Nm; i++) {
    693         if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].source))) continue;
    694         if (ErrSelect && (measure[i].dM_PS > ErrValue)) continue;
     693        if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode))) continue;
     694        if (ErrSelect && (measure[i].dM > ErrValue)) continue;
    695695        if (FlagSelect && (measure[i].flags != FlagValue)) continue;
    696696        if (TypeSelect && (TypeValue != GetMeasureTypeCode (&measure[i]))) continue;
     
    711711  Nt = Nc = 0;
    712712  for (k = 0; k < average[0].Nm; k++) {
    713     if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[k].source))) continue;
     713    if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[k].photcode))) continue;
    714714    Nc ++;
    715715    if (measure[k].dophot != TypefracType) continue;
     
    727727  Nt[0] = Nt[1] = Nt[2] = 0;
    728728  for (k = 0; k < average[0].Nm; k++) {
    729     if (code != GetPhotcodeEquivCodebyCode (measure[k].source)) continue;
     729    if (code != GetPhotcodeEquivCodebyCode (measure[k].photcode)) continue;
    730730    N = GetMeasureTypeCode (&measure[k]);
    731731    Nt[N] ++;
     
    11281128      break;
    11291129    case MEAS_RA: /* OK */
    1130       value = average[0].R - measure[0].dR_PS / 3600.0;
     1130      value = average[0].R - measure[0].dR / 3600.0;
    11311131      break;
    11321132    case MEAS_DEC: /* OK */
    1133       value = average[0].D - measure[0].dD_PS / 3600.0;
     1133      value = average[0].D - measure[0].dD / 3600.0;
    11341134      break;
    11351135    case MEAS_dMAG: /* OK */
    1136       value = measure[0].dM_PS;
     1136      value = measure[0].dM;
    11371137      break;
    11381138    case MEAS_AIRMASS: /* OK */
    1139       value = measure[0].airmass_PS;
     1139      value = measure[0].airmass;
    11401140      break;
    11411141    case MEAS_EXPTIME: /* OK */
    1142       value = pow (10.0, measure[0].dt_PS * 0.4);
     1142      value = pow (10.0, measure[0].dt * 0.4);
    11431143      break;
    11441144    case MEAS_PHOTCODE: /* OK */
    1145       value = measure[0].source;
     1145      value = measure[0].photcode;
    11461146      break;
    11471147    case MEAS_TIME: /* OK */
     
    11491149      break;
    11501150    case MEAS_dR: /* OK */
    1151       value = measure[0].dR_PS;
     1151      value = measure[0].dR;
    11521152      break;
    11531153    case MEAS_dD: /* OK */
    1154       value = measure[0].dD_PS;
     1154      value = measure[0].dD;
    11551155      break;
    11561156    case MEAS_FWHM: /* OK */
     
    11641164      break;
    11651165    case MEAS_XCCD: /* OK */
    1166       ra  = average[0].R - measure[0].dR_PS / 3600.0;
    1167       dec = average[0].D - measure[0].dD_PS / 3600.0;
    1168       image = MatchImage (measure[0].t, measure[0].source);
     1166/* I need to perform this conversion for ELIXIR and LONEOS formats on load */     
     1167# if 0
     1168      value = measure[0].Xccd;
     1169# else
     1170      ra  = average[0].R - measure[0].dR / 3600.0;
     1171      dec = average[0].D - measure[0].dD / 3600.0;
     1172      image = MatchImage (measure[0].t, measure[0].photcode);
    11691173      if (image == NULL) break;
    11701174      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
    11711175      value = x;
     1176# endif
    11721177      break;
    11731178    case MEAS_YCCD: /* OK */
    1174       ra  = average[0].R - measure[0].dR_PS / 3600.0;
    1175       dec = average[0].D - measure[0].dD_PS / 3600.0;
    1176       image = MatchImage (measure[0].t, measure[0].source);
     1179/* I need to perform this conversion for ELIXIR and LONEOS formats on load */     
     1180# if 0
     1181      value = measure[0].Yccd;
     1182# else
     1183      ra  = average[0].R - measure[0].dR / 3600.0;
     1184      dec = average[0].D - measure[0].dD / 3600.0;
     1185      image = MatchImage (measure[0].t, measure[0].photcode);
    11771186      if (image == NULL) break;
    11781187      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
    11791188      value = y;
     1189# endif
    11801190      break;
    11811191    case MEAS_XMOSAIC: /* OK */
    1182       ra  = average[0].R - measure[0].dR_PS / 3600.0;
    1183       dec = average[0].D - measure[0].dD_PS / 3600.0;
    1184       mosaic = MatchMosaic (measure[0].t, measure[0].source);
     1192      ra  = average[0].R - measure[0].dR / 3600.0;
     1193      dec = average[0].D - measure[0].dD / 3600.0;
     1194      mosaic = MatchMosaic (measure[0].t, measure[0].photcode);
    11851195      if (mosaic == NULL) break;
    11861196      RD_to_XY (&x, &y, ra, dec, mosaic);
     
    11881198      break;
    11891199    case MEAS_YMOSAIC: /* OK */
    1190       ra  = average[0].R - measure[0].dR_PS / 3600.0;
    1191       dec = average[0].D - measure[0].dD_PS / 3600.0;
    1192       mosaic = MatchMosaic (measure[0].t, measure[0].source);
     1200      ra  = average[0].R - measure[0].dR / 3600.0;
     1201      dec = average[0].D - measure[0].dD / 3600.0;
     1202      mosaic = MatchMosaic (measure[0].t, measure[0].photcode);
    11931203      if (mosaic == NULL) break;
    11941204      RD_to_XY (&x, &y, ra, dec, mosaic);
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/pmeasure.c

    r10794 r12008  
    116116          if (!(flags & FlagChoice)) continue;
    117117        }
    118         if ((PhotcodeClip != -1) && (catalog.measure[m+k].source != PhotcodeClip)) continue;
     118        if ((PhotcodeClip != -1) && (catalog.measure[m+k].photcode != PhotcodeClip)) continue;
    119119        mag = PhotCat (&catalog.measure[m+k]);
    120120        Zvec[Npts] = MIN (1.0, MAX (0.01, (mag - Mz) / Mr));
    121121        if (LimExclude && (Zvec[Npts] > 0.99)) continue;
    122122        if (Zvec[Npts] < 0.011) continue;
    123         R = catalog.average[i].R - catalog.measure[m+k].dR_PS/3600.0;
    124         D = catalog.average[i].D - catalog.measure[m+k].dD_PS/3600.0;
     123        R = catalog.average[i].R - catalog.measure[m+k].dR/3600.0;
     124        D = catalog.average[i].D - catalog.measure[m+k].dD/3600.0;
    125125        // XXX drop this check
    126126        if ((R < Rmin) || (R > Rmax) || (D < -90.0) || (D > 90.0)) {
    127127          char *date;
    128128          date = sec_to_date (catalog.measure[m+k].t);
    129           gprint (GP_LOG, "out: %f, %f : %s : (%f, %f) + (%f, %f)\n", R, D, date, catalog.average[i].R, catalog.average[i].D, catalog.measure[m+k].dR_PS/3600.0, catalog.measure[m+k].dD_PS/3600.0);
     129          gprint (GP_LOG, "out: %f, %f : %s : (%f, %f) + (%f, %f)\n", R, D, date, catalog.average[i].R, catalog.average[i].D, catalog.measure[m+k].dR/3600.0, catalog.measure[m+k].dD/3600.0);
    130130          free (date);
    131131        }
  • branches/dvo-mods-2007-02/Ohana/src/opihi/dvo/subpix.c

    r8455 r12008  
    143143        RD_to_XY (&X, &Y, Ra, Dec, &image[I].coords);
    144144        t = TimeValue (measure[j].t, TimeReference, TimeFormat);
    145         gprint (GP_LOG, "%f %6.3f %7.2f %7.2f %5.3f\n", t, Mabs, X, Y, image[I].secz_PS);
     145        gprint (GP_LOG, "%f %6.3f %7.2f %7.2f %5.3f\n", t, Mabs, X, Y, image[I].secz);
    146146      }
    147147    }
  • branches/dvo-mods-2007-02/Ohana/src/photdbc/src/find_images.c

    r7080 r12008  
    3838# if (0)
    3939    /* select images by photcode */
    40     ecode = GetPhotcodeEquivCodebyCode (timage[i].source);
     40    ecode = GetPhotcodeEquivCodebyCode (timage[i].photcode);
    4141    if (ecode != photcode[0].code) continue;
    4242
  • branches/dvo-mods-2007-02/Ohana/src/photdbc/src/flag_measures.c

    r7080 r12008  
    2828    n = catalog[0].measure[i].averef;
    2929    Time = catalog[0].measure[i].t;
    30     Photcode = catalog[0].measure[i].source;
     30    Photcode = catalog[0].measure[i].photcode;
    3131    found = FALSE;
    3232    for (k = 0; !found && (k < Nimage); k++) {
    33       if ((Time == image[k].tzero) && (Photcode == image[k].source)) {
     33      if ((Time == image[k].tzero) && (Photcode == image[k].photcode)) {
    3434        imagelink[i] = k;
    3535        found = TRUE;
     
    4444  for (i = 0; i < catalog[0].Nmeasure; i++) {
    4545    n = catalog[0].measure[i].averef;
    46     ra  = catalog[0].average[n].R_PS - catalog[0].measure[i].dR_PS / 3600.0;
    47     dec = catalog[0].average[n].D_PS - catalog[0].measure[i].dD_PS / 3600.0;
     46    ra  = catalog[0].average[n].R - catalog[0].measure[i].dR / 3600.0;
     47    dec = catalog[0].average[n].D - catalog[0].measure[i].dD / 3600.0;
    4848    k = imagelink[i];
    4949    RD_to_XY (&x, &y, ra, dec, &image[k].coords);
     
    9898      m = catalog[0].average[i].offset;
    9999      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    100         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     100        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    101101        if (photcodes.code[Ncode].equiv != Photcode) continue;
    102102        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
     
    115115      m = catalog[0].average[i].offset;
    116116      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    117         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     117        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    118118        if (photcodes.code[Ncode].equiv != Photcode) continue;
    119119        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
     
    130130      m = catalog[0].average[i].offset;
    131131      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    132         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     132        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    133133        if (photcodes.code[Ncode].equiv != Photcode) continue;
    134134        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
     
    145145      m = catalog[0].average[i].offset;
    146146      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    147         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     147        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    148148        if (photcodes.code[Ncode].equiv != Photcode) continue;
    149149        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
     
    159159      m = catalog[0].average[i].offset;
    160160      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    161         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     161        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    162162        if (photcodes.code[Ncode].equiv != Photcode) continue;
    163163        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
     
    172172      m = catalog[0].average[i].offset;
    173173      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    174         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     174        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    175175        if (photcodes.code[Ncode].equiv != Photcode) continue;
    176176        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
     
    182182      m = catalog[0].average[i].offset;
    183183      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    184         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     184        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    185185        if (photcodes.code[Ncode].equiv != Photcode) continue;
    186186        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
  • branches/dvo-mods-2007-02/Ohana/src/photdbc/src/get_mags.c

    r11903 r12008  
    4444      m = catalog[0].average[i].offset;
    4545      for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    46         if ((Ncode = photcodes.hashcode[catalog[0].measure[m].source]) < 0) continue;
     46        if ((Ncode = photcodes.hashcode[catalog[0].measure[m].photcode]) < 0) continue;
    4747        if (photcodes.code[Ncode].equiv != Photcode) continue;
    4848        if (photcodes.code[Ncode].type != PHOT_DEP) continue;
  • branches/dvo-mods-2007-02/Ohana/src/photdbc/src/join_stars.c

    r4808 r12008  
    2828  Rmid = Dmid = 0;
    2929  for (i = 0; i < Naverage; i++) {
    30     Rmid += average[i].R_PS;
    31     Dmid += average[i].D_PS;
     30    Rmid += average[i].R;
     31    Dmid += average[i].D;
    3232  }
    3333  Rmid /= Naverage;
     
    5050  for (i = 0; i < Naverage; i++) {
    5151    index[i] = i;
    52     fRD_to_XY (&X[i], &Y[i], average[i].R_PS, average[i].D_PS, &tcoords);
     52    fRD_to_XY (&X[i], &Y[i], average[i].R, average[i].D, &tcoords);
    5353  }
    5454  sort_lists (X, Y, index, Naverage);
     
    7777        mpointer[Nmeas].measure = m;
    7878        mpointer[Nmeas].averef  = Naves;
    79         mpointer[Nmeas].R       = average[Ni].R_PS - measure[m].dR_PS / 3600.0;
    80         mpointer[Nmeas].D       = average[Ni].D_PS - measure[m].dD_PS / 3600.0;
     79        mpointer[Nmeas].R       = average[Ni].R - measure[m].dR / 3600.0;
     80        mpointer[Nmeas].D       = average[Ni].D - measure[m].dD / 3600.0;
    8181        Nmeas ++;
    8282      }
     
    113113          mpointer[Nmeas].measure = m;
    114114          mpointer[Nmeas].averef  = Ncurr;
    115           mpointer[Nmeas].R       = average[Nj].R_PS - measure[m].dR_PS / 3600.0;
    116           mpointer[Nmeas].D       = average[Nj].D_PS - measure[m].dD_PS / 3600.0;
     115          mpointer[Nmeas].R       = average[Nj].R - measure[m].dR / 3600.0;
     116          mpointer[Nmeas].D       = average[Nj].D - measure[m].dD / 3600.0;
    117117          Nmeas ++;
    118118        }
     
    130130        Sr = Sr / naverage[Ncurr].Nm;
    131131        Sd = Sd / naverage[Ncurr].Nm;
    132         naverage[Ncurr].R_PS = Sr;
    133         naverage[Ncurr].D_PS = Sd;
     132        naverage[Ncurr].R = Sr;
     133        naverage[Ncurr].D = Sd;
    134134
    135135        /* update original measurement offsets */
     
    137137          m = naverage[Ncurr].offset + k;
    138138          M = mpointer[m].measure;
    139           measure[M].dR_PS = 3600.0*(Sr - mpointer[m].R);
    140           measure[M].dD_PS = 3600.0*(Sd - mpointer[m].D);
     139          measure[M].dR = 3600.0*(Sr - mpointer[m].R);
     140          measure[M].dD = 3600.0*(Sd - mpointer[m].D);
    141141        }
    142142
  • branches/dvo-mods-2007-02/Ohana/src/photdbc/src/make_subcatalog.c

    r8630 r12008  
    4040      # if 0
    4141      if (DropPhotcode) {
    42         ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset].source);
     42        ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset].photcode);
    4343        if (ecode == photcode[0].code) continue;
    4444      }
     
    4747
    4848      /* exclude measurements by measurement error */
    49       if (SIGMA_MAX && (catalog[0].measure[offset].dM_PS > SIGMA_MAX)) continue;
     49      if (SIGMA_MAX && (catalog[0].measure[offset].dM > SIGMA_MAX)) continue;
    5050
    5151      /* select measurements by mag limit */
  • branches/dvo-mods-2007-02/Ohana/src/photdbc/src/unique_measures.c

    r8630 r12008  
    6060      }
    6161     
    62       dR = (catalog[0].measure[ilist[j]].dR_PS - catalog[0].measure[ilist[k]].dR_PS);
    63       dD = (catalog[0].measure[ilist[j]].dD_PS - catalog[0].measure[ilist[k]].dD_PS);
     62      dR = (catalog[0].measure[ilist[j]].dR - catalog[0].measure[ilist[k]].dR);
     63      dD = (catalog[0].measure[ilist[j]].dD - catalog[0].measure[ilist[k]].dD);
    6464      R = SQ(dR) + SQ(dD);
    6565     
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/GridOps.v1.c

    r7080 r12008  
    331331  for (i = 0; i < Nimage; i++) {
    332332    image = getimage (imlist[i]);
    333     pname = GetPhotcodeNamebyCode (image[0].source);
     333    pname = GetPhotcodeNamebyCode (image[0].photcode);
    334334
    335335    /* this is kind of bogus... */
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/GridOps.v2.c

    r7080 r12008  
    278278      Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);
    279279      list[N] = Msys - Mrel - Mcal - Mmos;
    280       dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR);
     280      dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR);
    281281      N++;
    282282    }
     
    439439  for (i = 0; i < Nimage; i++) {
    440440    image = getimage (imlist[i]);
    441     pname = GetPhotcodeNamebyCode (image[0].source);
     441    pname = GetPhotcodeNamebyCode (image[0].photcode);
    442442
    443443    /* this is kind of bogus... */
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/ImageOps.c

    r6808 r12008  
    7575  for (i = 0; i < Ncatalog; i++) {
    7676    for (j = 0; j < catalog[i].Nmeasure; j++) {
    77       ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].source);
     77      ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].photcode);
    7878      if (photcode[0].code != ecode) continue;
    7979      matchImage (catalog, j, i);
     
    9191  measure = &catalog[cat].measure[meas];
    9292  for (i = 0; i < Nimage; i++) {
    93     if (image[0].source == -1) continue;
    94     if (measure[0].source != image[i].source) continue;
     93    if (image[0].photcode == -1) continue;
     94    if (measure[0].photcode != image[i].photcode) continue;
    9595    if (measure[0].t < start[i]) continue;
    9696    if (measure[0].t > stop[i]) continue;
     
    100100
    101101      /* identify the ccd on the basis of the photcode name */
    102       pname = GetPhotcodeNamebyCode (image[i].source);
     102      pname = GetPhotcodeNamebyCode (image[i].photcode);
    103103      filter = photcode[0].name;
    104104      sprintf (base, "%s.%s.", MOSAICNAME, filter);
     
    111111      /* add this measurement to the grid cell for this chip */
    112112      ave = measure[0].averef;
    113       ra  = catalog[cat].average[ave].R - measure[0].dR_PS / 3600.0;
    114       dec = catalog[cat].average[ave].D - measure[0].dD_PS / 3600.0;
     113      ra  = catalog[cat].average[ave].R - measure[0].dR / 3600.0;
     114      dec = catalog[cat].average[ave].D - measure[0].dD / 3600.0;
    115115       
    116116      /* X,Y always positive-definite in range 0,0 - dX, dY */
     
    133133    return;
    134134  }
    135   /*  fprintf (stderr, "can't find source image for this measurement: %d (%d)\n", measure[0].t, measure[0].source); */
     135  /*  fprintf (stderr, "can't find source image for this measurement: %d (%d)\n", measure[0].t, measure[0].photcode); */
    136136}
    137137
     
    145145
    146146  if (image[i].code & IMAGE_BAD)  return (NO_MAG); 
    147   value = image[i].Mcal_PS;
     147  value = image[i].Mcal;
    148148  return (value);
    149149}
     
    201201      Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);
    202202      list[N] = Msys - Mrel - Mmos - Mgrid;
    203       dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR);
     203      dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR);
    204204      N++;
    205205    }
     
    217217   
    218218    liststats (list, dlist, N, &stats);
    219     image[i].Mcal_PS  = stats.mean;
    220     image[i].dMcal_PS = stats.sigma;
     219    image[i].Mcal  = stats.mean;
     220    image[i].dMcal = stats.sigma;
    221221    image[i].Xm    = 100.0*log10(stats.chisq);
    222222  }
     
    249249  for (i = N = 0; i < Nimage; i++) {
    250250    if (image[i].code & IMAGE_BAD) continue;
    251     mlist[N] = fabs (image[i].Mcal_PS);
    252     slist[N] = image[i].dMcal_PS;
     251    mlist[N] = fabs (image[i].Mcal);
     252    slist[N] = image[i].dMcal;
    253253    dlist[N] = 1;
    254254    N++;
     
    266266    mark = FALSE;
    267267    image[i].code &= ~ID_IMAGE_POOR;
    268     mark = (image[i].dMcal_PS > MaxScatter) || (fabs(image[i].Mcal_PS - MedOffset) > MaxOffset);
     268    mark = (image[i].dMcal > MaxScatter) || (fabs(image[i].Mcal - MedOffset) > MaxOffset);
    269269    if (mark) {
    270270      Nmark ++;
     
    296296  /**** dMcal vs airmass ****/
    297297  for (i = 0; i < Nimage; i++) {
    298     Mlist[i] = image[i].Mcal_PS;
    299     dlist[i] = image[i].dMcal_PS;
    300     xlist[i] = image[i].secz_PS;
     298    Mlist[i] = image[i].Mcal;
     299    dlist[i] = image[i].dMcal;
     300    xlist[i] = image[i].secz;
    301301  }
    302302
     
    316316  bzero (Mlist, NBIN*sizeof(double));
    317317  for (i = 0; i < Nimage; i++) {
    318     bin = image[i].dMcal_PS / 0.00025;
     318    bin = image[i].dMcal / 0.00025;
    319319    bin = MAX (0, MIN (NBIN - 1, bin));
    320320    Mlist[bin] += 1.0;
     
    413413    if (image[i].code & IMAGE_BAD)  continue;
    414414
    415     list[n] = image[i].Mcal_PS;
     415    list[n] = image[i].Mcal;
    416416    dlist[n] = 1;
    417417    n++;
     
    441441    if (image[i].code & IMAGE_BAD)  continue;
    442442
    443     list[n] = image[i].dMcal_PS;
     443    list[n] = image[i].dMcal;
    444444    dlist[n] = 1;
    445445    n++;
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/MosaicOps.c

    r6808 r12008  
    3636
    3737    /* select valid mosaic images by photcode */
    38     pname = GetPhotcodeNamebyCode (image[i].source);
     38    pname = GetPhotcodeNamebyCode (image[i].photcode);
    3939    status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME));
    4040    if (status) continue;
     
    6969    mosaic[Nmosaic].Xm    = 0.0;
    7070    mosaic[Nmosaic].code  = image[i].code;
    71     mosaic[Nmosaic].secz  = image[i].secz_PS;
     71    mosaic[Nmosaic].secz  = image[i].secz;
    7272
    7373    /* add image to mosaic image list */
     
    134134      Dmin = MIN (Dmin, D);
    135135      Dmax = MAX (Dmax, D);
    136       Mcal += image[m].Mcal_PS;
    137       dMcal += image[m].dMcal_PS;
     136      Mcal += image[m].Mcal;
     137      dMcal += image[m].dMcal;
    138138      Xm += image[m].Xm;
    139139      /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */
    140       image[m].Mcal_PS = 0.0;
    141       image[m].dMcal_PS = image[m].Xm = NO_MAG;
     140      image[m].Mcal = 0.0;
     141      image[m].dMcal = image[m].Xm = NO_MAG;
    142142    }
    143143    dS /= Nimlist[i];
     
    179179    for (j = 0; j < Nimlist[i]; j++) {
    180180      im = imlist[i][j];
    181       image[im].Mcal_PS = mosaic[i].Mcal;
    182       image[im].dMcal_PS = mosaic[i].dMcal;
     181      image[im].Mcal = mosaic[i].Mcal;
     182      image[im].dMcal = mosaic[i].dMcal;
    183183      image[im].Xm = mosaic[i].Xm;
    184184      image[im].code |= (mosaic[i].code & ID_IMAGE_FEW);
     
    247247        if (catalog[i].measure[j].t > TSTOP) continue;
    248248      }
    249       ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].source);
     249      ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].photcode);
    250250      if (photcode[0].code != ecode) continue;
    251251      matchMosaics (catalog, j, i);
     
    266266    if (USE_GRID) {
    267267      ave = catalog[cat].measure[meas].averef;
    268       ra  = catalog[cat].average[ave].R_PS - catalog[cat].measure[meas].dR_PS / 3600.0;
    269       dec = catalog[cat].average[ave].D_PS - catalog[cat].measure[meas].dD_PS / 3600.0;
     268      ra  = catalog[cat].average[ave].R - catalog[cat].measure[meas].dR / 3600.0;
     269      dec = catalog[cat].average[ave].D - catalog[cat].measure[meas].dD / 3600.0;
    270270
    271271      /* X,Y always positive-definite in range 0,0 - dX, dY */
     
    353353      Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);
    354354      list[N]  = Msys - Mrel - Mcal - Mgrid;
    355       dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR);
     355      dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR);
    356356      Mlist[N] = Msys;
    357357      dMlist[N] = list[N];
     
    591591
    592592      ave = catalog[c].measure[m].averef;
    593       xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR_PS / 3600.0;
    594       ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD_PS / 3600.0;
     593      xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR / 3600.0;
     594      ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD / 3600.0;
    595595      N++;
    596596    }
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/StarOps.c

    r6808 r12008  
    2828  if (catalog[cat].average[ave].code & STAR_BAD) return (NO_MAG); 
    2929 
    30   value = PhotPrimary ? catalog[cat].average[ave].M : catalog[cat].secfilt[PhotNsec*ave+PhotSec].M_PS;
     30  value = PhotPrimary ? catalog[cat].average[ave].M : catalog[cat].secfilt[PhotNsec*ave+PhotSec].M;
    3131  return (value);
    3232}
     
    5454        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    5555        list[N] = Msys - Mcal - Mmos - Mgrid;
    56         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     56        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    5757        N++;
    5858      }
     
    7070        catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    7171      } else {
    72         catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS  = stats.mean;
    73         catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = stats.sigma;
     72        catalog[i].secfilt[PhotNsec*j+PhotSec].M  = stats.mean;
     73        catalog[i].secfilt[PhotNsec*j+PhotSec].dM = stats.sigma;
    7474        catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    7575      }     
     
    112112        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    113113        list[N] = Msys - Mcal - Mmos - Mgrid;
    114         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     114        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    115115        N++;
    116116      }
     
    126126        catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    127127      } else {
    128         catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS  = stats.mean;
    129         catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = MAX (stats.error, stats.sigma);
     128        catalog[i].secfilt[PhotNsec*j+PhotSec].M  = stats.mean;
     129        catalog[i].secfilt[PhotNsec*j+PhotSec].dM = MAX (stats.error, stats.sigma);
    130130        catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    131131      }     
     
    156156        if ((Mmos  = getMmos  (m, i)) == NO_MAG) continue;
    157157        if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue;
    158         catalog[i].measure[m].Mcal_PS = Mcal + Mmos + Mgrid;
     158        catalog[i].measure[m].Mcal = Mcal + Mmos + Mgrid;
    159159      }
    160160    }
     
    187187      Chisq = pow (10.0, 0.01*Xm);
    188188      xlist[Ntot] = Chisq;
    189       slist[Ntot] = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     189      slist[Ntot] = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    190190      dlist[Ntot] = 1;
    191191      Ntot ++;
     
    203203  for (i = 0; i < Ncatalog; i++) {
    204204    for (j = 0; j < catalog[i].Naverage; j++) {
    205       dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     205      dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    206206      Xm = PhotPrimary ? catalog[i].average[j].Xm    : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;
    207207      Chisq = pow (10.0, 0.01*Xm);
     
    269269        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    270270        list[N] = Msys - Mcal - Mmos - Mgrid;
    271         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     271        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    272272        N++;
    273273      }
     
    301301        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    302302        list[N] = Msys - Mcal - Mmos - Mgrid;
    303         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     303        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    304304        ilist[N] = m;
    305305        N++;
     
    423423      if (catalog[i].average[j].code & STAR_BAD) continue; 
    424424
    425       dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     425      dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    426426      list[n] = dM;
    427427      dlist[n] = 1;
     
    452452    for (j = 0; j < catalog[i].Naverage; j++) {
    453453      if (catalog[i].average[j].code & STAR_BAD) continue; 
    454       dMrel = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     454      dMrel = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    455455      bin = dMrel / 0.00025;
    456456      bin = MAX (0, MIN (NBIN-1, bin));
     
    483483    for (j = 0; j < catalog[i].Naverage; j++) {
    484484      if (catalog[i].average[j].code & STAR_BAD) continue;
    485       xlist[N] = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS;
     485      xlist[N] = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M;
    486486      value    = PhotPrimary ? catalog[i].average[j].Xm   : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;
    487487      if (value == NO_MAG) continue;
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/UpdateImages.c

    r11742 r12008  
    4242        /* the astrometric errors are not being carried yet (but should be!) */
    4343        /* we use the photometric mag error as a weighting term */
    44         dlistR[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
    45         dlistD[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     44        dlistR[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
     45        dlistD[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    4646        N++;
    4747      }
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/UpdateObjects.c

    r11742 r12008  
    4242        /* the astrometric errors are not being carried yet (but should be!) */
    4343        /* we use the photometric mag error as a weighting term */
    44         dlistR[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
    45         dlistD[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     44        dlistR[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
     45        dlistD[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    4646        N++;
    4747      }
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/bcatalog.c

    r8390 r12008  
    3535    if (RESET) {
    3636      float *p;
    37       p = (PhotPrimary) ? &subcatalog[0].average[Naverage].M : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M_PS;
     37      p = (PhotPrimary) ? &subcatalog[0].average[Naverage].M : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M;
    3838      *p = NO_MAG;
    39       p = (PhotPrimary) ? &subcatalog[0].average[Naverage].dM : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM_PS;
     39      p = (PhotPrimary) ? &subcatalog[0].average[Naverage].dM : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM;
    4040      *p = NO_MAG;
    4141      subcatalog[0].average[Naverage].code &= ~ID_STAR_FEW;
     
    4949
    5050      /* select measurements by photcode */
    51       ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset].source);
     51      ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset].photcode);
    5252      if (ecode != photcode[0].code) continue;
    5353
     
    6666
    6767      /* select measurements by measurement error */
    68       if (catalog[0].measure[offset].dM_PS > SIGMA_LIM) continue;
     68      if (catalog[0].measure[offset].dM > SIGMA_LIM) continue;
    6969
    7070      /* select measurements by mag limit */
     
    7979      subcatalog[0].measure[Nmeasure].averef = Naverage;
    8080      if (RESET) {
    81         subcatalog[0].measure[Nmeasure].Mcal_PS = 0;
     81        subcatalog[0].measure[Nmeasure].Mcal = 0;
    8282        subcatalog[0].measure[Nmeasure].flags &= 0xff00;
    8383        subcatalog[0].measure[Nmeasure].flags &= ~ID_MEAS_POOR;
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/plot_scatter.c

    r6808 r12008  
    3232        if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue;
    3333
    34         Mrel = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS;
     34        Mrel = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M;
    3535        xlist[N] = Mrel;
    3636        ylist[N] = PhotSys  (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]) - Mcal - Mmos - Mgrid - Mrel;
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/plotstuff.c

    r10843 r12008  
    4949  if (Xgraph[N] == 0) return;
    5050
    51   KiiPS (Xgraph[N], TRUE, KAPA_PS_NEWPLOT, filename);
     51  KiiPS (Xgraph[N], TRUE, KAPA_NEWPLOT, filename);
    5252  return;
    5353}
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/select_images.c

    r8390 r12008  
    7676     
    7777    /* exclude images by photcode */
    78     ecode = GetPhotcodeEquivCodebyCode (timage[i].source);
     78    ecode = GetPhotcodeEquivCodebyCode (timage[i].photcode);
    7979    if (ecode != photcode[0].code) continue;
    8080
     
    135135      if (RESET) {
    136136        assignMcal (&image[nimage], (double *) NULL, -1);
    137         image[nimage].dMcal_PS = NO_MAG;
     137        image[nimage].dMcal = NO_MAG;
    138138        image[nimage].code &= ~ID_IMAGE_POOR;
    139139      }
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/setExclusions.c

    r6808 r12008  
    1414
    1515        /* select measurements by photcode */
    16         ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[m].source);
     16        ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[m].photcode);
    1717        if (ecode != photcode[0].code) goto mark_nocal;
    1818       
     
    2525        /* select measurements by mag limit */
    2626        if (AreaSelect) {
    27           r = catalog[i].average[j].R + catalog[i].measure[m].dR_PS / 3600.0;
    28           d = catalog[i].average[j].D + catalog[i].measure[m].dD_PS / 3600.0;
     27          r = catalog[i].average[j].R + catalog[i].measure[m].dR / 3600.0;
     28          d = catalog[i].average[j].D + catalog[i].measure[m].dD / 3600.0;
    2929          if ((coords = getCoords (m, i)) == NULL) goto markbad;
    3030          RD_to_XY (&x, &y, r, d, coords);
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/setMrelFinal.c

    r6808 r12008  
    1111
    1212    for (i = 0; i < catalog[0].Naverage; i++) {
    13       p = (PhotPrimary) ? &catalog[0].average[i].M  : &catalog[0].secfilt[PhotNsec*i+PhotSec].M_PS;
     13      p = (PhotPrimary) ? &catalog[0].average[i].M  : &catalog[0].secfilt[PhotNsec*i+PhotSec].M;
    1414      *p = NO_MAG;
    15       p = (PhotPrimary) ? &catalog[0].average[i].dM : &catalog[0].secfilt[PhotNsec*i+PhotSec].dM_PS;
     15      p = (PhotPrimary) ? &catalog[0].average[i].dM : &catalog[0].secfilt[PhotNsec*i+PhotSec].dM;
    1616      *p = NO_MAG;
    1717      q = (PhotPrimary) ? &catalog[0].average[i].Xm : &catalog[0].secfilt[PhotNsec*i+PhotSec].Xm;
     
    2222       
    2323        /* select measurements by photcode */
    24         ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].source);
     24        ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].photcode);
    2525        if (ecode != photcode[0].code) continue;
    2626       
     
    3131        }
    3232       
    33         catalog[0].measure[m].Mcal_PS = 0;
     33        catalog[0].measure[m].Mcal = 0;
    3434        catalog[0].measure[m].flags &= 0xff00;
    3535        catalog[0].measure[m].flags &= ~ID_MEAS_POOR;
     
    9797      /** never use these measurements (wrong photcode, bad time range) */
    9898      /* skipped via NOCAL, don't mark as skipped */
    99       ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].source);
     99      ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].photcode);
    100100      if (ecode != photcode[0].code) continue;
    101101
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/GridOps.c

    r9633 r12008  
    282282      Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);
    283283      list[N] = Msys - Mrel - Mcal - Mmos;
    284       dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR);
     284      dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR);
    285285      N++;
    286286    }
     
    447447  for (i = 0; i < Nimage; i++) {
    448448    image = getimage (imlist[i]);
    449     pname = GetPhotcodeNamebyCode (image[0].source);
     449    pname = GetPhotcodeNamebyCode (image[0].photcode);
    450450
    451451    /* this is kind of bogus... */
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/ImageOps.c

    r9633 r12008  
    7575  for (i = 0; i < Ncatalog; i++) {
    7676    for (j = 0; j < catalog[i].Nmeasure; j++) {
    77       ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].source);
     77      ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].photcode);
    7878      if (photcode[0].code != ecode) continue;
    7979      matchImage (catalog, j, i);
     
    8282}
    8383
     84/* XXX convert this to use the values of measure->Xccd,Yccd */
     85/* XXX need to apply the conversion for ELIXIR and LONEOS formats */
    8486void matchImage (Catalog *catalog, int meas, int cat) {
    8587
     
    9193  measure = &catalog[cat].measure[meas];
    9294  for (i = 0; i < Nimage; i++) {
    93     if (image[0].source == -1) continue;
    94     if (measure[0].source != image[i].source) continue;
     95    if (image[0].photcode == -1) continue;
     96    if (measure[0].photcode != image[i].photcode) continue;
    9597    if (measure[0].t < start[i]) continue;
    9698    if (measure[0].t > stop[i]) continue;
     
    100102
    101103      /* identify the ccd on the basis of the photcode name */
    102       pname = GetPhotcodeNamebyCode (image[i].source);
     104      pname = GetPhotcodeNamebyCode (image[i].photcode);
    103105      filter = photcode[0].name;
    104106      sprintf (base, "%s.%s.", MOSAICNAME, filter);
     
    111113      /* add this measurement to the grid cell for this chip */
    112114      ave = measure[0].averef;
    113       ra  = catalog[cat].average[ave].R - measure[0].dR_PS / 3600.0;
    114       dec = catalog[cat].average[ave].D - measure[0].dD_PS / 3600.0;
     115      ra  = catalog[cat].average[ave].R - measure[0].dR / 3600.0;
     116      dec = catalog[cat].average[ave].D - measure[0].dD / 3600.0;
    115117       
    116118      /* X,Y always positive-definite in range 0,0 - dX, dY */
     
    133135    return;
    134136  }
    135   /*  fprintf (stderr, "can't find source image for this measurement: %d (%d)\n", measure[0].t, measure[0].source); */
     137  /*  fprintf (stderr, "can't find source image for this measurement: %d (%d)\n", measure[0].t, measure[0].photcode); */
    136138}
    137139
     
    145147
    146148  if (image[i].code & IMAGE_BAD)  return (NO_MAG); 
    147   value = image[i].Mcal_PS;
     149  value = image[i].Mcal;
    148150  return (value);
    149151}
     
    203205      Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);
    204206      list[N] = Msys - Mrel - Mmos - Mgrid;
    205       dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR);
     207      dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR);
    206208      N++;
    207209    }
     
    219221   
    220222    liststats (list, dlist, N, &stats);
    221     image[i].Mcal_PS  = stats.mean;
    222     image[i].dMcal_PS = stats.sigma;
     223    image[i].Mcal  = stats.mean;
     224    image[i].dMcal = stats.sigma;
    223225    image[i].Xm    = 100.0*log10(stats.chisq);
    224226  }
     
    251253  for (i = N = 0; i < Nimage; i++) {
    252254    if (image[i].code & IMAGE_BAD) continue;
    253     mlist[N] = fabs (image[i].Mcal_PS);
    254     slist[N] = image[i].dMcal_PS;
     255    mlist[N] = fabs (image[i].Mcal);
     256    slist[N] = image[i].dMcal;
    255257    dlist[N] = 1;
    256258    N++;
     
    268270    mark = FALSE;
    269271    image[i].code &= ~ID_IMAGE_POOR;
    270     mark = (image[i].dMcal_PS > MaxScatter) || (fabs(image[i].Mcal_PS - MedOffset) > MaxOffset);
     272    mark = (image[i].dMcal > MaxScatter) || (fabs(image[i].Mcal - MedOffset) > MaxOffset);
    271273    if (mark) {
    272274      Nmark ++;
     
    298300  /**** dMcal vs airmass ****/
    299301  for (i = 0; i < Nimage; i++) {
    300     Mlist[i] = image[i].Mcal_PS;
    301     dlist[i] = image[i].dMcal_PS;
    302     xlist[i] = image[i].secz_PS;
     302    Mlist[i] = image[i].Mcal;
     303    dlist[i] = image[i].dMcal;
     304    xlist[i] = image[i].secz;
    303305  }
    304306
     
    318320  bzero (Mlist, NBIN*sizeof(double));
    319321  for (i = 0; i < Nimage; i++) {
    320     bin = image[i].dMcal_PS / 0.00025;
     322    bin = image[i].dMcal / 0.00025;
    321323    bin = MAX (0, MIN (NBIN - 1, bin));
    322324    Mlist[bin] += 1.0;
     
    420422    if (image[i].code & IMAGE_BAD)  continue;
    421423
    422     list[n] = image[i].Mcal_PS;
     424    list[n] = image[i].Mcal;
    423425    dlist[n] = 1;
    424426    n++;
     
    448450    if (image[i].code & IMAGE_BAD)  continue;
    449451
    450     list[n] = image[i].dMcal_PS;
     452    list[n] = image[i].dMcal;
    451453    dlist[n] = 1;
    452454    n++;
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/MosaicOps.c

    r9633 r12008  
    3636
    3737    /* select valid mosaic images by photcode */
    38     pname = GetPhotcodeNamebyCode (image[i].source);
     38    pname = GetPhotcodeNamebyCode (image[i].photcode);
    3939    status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME));
    4040    if (status) continue;
     
    6969    mosaic[Nmosaic].Xm    = 0.0;
    7070    mosaic[Nmosaic].code  = image[i].code;
    71     mosaic[Nmosaic].secz  = image[i].secz_PS;
     71    mosaic[Nmosaic].secz  = image[i].secz;
    7272
    7373    /* add image to mosaic image list */
     
    134134      Dmin = MIN (Dmin, D);
    135135      Dmax = MAX (Dmax, D);
    136       Mcal += image[m].Mcal_PS;
    137       dMcal += image[m].dMcal_PS;
     136      Mcal += image[m].Mcal;
     137      dMcal += image[m].dMcal;
    138138      Xm += image[m].Xm;
    139139      /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */
    140       image[m].Mcal_PS = 0.0;
    141       image[m].dMcal_PS = image[m].Xm = NO_MAG;
     140      image[m].Mcal = 0.0;
     141      image[m].dMcal = image[m].Xm = NO_MAG;
    142142    }
    143143    dS /= Nimlist[i];
     
    179179    for (j = 0; j < Nimlist[i]; j++) {
    180180      im = imlist[i][j];
    181       image[im].Mcal_PS = mosaic[i].Mcal;
    182       image[im].dMcal_PS = mosaic[i].dMcal;
     181      image[im].Mcal = mosaic[i].Mcal;
     182      image[im].dMcal = mosaic[i].dMcal;
    183183      image[im].Xm = mosaic[i].Xm;
    184184      image[im].code |= (mosaic[i].code & ID_IMAGE_FEW);
     
    247247        if (catalog[i].measure[j].t > TSTOP) continue;
    248248      }
    249       ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].source);
     249      ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].photcode);
    250250      if (photcode[0].code != ecode) continue;
    251251      matchMosaics (catalog, j, i);
     
    266266    if (USE_GRID) {
    267267      ave = catalog[cat].measure[meas].averef;
    268       ra  = catalog[cat].average[ave].R_PS - catalog[cat].measure[meas].dR_PS / 3600.0;
    269       dec = catalog[cat].average[ave].D_PS - catalog[cat].measure[meas].dD_PS / 3600.0;
     268      ra  = catalog[cat].average[ave].R - catalog[cat].measure[meas].dR / 3600.0;
     269      dec = catalog[cat].average[ave].D - catalog[cat].measure[meas].dD / 3600.0;
    270270
    271271      /* X,Y always positive-definite in range 0,0 - dX, dY */
     
    355355      Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);
    356356      list[N]  = Msys - Mrel - Mcal - Mgrid;
    357       dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR);
     357      dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR);
    358358      Mlist[N] = Msys;
    359359      dMlist[N] = list[N];
     
    596596
    597597      ave = catalog[c].measure[m].averef;
    598       xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR_PS / 3600.0;
    599       ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD_PS / 3600.0;
     598      xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR / 3600.0;
     599      ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD / 3600.0;
    600600      N++;
    601601    }
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/StarOps.c

    r10506 r12008  
    2828  if (catalog[cat].average[ave].code & STAR_BAD) return (NO_MAG); 
    2929 
    30   value = PhotPrimary ? catalog[cat].average[ave].M : catalog[cat].secfilt[PhotNsec*ave+PhotSec].M_PS;
     30  value = PhotPrimary ? catalog[cat].average[ave].M : catalog[cat].secfilt[PhotNsec*ave+PhotSec].M;
    3131  return (value);
    3232}
     
    6565        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    6666        list[N] = Msys - Mcal - Mmos - Mgrid;
    67         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     67        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    6868        N++;
    6969      }
     
    8181        catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    8282      } else {
    83         catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS  = stats.mean;
    84         catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = stats.sigma;
     83        catalog[i].secfilt[PhotNsec*j+PhotSec].M  = stats.mean;
     84        catalog[i].secfilt[PhotNsec*j+PhotSec].dM = stats.sigma;
    8585        catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    8686      }     
     
    130130        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    131131        list[N] = Msys - Mcal - Mmos - Mgrid;
    132         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     132        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    133133        N++;
    134134      }
     
    144144        catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    145145      } else {
    146         catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS  = stats.mean;
    147         catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = MAX (stats.error, stats.sigma);
     146        catalog[i].secfilt[PhotNsec*j+PhotSec].M  = stats.mean;
     147        catalog[i].secfilt[PhotNsec*j+PhotSec].dM = MAX (stats.error, stats.sigma);
    148148        catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG;
    149149      }     
     
    178178        if (Mmos == NO_IMAGE) continue;
    179179        if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue;
    180         catalog[i].measure[m].Mcal_PS = Mcal + Mmos + Mgrid;
     180        catalog[i].measure[m].Mcal = Mcal + Mmos + Mgrid;
    181181      }
    182182    }
     
    209209      Chisq = pow (10.0, 0.01*Xm);
    210210      xlist[Ntot] = Chisq;
    211       slist[Ntot] = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     211      slist[Ntot] = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    212212      dlist[Ntot] = 1;
    213213      Ntot ++;
     
    225225  for (i = 0; i < Ncatalog; i++) {
    226226    for (j = 0; j < catalog[i].Naverage; j++) {
    227       dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     227      dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    228228      Xm = PhotPrimary ? catalog[i].average[j].Xm    : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;
    229229      Chisq = pow (10.0, 0.01*Xm);
     
    295295        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    296296        list[N] = Msys - Mcal - Mmos - Mgrid;
    297         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     297        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    298298        N++;
    299299      }
     
    331331        Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);
    332332        list[N] = Msys - Mcal - Mmos - Mgrid;
    333         dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR);
     333        dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
    334334        ilist[N] = m;
    335335        N++;
     
    458458      if (catalog[i].average[j].code & STAR_BAD) continue; 
    459459
    460       dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     460      dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    461461      list[n] = dM;
    462462      dlist[n] = 1;
     
    487487    for (j = 0; j < catalog[i].Naverage; j++) {
    488488      if (catalog[i].average[j].code & STAR_BAD) continue; 
    489       dMrel = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;
     489      dMrel = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;
    490490      bin = dMrel / 0.00025;
    491491      bin = MAX (0, MIN (NBIN-1, bin));
     
    518518    for (j = 0; j < catalog[i].Naverage; j++) {
    519519      if (catalog[i].average[j].code & STAR_BAD) continue;
    520       xlist[N] = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS;
     520      xlist[N] = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M;
    521521      value    = PhotPrimary ? catalog[i].average[j].Xm   : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;
    522522      if (value == NO_MAG) continue;
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/bcatalog.c

    r11062 r12008  
    2828    if (RESET) {
    2929      float *p;
    30       p = (PhotPrimary) ? &subcatalog[0].average[Naverage].M : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M_PS;
     30      p = (PhotPrimary) ? &subcatalog[0].average[Naverage].M : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M;
    3131      *p = NO_MAG;
    32       p = (PhotPrimary) ? &subcatalog[0].average[Naverage].dM : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM_PS;
     32      p = (PhotPrimary) ? &subcatalog[0].average[Naverage].dM : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM;
    3333      *p = NO_MAG;
    3434      subcatalog[0].average[Naverage].code &= ~ID_STAR_FEW;
     
    4242
    4343      /* select measurements by photcode */
    44       ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset].source);
     44      ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset].photcode);
    4545      if (ecode != photcode[0].code) continue;
    4646
     
    6060
    6161      /* select measurements by measurement error */
    62       if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM_PS > SIGMA_LIM)) continue;
     62      if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM > SIGMA_LIM)) continue;
    6363
    6464      /* select measurements by mag limit */
     
    7373      subcatalog[0].measure[Nmeasure].averef = Naverage;
    7474      if (RESET) {
    75         subcatalog[0].measure[Nmeasure].Mcal_PS = 0;
     75        subcatalog[0].measure[Nmeasure].Mcal = 0;
    7676        subcatalog[0].measure[Nmeasure].flags &= 0xff00;
    7777        subcatalog[0].measure[Nmeasure].flags &= ~ID_MEAS_POOR;
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/plot_scatter.c

    r9633 r12008  
    3636        if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue;
    3737
    38         Mrel = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS;
     38        Mrel = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M;
    3939        xlist[N] = Mrel;
    4040        ylist[N] = PhotSys  (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]) - Mcal - Mmos - Mgrid - Mrel;
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/relphot.c

    r10506 r12008  
    4444  /* load catalog data from region files */
    4545  catalog = load_catalogs (skylist, &Ncatalog);
     46 
     47  /* add in a loop over the catalogs calling dvo_catalog_chipcoords */
    4648
    4749  /* match measurements with images, mosaics */
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/select_images.c

    r7082 r12008  
    7676     
    7777    /* exclude images by photcode */
    78     ecode = GetPhotcodeEquivCodebyCode (timage[i].source);
     78    ecode = GetPhotcodeEquivCodebyCode (timage[i].photcode);
    7979    if (ecode != photcode[0].code) continue;
    8080
     
    135135      if (RESET) {
    136136        assignMcal (&image[nimage], (double *) NULL, -1);
    137         image[nimage].dMcal_PS = NO_MAG;
     137        image[nimage].dMcal = NO_MAG;
    138138        image[nimage].code &= ~ID_IMAGE_POOR;
    139139      }
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/setExclusions.c

    r6683 r12008  
    1414
    1515        /* select measurements by photcode */
    16         ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[m].source);
     16        ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[m].photcode);
    1717        if (ecode != photcode[0].code) goto mark_nocal;
    1818       
     
    2525        /* select measurements by mag limit */
    2626        if (AreaSelect) {
    27           r = catalog[i].average[j].R + catalog[i].measure[m].dR_PS / 3600.0;
    28           d = catalog[i].average[j].D + catalog[i].measure[m].dD_PS / 3600.0;
     27          r = catalog[i].average[j].R + catalog[i].measure[m].dR / 3600.0;
     28          d = catalog[i].average[j].D + catalog[i].measure[m].dD / 3600.0;
    2929          if ((coords = getCoords (m, i)) == NULL) goto markbad;
    3030          RD_to_XY (&x, &y, r, d, coords);
  • branches/dvo-mods-2007-02/Ohana/src/relphot/src/setMrelFinal.c

    r10506 r12008  
    1111
    1212    for (i = 0; i < catalog[0].Naverage; i++) {
    13       p = (PhotPrimary) ? &catalog[0].average[i].M  : &catalog[0].secfilt[PhotNsec*i+PhotSec].M_PS;
     13      p = (PhotPrimary) ? &catalog[0].average[i].M  : &catalog[0].secfilt[PhotNsec*i+PhotSec].M;
    1414      *p = NO_MAG;
    15       p = (PhotPrimary) ? &catalog[0].average[i].dM : &catalog[0].secfilt[PhotNsec*i+PhotSec].dM_PS;
     15      p = (PhotPrimary) ? &catalog[0].average[i].dM : &catalog[0].secfilt[PhotNsec*i+PhotSec].dM;
    1616      *p = NO_MAG;
    1717      q = (PhotPrimary) ? &catalog[0].average[i].Xm : &catalog[0].secfilt[PhotNsec*i+PhotSec].Xm;
     
    2222       
    2323        /* select measurements by photcode */
    24         ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].source);
     24        ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].photcode);
    2525        if (ecode != photcode[0].code) continue;
    2626       
     
    3131        }
    3232       
    33         catalog[0].measure[m].Mcal_PS = 0;
     33        catalog[0].measure[m].Mcal = 0;
    3434        catalog[0].measure[m].flags &= 0xff00;
    3535        catalog[0].measure[m].flags &= ~ID_MEAS_POOR;
     
    9797      /** never use these measurements (wrong photcode, bad time range) */
    9898      /* skipped via NOCAL, don't mark as skipped */
    99       ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].source);
     99      ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].photcode);
    100100      if (ecode != photcode[0].code) continue;
    101101
  • branches/dvo-mods-2007-02/Ohana/src/uniphot/src/fit_groups.c

    r5014 r12008  
    1818      if (tgroup[i].image[j][0].code & IMAGE_BAD) continue;
    1919      sgroup = (Group *) tgroup[i].imlink[j][0].sgroup;
    20       Mcal = tgroup[i].image[j][0].Mcal_PS;
     20      Mcal = tgroup[i].image[j][0].Mcal;
    2121      Mgrp = sgroup[0].M;
    2222      mlist[Nlist] = (Mcal - Mgrp);
    23       dlist[Nlist] = tgroup[i].image[j][0].dMcal_PS;
     23      dlist[Nlist] = tgroup[i].image[j][0].dMcal;
    2424      Nlist ++;
    2525    }
     
    5656      if (sgroup[i].image[j][0].code & IMAGE_BAD) continue;
    5757      tgroup = (Group *) sgroup[i].imlink[j][0].tgroup;
    58       Mcal = sgroup[i].image[j][0].Mcal_PS;
     58      Mcal = sgroup[i].image[j][0].Mcal;
    5959      Mgrp = tgroup[0].M;
    6060      mlist[Nlist] = (Mcal - Mgrp);
    61       dlist[Nlist] = sgroup[i].image[j][0].dMcal_PS;
     61      dlist[Nlist] = sgroup[i].image[j][0].dMcal;
    6262      Nlist ++;
    6363    }
  • branches/dvo-mods-2007-02/Ohana/src/uniphot/src/subset_images.c

    r7080 r12008  
    1919
    2020    /* select images by photcode */
    21     equiv = GetPhotcodeEquivCodebyCode (image[i].source);
     21    equiv = GetPhotcodeEquivCodebyCode (image[i].photcode);
    2222    if (equiv != photcode[0].code) continue;
    2323
  • branches/dvo-mods-2007-02/Ohana/src/uniphot/src/update.c

    r8388 r12008  
    2222  for (i = 0; i < Nsgroup; i++) {
    2323    for (j = 0; j < sgroup[i].Nimage; j++) {
    24       sgroup[i].image[j][0].Mcal_PS -= sgroup[i].M;
     24      sgroup[i].image[j][0].Mcal -= sgroup[i].M;
    2525    }
    2626  }
  • branches/dvo-mods-2007-02/Ohana/src/uniphot/src/update_catalog.c

    r6683 r12008  
    1515  for (i = 0; i < catalog[0].Naverage; i++) {
    1616   
    17     Mp = Primary ? &catalog[0].average[i].M : &catalog[0].secfilt[i*Nsecfilt+Nsec].M_PS;
     17    Mp = Primary ? &catalog[0].average[i].M : &catalog[0].secfilt[i*Nsecfilt+Nsec].M;
    1818    if (*Mp != NO_MAG) *Mp += sgroup[0].M;
    1919
    2020    m = catalog[0].average[i].offset;
    2121    for (j = 0; j < catalog[0].average[i].Nm; j++, m++) {
    22       code = GetPhotcodebyCode (catalog[0].measure[m].source);
     22      code = GetPhotcodebyCode (catalog[0].measure[m].photcode);
    2323      if (code == NULL) continue;
    2424      if (code[0].type != PHOT_DEP) continue;
    2525      if (code[0].equiv != photcode[0].code) continue;
    26       catalog[0].measure[m].Mcal_PS -= sgroup[0].M;
     26      catalog[0].measure[m].Mcal -= sgroup[0].M;
    2727      found ++;
    2828    }
Note: See TracChangeset for help on using the changeset viewer.