IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 24, 2021, 2:28:09 PM (5 years ago)
Author:
eugene
Message:

add function to measure the residual stats for each chip, fix resets and flags on resets; fix update of image mcal from tgroup and mosaic; improved determination of bad nights and bad mosaics; allow tgroups to fit only zero points without airmass terms; clean up the test detection dumps; soften the errors to avoid overweighting extreme outliers with high S/N; more careful sequencing of fitting modes; add manual iteration option

File:
1 edited

Legend:

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

    r41473 r41555  
    44
    55void SetZptIteration (int current) {
     6  // XXX add 'manual' option here: ask for desired zpt iteration
     7  if (MANUAL_ITERATION) {
     8    int newValue;
     9    fprintf (stdout, "Set Iteration (current = %d): ", CurrentLoop);
     10    fscanf (stdin, "%d", &newValue);
     11    fprintf (stdout, "Using iteration %d\n", newValue);
     12    CurrentLoop = newValue;
     13    return;
     14  }
     15
     16  // automatic iteration:
    617  CurrentLoop = current;
    718}
     
    1425
    1526  if (TGROUP_ZEROPT && MOSAIC_ZEROPT) {
    16     if ((CurrentLoop > 4) && (CurrentLoop <= 8)) {
     27    if (CurrentLoop < 6) {
     28      TGROUP_ZPT_MODE = TGROUP_ZPT_MODE_ALL;
     29      IMAGE_ZPT_MODE  = IMAGE_ZPT_MODE_NONE;
     30      MOSAIC_ZPT_MODE = MOSAIC_ZPT_MODE_NONE;
     31    }
     32    if ((CurrentLoop >= 6) && (CurrentLoop < 12)) {
    1733      // after iterating a few times on the TGroup zero points:
    1834      // * identify the photometric nights
     
    2339      clean_tgroups(); // do this on every pass to update the status of nights
    2440    }
    25     if ((CurrentLoop > 8) && (CurrentLoop <= 999)) {
     41    if ((CurrentLoop >= 12) && (CurrentLoop < 18)) {
    2642      // after iterating a few times on the TGroup & Mosaic zero points:
    2743      // * identify the good / bad Mosaics
     
    3349      clean_mosaics(); // do this on every pass
    3450    }
     51    if ((CurrentLoop >= 18) && (CurrentLoop <= 999)) {
     52      // after iterating a few times on the TGroup & Mosaic zero points:
     53      // * identify the good / bad Mosaics
     54      // * fit the chips from the bad Mosaics
     55      TGROUP_ZPT_MODE = TGROUP_ZPT_MODE_GOOD_NIGHT; // stop fitting the bad nights
     56      MOSAIC_ZPT_MODE = MOSAIC_ZPT_MODE_BAD_NIGHT_GOOD_MOSAIC; // only fit good mosaics on bad nights
     57      IMAGE_ZPT_MODE  = IMAGE_ZPT_MODE_BAD_NIGHT_BAD_MOSAIC; // only fit bad mosaics on bad nights
     58      clean_tgroups(); // do this on every pass
     59      clean_mosaics(); // do this on every pass
     60      clean_images(); // do this on every pass
     61    }
    3562  }
    3663
    3764  if (TGROUP_ZEROPT && !MOSAIC_ZEROPT) {
     65    if (CurrentLoop <= 4) {
     66      TGROUP_ZPT_MODE = TGROUP_ZPT_MODE_ALL;
     67      IMAGE_ZPT_MODE  = IMAGE_ZPT_MODE_NONE;
     68      MOSAIC_ZPT_MODE = MOSAIC_ZPT_MODE_NONE;
     69    }
    3870    if ((CurrentLoop > 4) && (CurrentLoop <= 999)) {
    3971      // after iterating a few times on the TGroup zero points:
     
    4880
    4981  if (!TGROUP_ZEROPT && MOSAIC_ZEROPT) {
     82    if (CurrentLoop <= 4) {
     83      TGROUP_ZPT_MODE = TGROUP_ZPT_MODE_NONE;
     84      MOSAIC_ZPT_MODE = MOSAIC_ZPT_MODE_ALL;
     85      IMAGE_ZPT_MODE  = IMAGE_ZPT_MODE_NONE;
     86    }
    5087    if ((CurrentLoop > 4) && (CurrentLoop <= 999)) {
    5188      // after iterating a few times on the Mosaic zero points:
     
    6097
    6198  if (!TGROUP_ZEROPT && !MOSAIC_ZEROPT) {
    62     if ((CurrentLoop > 4) && (CurrentLoop <= 999)) {
    63       // after iterating a few times on the Image zero points:
    64       // * ???
    65       TGROUP_ZPT_MODE = TGROUP_ZPT_MODE_NONE;
    66       MOSAIC_ZPT_MODE = MOSAIC_ZPT_MODE_NONE;
    67       IMAGE_ZPT_MODE  = IMAGE_ZPT_MODE_ALL;
    68     }
     99    // if we are not fitting TGROUP or MOSAIC, just fit all images
     100    TGROUP_ZPT_MODE = TGROUP_ZPT_MODE_NONE;
     101    MOSAIC_ZPT_MODE = MOSAIC_ZPT_MODE_NONE;
     102    IMAGE_ZPT_MODE  = IMAGE_ZPT_MODE_ALL;
    69103  }
    70104}
     
    83117        return FALSE;
    84118      case ZPT_MOSAIC:
     119        if (CurrentLoop < 9) return TRUE;
     120        return FALSE;
     121      case ZPT_IMAGES:
     122      default:
     123        if (CurrentLoop < 15) return TRUE;
     124        return FALSE;
     125    }
     126  }
     127
     128  if (TGROUP_ZEROPT && !MOSAIC_ZEROPT) {
     129    switch (mode) {
     130      case ZPT_STARS:
     131        if (CurrentLoop < 3) return TRUE;
     132        return FALSE;
     133      case ZPT_TGROUP:
     134      case ZPT_MOSAIC:
     135        if (CurrentLoop < 3) return TRUE;
     136        return FALSE;
     137      case ZPT_IMAGES:
     138      default:
    85139        if (CurrentLoop < 7) return TRUE;
    86140        return FALSE;
    87       case ZPT_IMAGES:
    88       default:
    89         if (CurrentLoop < 11) return TRUE;
    90         return FALSE;
    91     }
    92   }
    93 
    94   if (TGROUP_ZEROPT && !MOSAIC_ZEROPT) {
     141    }
     142  }
     143
     144  if (!TGROUP_ZEROPT && MOSAIC_ZEROPT) {
    95145    switch (mode) {
    96146      case ZPT_STARS:
     
    108158  }
    109159
    110   if (!TGROUP_ZEROPT && MOSAIC_ZEROPT) {
    111     switch (mode) {
    112       case ZPT_STARS:
    113         if (CurrentLoop < 3) return TRUE;
    114         return FALSE;
    115       case ZPT_TGROUP:
    116       case ZPT_MOSAIC:
    117         if (CurrentLoop < 3) return TRUE;
    118         return FALSE;
    119       case ZPT_IMAGES:
    120       default:
    121         if (CurrentLoop < 7) return TRUE;
    122         return FALSE;
    123     }
    124   }
    125 
    126160  if (!TGROUP_ZEROPT && !MOSAIC_ZEROPT) {
    127161    switch (mode) {
     
    139173  return FALSE;
    140174}
     175
     176/*  TGROUP & MOSAIC:
     177    0 - TGROUP ONLY & OLS
     178    1 - TGROUP ONLY & OLS
     179    2 - TGROUP ONLY & OLS
     180
     181    3 - TGROUP ONLY & IRLS
     182    4 - TGROUP ONLY & IRLS
     183    5 - TGROUP ONLY & IRLS
     184
     185    6 - TGROUP + MOSAIC & OLS MOSAIC
     186    7 - TGROUP + MOSAIC & OLS MOSAIC
     187    8 - TGROUP + MOSAIC & OLS MOSAIC
     188
     189    9 - TGROUP + MOSAIC & IRLS MOSAIC
     190   10 - TGROUP + MOSAIC & IRLS MOSAIC
     191   11 - TGROUP + MOSAIC & IRLS MOSAIC
     192
     193   12 - TGROUP + MOSAIC + IMAGE & OLS IMAGE
     194   13 - TGROUP + MOSAIC + IMAGE & OLS IMAGE
     195   14 - TGROUP + MOSAIC + IMAGE & OLS IMAGE
     196
     197   15 - TGROUP + MOSAIC + IMAGE & IRLS IMAGE
     198   16 - TGROUP + MOSAIC + IMAGE & IRLS IMAGE
     199   17 - TGROUP + MOSAIC + IMAGE & IRLS IMAGE
     200
     201*/
     202
Note: See TracChangeset for help on using the changeset viewer.