IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28214


Ignore:
Timestamp:
Jun 4, 2010, 8:00:11 AM (16 years ago)
Author:
eugene
Message:

fixed error in azimuth calculation (sidtime passed as hours not degrees); better warnings if STKeyword and Obseravatory Latitude are not found in config

Location:
trunk/Ohana/src/addstar/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/ConfigInit.c

    r27435 r28214  
    77  double ZERO_POINT;
    88  char *config, *file;
    9   char RadiusWord[80];
     9  char RadiusWord[80], tmpword[80];
    1010  char CatdirPhotcodeFile[256];
    1111  char MasterPhotcodeFile[256];
     
    6868  ScanConfig (config, "CCDNUM-KEYWORD",         "%s",  0, CCDNumKeyword);
    6969  ScanConfig (config, "ST-KEYWORD",             "%s",  0, STKeyword);
    70   ScanConfig (config, "OBSERVATORY-LATITUDE",   "%lf", 0, &Latitude);
    71   ScanConfig (config, "OBSERVATORY-LONGITUDE",  "%lf", 0, &Longitude);
     70
     71  ScanConfig (config, "OBSERVATORY-LATITUDE",   "%s",  0, tmpword);
     72  if (!strcasecmp(tmpword, "NONE")) {
     73      fprintf (stderr, "observatory latitude is not set\n");
     74      Latitude = NAN;
     75  } else {
     76      ScanConfig (config, "OBSERVATORY-LATITUDE",   "%lf", 0, &Latitude);
     77  }
     78  ScanConfig (config, "OBSERVATORY-LONGITUDE",   "%s",  0, tmpword);
     79  if (!strcasecmp(tmpword, "NONE")) {
     80      fprintf (stderr, "observatory longitude is not set\n");
     81      Longitude = NAN;
     82  } else {
     83      ScanConfig (config, "OBSERVATORY-LONGITUDE",  "%lf", 0, &Longitude);
     84  }
     85  fprintf (stderr, "observatory @ (%f,%f)\n", Longitude, Latitude);
     86
     87  if (!strcasecmp(STKeyword, "NONE")) {
     88      if (isnan(Longitude)) {
     89          fprintf (stderr, "WARNING: ST cannot be determined for this image (no ST Keyword, no longitude)\n");
     90      } else {
     91          fprintf (stderr, "ST Keyword is not defined, ST will be derived from time & longitude\n");
     92      }
     93  }
     94
    7295  ScanConfig (config, "SUBPIX_DATAFILE",        "%s",  0, SubpixDatafile);
    7396
  • trunk/Ohana/src/addstar/src/FilterStars.c

    r27435 r28214  
    5454    /* calculate accurate per-star airmass and azimuth */
    5555    stars[N].measure.airmass = airmass (image[0].secz, stars[N].average.R, stars[N].average.D, image[0].sidtime, image[0].latitude);
    56     stars[N].measure.az      = azimuth (image[0].sidtime - stars[N].average.R, stars[N].average.D, image[0].latitude);
     56    stars[N].measure.az      = azimuth (15.0*image[0].sidtime - stars[N].average.R, stars[N].average.D, image[0].latitude);
    5757    stars[N].measure.Mcal    = image[0].Mcal;
    5858    stars[N].measure.t       = image[0].tzero + 1e-4*stars[N].measure.Yccd*image[0].trate;  /* trate is in 0.1 msec / row */
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r27435 r28214  
    148148  image[0].fwhm_y = tmp * 25.0 * image[0].coords.cdelt1 * 3600.0;
    149149
    150   if (STKeyword[0]) {
     150  if (STKeyword[0] && strcasecmp(STKeyword, "NONE")) {
    151151    /* get ST (used for airmass calculation) */
    152152    gfits_scan (header, STKeyword, "%s", 1, line);
Note: See TracChangeset for help on using the changeset viewer.