IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35105


Ignore:
Timestamp:
Feb 6, 2013, 3:26:27 PM (13 years ago)
Author:
eugene
Message:

support to use the Xfix,Yfix values instead of Xraw,Yraw for calculating astrometry

Location:
trunk/Ohana/src/relastro
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relastro/include/relastro.h

    r34576 r35105  
    157157int    VERBOSE;
    158158int    VERBOSE2;
     159
     160int    USE_FIXED_PIXCOORDS;
    159161
    160162int    RESET;
  • trunk/Ohana/src/relastro/src/BrightCatalog.c

    r34405 r35105  
    7676    GET_COLUMN(Xccd,      "X_CCD",      float);
    7777    GET_COLUMN(Yccd,      "Y_CCD",      float);
     78    GET_COLUMN(Xfix,      "X_FIX",      float);
     79    GET_COLUMN(Yfix,      "Y_FIX",      float);
    7880    GET_COLUMN(dt,        "EXPTIME",    float);
    7981    GET_COLUMN(t,         "TIME",       int);
     
    98100      measure[i].Xccd      = Xccd[i];
    99101      measure[i].Yccd      = Yccd[i];
     102      measure[i].Xfix      = Xfix[i];
     103      measure[i].Yfix      = Yfix[i];
    100104      measure[i].dt        = dt[i];
    101105      measure[i].t         = t[i];
     
    117121    free (Xccd    );
    118122    free (Yccd    );
     123    free (Xfix    );
     124    free (Yfix    );
    119125    free (dt      );
    120126    free (t       );
     
    340346    gfits_define_bintable_column (&theader, "E", "MAG_ERR",  "magnitude (err)",             NULL,    1.0, 0.0);
    341347    gfits_define_bintable_column (&theader, "E", "AIRMASS",  "airmass",                     NULL,    1.0, 0.0);
    342     gfits_define_bintable_column (&theader, "E", "X_CCD",    "ccd x coord",                "pix",    1.0, 0.0);
    343     gfits_define_bintable_column (&theader, "E", "Y_CCD",    "ccd y coord",                "pix",    1.0, 0.0);
     348    gfits_define_bintable_column (&theader, "E", "X_CCD",    "ccd x raw coord",            "pix",    1.0, 0.0);
     349    gfits_define_bintable_column (&theader, "E", "Y_CCD",    "ccd y raw coord",            "pix",    1.0, 0.0);
     350    gfits_define_bintable_column (&theader, "E", "X_FIX",    "ccd x fixed coord",          "pix",    1.0, 0.0);
     351    gfits_define_bintable_column (&theader, "E", "Y_FIX",    "ccd y fiex coord",           "pix",    1.0, 0.0);
    344352    gfits_define_bintable_column (&theader, "E", "EXPTIME",  "-2.5 * log (exposure time)", "sec",    1.0, 0.0);
    345353    gfits_define_bintable_column (&theader, "J", "TIME",     "time of exp",                "sec",    1.0, 1.0*0x8000);
     
    363371    float *Xccd      ; ALLOCATE (Xccd     ,  float, catalog->Nmeasure);
    364372    float *Yccd      ; ALLOCATE (Yccd     ,  float, catalog->Nmeasure);
     373    float *Xfix      ; ALLOCATE (Xfix     ,  float, catalog->Nmeasure);
     374    float *Yfix      ; ALLOCATE (Yfix     ,  float, catalog->Nmeasure);
    365375    float *dt        ; ALLOCATE (dt       ,  float, catalog->Nmeasure);
    366376    int   *t         ; ALLOCATE (t        ,  int  , catalog->Nmeasure);
     
    383393      Xccd[i]     = measure[i].Xccd     ;
    384394      Yccd[i]     = measure[i].Yccd     ;
     395      Xfix[i]     = measure[i].Xfix     ;
     396      Yfix[i]     = measure[i].Yfix     ;
    385397      dt[i]       = measure[i].dt       ;
    386398      t[i]        = measure[i].t        ;
     
    402414    gfits_set_bintable_column (&theader, &ftable, "X_CCD",      Xccd,      catalog->Nmeasure);
    403415    gfits_set_bintable_column (&theader, &ftable, "Y_CCD",      Yccd,      catalog->Nmeasure);
     416    gfits_set_bintable_column (&theader, &ftable, "X_FIX",      Xfix,      catalog->Nmeasure);
     417    gfits_set_bintable_column (&theader, &ftable, "Y_FIX",      Yfix,      catalog->Nmeasure);
    404418    gfits_set_bintable_column (&theader, &ftable, "EXPTIME",    dt,        catalog->Nmeasure);
    405419    gfits_set_bintable_column (&theader, &ftable, "TIME",       t,         catalog->Nmeasure);
     
    419433    free (Xccd    );
    420434    free (Yccd    );
     435    free (Xfix    );
     436    free (Yfix    );
    421437    free (dt      );
    422438    free (t       );
     
    453469    gfits_define_bintable_column (&theader, "J", "MEAN_EPOCH",  "mean epoch (PM-PAR ref)",                                "", 1.0, 1.0*0x8000);
    454470    gfits_define_bintable_column (&theader, "J", "TIME_RANGE",  "mean epoch (PM-PAR ref)",                                "", 1.0, 1.0*0x8000);
    455     gfits_define_bintable_column (&theader, "E", "SIGMA_POS",   "position scatter",                                       "", 1.0, 0.0);   
     471    gfits_define_bintable_column (&theader, "E", "STARGAL_SEP", "star/galaxy separator",                                  "", 1.0, 0.0);   
    456472    gfits_define_bintable_column (&theader, "I", "NUMBER_POS",  "number of detections used for astrometry",               "", 1.0, 1.0*0x80);
    457473    gfits_define_bintable_column (&theader, "I", "NMEASURE",    "number of psf measurements",                             "", 1.0, 1.0*0x80);
  • trunk/Ohana/src/relastro/src/ConfigInit.c

    r34749 r35105  
    3535  GetConfig (config, "RELASTRO_DPOS_MAX",      "%lf", 0, &DPOS_MAX);
    3636  GetConfig (config, "ADDSTAR_RADIUS",         "%lf", 0, &ADDSTAR_RADIUS);
     37
     38  if (!ScanConfig (config, "USE_FIXED_PIXCOORDS", "%d", 0, &USE_FIXED_PIXCOORDS)) {
     39    USE_FIXED_PIXCOORDS = FALSE;
     40  }
    3741
    3842  // force CATDIR to be absolute (so parallel mode will work)
  • trunk/Ohana/src/relastro/src/ImageOps.c

    r34749 r35105  
    178178        int found = FALSE;
    179179        for (k = 0; (k < NphotcodesSkip) && !found; k++) {
    180           if (photcodesSkip[k][0].code == catalog[i].measure[j].photcode) found = TRUE;
    181           if (photcodesSkip[k][0].code == GetPhotcodeEquivCodebyCode(catalog[i].measure[j].photcode)) found = TRUE;
     180          if (photcodesSkip[k][0].code == catalog[i].measureT[j].photcode) found = TRUE;
     181          if (photcodesSkip[k][0].code == GetPhotcodeEquivCodebyCode(catalog[i].measureT[j].photcode)) found = TRUE;
    182182        }
    183183        if (found) continue;
     
    446446    Measure *measure = &catalog[c].measure[m];
    447447
    448     X = measure[0].Xccd;
    449     Y = measure[0].Yccd;
     448    if (USE_FIXED_PIXCOORDS) {
     449      X = isfinite(measure[0].Xfix) ? measure[0].Xfix : measure[0].Xccd;
     450      Y = isfinite(measure[0].Yfix) ? measure[0].Yfix : measure[0].Yccd;
     451    } else {
     452      X = measure[0].Xccd;
     453      Y = measure[0].Yccd;
     454    }
    450455    n = measure[0].averef;
    451456
     
    570575    Measure *measure = &catalog[c].measure[m];
    571576
    572     X = measure[0].Xccd;
    573     Y = measure[0].Yccd;
     577    if (USE_FIXED_PIXCOORDS) {
     578      X = isfinite(measure[0].Xfix) ? measure[0].Xfix : measure[0].Xccd;
     579      Y = isfinite(measure[0].Yfix) ? measure[0].Yfix : measure[0].Yccd;
     580    } else {
     581      X = measure[0].Xccd;
     582      Y = measure[0].Yccd;
     583    }
    574584    n = measure[0].averef;
    575585
     
    635645
    636646    /* apply the current image transformation or use the current value of R+dR, D+dD? */
    637     raw[i].X = measure[0].Xccd;
    638     raw[i].Y = measure[0].Yccd;
     647    if (USE_FIXED_PIXCOORDS) {
     648      raw[i].X = isfinite(measure[0].Xfix) ? measure[0].Xfix : measure[0].Xccd;
     649      raw[i].Y = isfinite(measure[0].Yfix) ? measure[0].Yfix : measure[0].Yccd;
     650    } else {
     651      raw[i].X = measure[0].Xccd;
     652      raw[i].Y = measure[0].Yccd;
     653    }
    639654
    640655    raw[i].Mag  = measure[0].M;
  • trunk/Ohana/src/relastro/src/StarMaps.c

    r34088 r35105  
    7373    if (N < 0) continue;
    7474
     75    // NOTE: we use Xccd,Yccd even if USE_FIXED_PIXCOORDS is true: the difference is too
     76    // small to be relevant for this analysis
    7577    xbin = measure[0].Xccd / starmap[N].Nx;
    7678    ybin = measure[0].Yccd / starmap[N].Ny;
  • trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r34405 r35105  
    117117    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       strcpy (command, tmpline); }
    118118   
     119    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
     120
    119121    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    120122    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
  • trunk/Ohana/src/relastro/src/high_speed_catalogs.c

    r33963 r35105  
    154154    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);          strcpy (command, tmpline); }
    155155   
     156    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
     157
    156158    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    157159    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
  • trunk/Ohana/src/relastro/src/load_catalogs.c

    r34405 r35105  
    158158    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       strcpy (command, tmpline); }
    159159   
     160    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
     161
    160162    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    161163    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
  • trunk/Ohana/src/relastro/src/relastro_objects.c

    r34576 r35105  
    150150    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       strcpy (command, tmpline); }
    151151   
     152    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
     153
    152154    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    153155    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
Note: See TracChangeset for help on using the changeset viewer.