IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41664


Ignore:
Timestamp:
Jun 16, 2021, 1:43:22 PM (5 years ago)
Author:
eugene
Message:

add function to rationalize zero points

Location:
trunk/Ohana/src/relphot/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relphot/src/GridOps.c

    r41647 r41664  
    274274    if (!GridCorr[code]) continue;
    275275
     276    // float GridSum = 0.0;
     277    // int   GridCnt =   0;
    276278    for (int ix = 0; ix < GridCorr[code]->Nx; ix++) {
    277279      for (int iy = 0; iy < GridCorr[code]->Ny; iy++) {
     
    292294        GridCorr[code]->dMgrid[ix][iy] = sqrt(r*(Mgrid2 - Mgrid*Mgrid)); // sample stdev
    293295        // fprintf (stderr, "grid code %d, %d x %d : %f +/- %f : %d\n", code, ix, iy, GridCorr[code]-> Mgrid[ix][iy], GridCorr[code]->dMgrid[ix][iy], GridCorr[code]->nMgrid[ix][iy]);
     296        // GridSum += Mgrid;
     297        // GridCnt ++;
    294298      }
    295299    }
     300    // float GridAve = GridSum / GridCnt;
     301    // fprintf (stderr, "grid average: %f\n", GridAve);
    296302  }
    297303  return;
  • trunk/Ohana/src/relphot/src/ImageOps.c

    r41662 r41664  
    10211021  free (mlist);
    10221022
     1023  fprintf (stderr, "rationalize by image using %d pts\n", N);
    10231024  return stats.median;
    10241025}
     
    10311032    int mycode = GetPhotcodeEquivCodebyCode (image[i].photcode);
    10321033    if (mycode != photcode) continue;
    1033     image[i].McalPSF -= zpt;
    1034     image[i].McalAPER -= zpt;
     1034    // fprintf (stderr, "IMAGE %d zpt %f -> ", i, image[i].McalPSF);
     1035
     1036    int applyOffset = TRUE;
     1037    TGroup *mygrp = getTGroupForImage (i);
     1038    if (mygrp && (mygrp->flags & ID_IMAGE_TGROUP_PHOTCAL)) applyOffset = FALSE;
     1039
     1040    Mosaic *mymos = getMosaicForImage (i);
     1041    if (mymos && (mymos->flags & ID_IMAGE_MOSAIC_PHOTCAL)) applyOffset = FALSE;
     1042
     1043    if (applyOffset) {
     1044      image[i].McalPSF -= zpt;
     1045      image[i].McalAPER -= zpt;
     1046    }
     1047    // fprintf (stderr, "%f (%d)\n", image[i].McalPSF, applyOffset);
    10351048  }
    10361049
  • trunk/Ohana/src/relphot/src/MosaicOps.c

    r41662 r41664  
    15741574}
    15751575
     1576TGroup *getTGroupForMosaic (int mos) {
     1577  if (mos >= Nmosaic) return NULL;
     1578  if (mos < 0) return NULL;
     1579
     1580  if (!mosaic[mos].inTGroup) return NULL;
     1581
     1582  int imageIdx = MosaicToImage[mos][0];
     1583
     1584  TGroup *mygrp = getTGroupForImage (imageIdx);
     1585  return mygrp;
     1586}
     1587
    15761588double get_median_zpt_mosaics (short photcode) {
    15771589
     
    16011613  free (mlist);
    16021614
     1615  fprintf (stderr, "rationalize by mosaic using %d pts\n", N);
    16031616  return stats.median;
    16041617}
     
    16111624  for (int i = 0; i < Nmosaic; i++) {
    16121625    if (mosaic[i].photcode != photcode) continue;
    1613     mosaic[i].McalPSF -= zpt;
    1614     mosaic[i].McalAPER -= zpt;
     1626    // fprintf (stderr, "MOSAIC %d zpt %f -> ", i, mosaic[i].McalPSF);
     1627
     1628    int applyOffset = TRUE;
     1629    TGroup *mygrp = getTGroupForMosaic (i);
     1630    if (mygrp && (mygrp->flags & ID_IMAGE_TGROUP_PHOTCAL)) applyOffset = FALSE;
     1631    if (!(mosaic[i].flags & ID_IMAGE_MOSAIC_PHOTCAL)) applyOffset = FALSE;
     1632
     1633    if (applyOffset) {
     1634      mosaic[i].McalPSF -= zpt;
     1635      mosaic[i].McalAPER -= zpt;
     1636    }
     1637    // fprintf (stderr, "%f (%d)\n", mosaic[i].McalPSF, applyOffset);
    16151638  }
    16161639
  • trunk/Ohana/src/relphot/src/TGroupOps.c

    r41662 r41664  
    13351335      }
    13361336      // too few exposures (configure)
    1337       if (tgroup[j].Nmosaic < 4) {
     1337      if ((tgroup[j].Nmosaic < 4) && (tgroup[j].Nimage < 4)) {
    13381338        mark = TRUE;
    13391339        NfewExp ++;
     
    13951395  free (mlist);
    13961396
     1397  fprintf (stderr, "rationalize by tgroup using %d pts\n", N);
    13971398  return stats.median;
    13981399}
     
    14071408    for (int j = 0; j < tgroupTimes[i][0].nCode; j++) {
    14081409      if (tgroup[j].photcode != photcode) continue;
     1410      if (!(tgroup[j].flags & ID_IMAGE_TGROUP_PHOTCAL)) continue;
    14091411      tgroup[j].McalPSF -= zpt;
    14101412      tgroup[j].McalAPER -= zpt;
  • trunk/Ohana/src/relphot/src/relphot_images.c

    r41662 r41664  
    9797      SetZptIteration (i);
    9898
     99      rationalize_zeropoints (i);
     100
    99101      setMrel  (catalog, Ncatalog); // threaded (calls setMrelCatalog)
    100102
     
    102104      setMmos  (catalog);
    103105      setMgrp  (catalog);
    104 
    105       rationalize_zeropoints (i);
    106106
    107107      setMgrid (catalog, Ncatalog);
Note: See TracChangeset for help on using the changeset viewer.