IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16781


Ignore:
Timestamp:
Mar 2, 2008, 2:21:11 PM (18 years ago)
Author:
eugene
Message:

add parsing of astrom / photom error terms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080223/Ohana/src/libdvo/src/LoadPhotcodesText.c

    r15694 r16781  
    2727  char *c;
    2828  char line[256], **c1_names, **c2_names, **eq_names;
    29   char name[32], type[32], Zero[32], Airmass[32], Offset[32],
    30     C1[32], C2[32], Slope[32], Color[32], Primary[32];
     29  char name[32], type[32], Zero[32], Airmass[32], Offset[32];
     30  char C1[32], C2[32], Slope[32], Color[32], Primary[32];
     31  char astromErrSys[32], astromErrScale[32], astromErrMagScale[32], photomErrSys[32];
    3132
    3233  table = GetPhotcodeTable ();
     
    6061    for (c = line; isspace (*c); c++);
    6162    if (*c == '#') continue;
    62     Nfield = sscanf (c, "%d %s %s %s %s %s %s %s %s %s %s",
    63                      &code, name, type, Zero, Airmass, Offset, C1, C2, Slope, Color, Primary);
    64 
    65     // XXX to add the AstromError (and PhotError) terms, we need to add them to the photcode structure, and
    66     // define methods to read (at least) the old and the new photcode versions.
    67 
    68     if (Nfield != 11) { continue; }
    69    
     63    Nfield = sscanf (c, "%d %s %s %s %s %s %s %s %s %s %s %s %s %s %s",
     64                     &code, name, type, Zero, Airmass, Offset, C1, C2, Slope, Color, Primary, astromErrSys, astromErrScale, astromErrMagScale, photomErrSys);
     65
     66    switch (Nfield) {
     67      case 11:
     68        // minimum number of fields : original elixir layout
     69        strcpy (astromErrSys,      "0.0");
     70        strcpy (astromErrScale,    "0.0");
     71        strcpy (astromErrMagScale, "0.0");
     72        strcpy (photomErrSys,      "0.0");
     73        break;
     74      case 14:
     75        // allow only astrom elements
     76        strcpy (photomErrSys,      "0.0");
     77        break;
     78      case 15:
     79        // all fields defined
     80        break;
     81      default:
     82        // skip unknown layouts
     83        continue;
     84    }
     85
    7086    if (!code) {
    7187        fprintf (stderr, "photcode values may not be 0: fix %s\n", name);
     
    95111      photcode[Ncode].type  = PHOT_ALT;
    96112    }
     113
     114    photcode[Ncode].astromErrSys      = atof (astromErrSys);
     115    photcode[Ncode].astromErrScale    = atof (astromErrScale);
     116    photcode[Ncode].astromErrMagScale = atof (astromErrMagScale);
     117    photcode[Ncode].photomErrSys      = atof (photomErrSys);
    97118
    98119    switch (photcode[Ncode].type) {
Note: See TracChangeset for help on using the changeset viewer.