IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2454


Ignore:
Timestamp:
Nov 24, 2004, 1:57:57 PM (22 years ago)
Author:
eugene
Message:

minor fixes

Location:
trunk/Ohana/src/imregister
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/imregister/imreg/db.c

    r97 r2454  
    7171  table.header = &theader;
    7272  if (!fits_fread_header (f, &header))                  escape (UNLOCK, "ERROR: can't read primary header");
    73   if (!fits_fread_matrix (f, &matrix, &header))         escape (UNLOCK, "ERROR: can't read primary header");
    74   if (!fits_fread_ftable (f, &table, "IMAGE_DATABASE")) escape (UNLOCK, "ERROR: can't read primary header");
     73  if (!fits_fread_matrix (f, &matrix, &header))         escape (UNLOCK, "ERROR: can't read primary matrix");
     74  if (!fits_fread_ftable (f, &table, "IMAGE_DATABASE")) escape (UNLOCK, "ERROR: can't read table");
    7575
    7676  /* convert to internal format */
     
    8181
    8282  if (!ConvertStruct ((char *) image, sizeof (RegImage), Nimage, "regimage"))
    83     escape (UNLOCK, "ERROR: can't read primary header");
     83    escape (UNLOCK, "ERROR: can't convert data");
    8484
    8585  return (1);
  • trunk/Ohana/src/imregister/photreg/args.photreg.c

    r126 r2454  
    66int regargs (int argc, char **argv, PhotPars *newdata) {
    77
     8  int *list, Nlist;
    89  int N, required, Ntimes;
    910  double dtime;
    1011  unsigned long *tstart, *tstop;
    11   PhotCode *photcode;
     12  PhotCode *photcode, *depcode;
    1213
    1314  ConfigInit (&argc, argv);
     
    106107  */
    107108 
     109  /* find first (!) dep photcode which is equivalent to this code */
     110  list = GetPhotcodeEquivList (photcode[0].code, &Nlist);
     111  depcode = GetPhotcodebyCode (list[0]);
     112
    108113  newdata[0].photcode = photcode[0].code;
    109114  newdata[0].refcode  = photcode[0].equiv;
    110   newdata[0].K        = photcode[0].K;
    111   newdata[0].X        = photcode[0].X;
     115  newdata[0].X        = photcode[0].X[0];
    112116  newdata[0].c1       = photcode[0].c1;
    113117  newdata[0].c2       = photcode[0].c2;
    114118 
    115   newdata[0].ZPo      = 0.001*photcode[0].C;
     119  newdata[0].K        = depcode[0].K;
     120  newdata[0].ZPo      = 0.001*photcode[0].C + 0.001*depcode[0].C;
    116121  if (output.offset) newdata[0].ZP += newdata[0].ZPo;
    117122}
     
    125130   
    126131   photreg -photcode B -zp 26.1 -dzp 0.02 -date 2003/1/1,10:00:00 -Nmeas 5 -Ntime 1 -db trans
     132   photreg -photcode B -zp 26.1 -dzp 0.02 -date 2003/1/1,10:00:00 -Nmeas 5 -Ntime 1 -db trans
     133
    127134   photsearch -db trans
    128135   photsearch -db phot
  • trunk/Ohana/src/imregister/photreg/getImageData.c

    r126 r2454  
    6262  sprintf (photcode, "%s.%s.%02d", detector, filter, ccd);
    6363  if (!(criteria.photcode = GetPhotcodeCodebyName (photcode))) {
    64     fprintf (stderr, "ERROR: photcode not found table\n");
     64    fprintf (stderr, "ERR: photcode not found table\n");
    6565    exit (1);
    6666  }
  • trunk/Ohana/src/imregister/photreg/output.c

    r93 r2454  
    22# include "photreg.h"
    33
     4static char PhotError[] = "unknown";
     5static char PhotNA[] = "unknown";
    46static char *ASCIIName = (char *) NULL;
    57
     
    3335void DumpFitsBintable (char *filename, PhotPars *photdata, int *match, int Nmatch) {
    3436
    35   int i, j, Nx;
     37  int i, j;
    3638  Header header, theader;
    3739  Matrix matrix;
     
    6567  FILE *f;
    6668  char *startstr, *stopstr, *datestr, *line;
    67   char *c1, *c2, *code;
    68   int i, n;
     69  char *c1, *c2, *code, *photsys;
     70  int i;
    6971  unsigned int tsecond;
    7072
     
    8789     
    8890  /* define table layout */
    89   fits_define_table_column (&theader, "F8.4", "ZP_OBS",     "measured zero point",       "mag");
    90   fits_define_table_column (&theader, "F8.4", "ZP_REF",     "nominal zero point",        "mag");
    91   fits_define_table_column (&theader, "F7.4", "ZP_ERR",     "error on zero point",       "mag");
    92   fits_define_table_column (&theader, "F7.3", "C_AIRMASS",  "airmass coeff",             "mag per airmass");
    93   fits_define_table_column (&theader, "F6.3", "C_COLOR",    "color coeff",               "mag per mag");
    94   fits_define_table_column (&theader, "A20",  "START_TIME", "start time of measurement", "yyyy/mm/dd,hh:mm:ss");
    95   fits_define_table_column (&theader, "A20",  "STOP_TIME",  "stop time of measurement",  "yyyy/mm/dd,hh:mm:ss");
    96   fits_define_table_column (&theader, "A12",  "C1_NAME",    "filter 1 for color",        "");
    97   fits_define_table_column (&theader, "A12",  "C2_NAME",    "filter 2 for color",        "");
    98   fits_define_table_column (&theader, "I6",   "NSTARS",     "number of stars used",      "");
    99   fits_define_table_column (&theader, "I6",   "NTIMES",     "number of unique images",   "");
    100   fits_define_table_column (&theader, "A12",  "FILTER",     "filter",                    "");
    101   fits_define_table_column (&theader, "A70",  "LABEL",      "data label",                "");
     91  fits_define_table_column (&theader, "F8.4", "ZP_OBS",       "measured zero point",       "mag");
     92  fits_define_table_column (&theader, "F8.4", "ZP_REF",       "nominal zero point",        "mag");
     93  fits_define_table_column (&theader, "F7.4", "ZP_ERR",       "error on zero point",       "mag");
     94  fits_define_table_column (&theader, "F7.3", "C_AIRMASS",    "airmass coeff",             "mag per airmass");
     95  fits_define_table_column (&theader, "F6.3", "C_COLOR",      "color coeff",               "mag per mag");
     96  fits_define_table_column (&theader, "A20",  "START_TIME",   "start time of measurement", "yyyy/mm/dd,hh:mm:ss");
     97  fits_define_table_column (&theader, "A20",  "STOP_TIME",    "stop time of measurement",  "yyyy/mm/dd,hh:mm:ss");
     98  fits_define_table_column (&theader, "A12",  "C1_NAME",      "filter 1 for color",        "");
     99  fits_define_table_column (&theader, "A12",  "C2_NAME",      "filter 2 for color",        "");
     100  fits_define_table_column (&theader, "I6",   "NSTARS",       "number of stars used",      "");
     101  fits_define_table_column (&theader, "I6",   "NTIMES",       "number of unique images",   "");
     102  fits_define_table_column (&theader, "A12",  "INT_PHOT_SYS", "internal photom system",    "");
     103  fits_define_table_column (&theader, "A12",  "REF_PHOT_SYS", "reference photom system",   "");
     104  fits_define_table_column (&theader, "A70",  "LABEL",        "data label",                "");
    102105 
    103106  /* define TNULL, TNVAL values */
     
    113116  fits_modify (&theader, "TNULL10", "%s", 1, "NULL");  /* NSTARS     */
    114117  fits_modify (&theader, "TNULL11", "%s", 1, "NULL");  /* NTIMES     */
    115   fits_modify (&theader, "TNULL12", "%s", 1, "NULL");  /* FILTER     */
    116   fits_modify (&theader, "TNULL13", "%s", 1, "NULL");  /* LABEL      */
    117 
    118   fits_modify (&theader, "TNVAL1",  "%s", 1, "Inf");   /* ZP_OBS     */
    119   fits_modify (&theader, "TNVAL2",  "%s", 1, "Inf");   /* ZP_REF     */
    120   fits_modify (&theader, "TNVAL3",  "%s", 1, "Inf");   /* ZP_ERR     */
    121   fits_modify (&theader, "TNVAL4",  "%s", 1, "Inf");   /* C_AIRMASS  */
    122   fits_modify (&theader, "TNVAL5",  "%s", 1, "Inf");   /* C_COLOR    */
    123   fits_modify (&theader, "TNVAL6",  "%s", 1, "NA");    /* START_TIME */
    124   fits_modify (&theader, "TNVAL7",  "%s", 1, "NA");    /* STOP_TIME  */
    125   fits_modify (&theader, "TNVAL8",  "%s", 1, "NA");    /* C1_NAME    */
    126   fits_modify (&theader, "TNVAL9",  "%s", 1, "NA");    /* C2_NAME    */
    127   fits_modify (&theader, "TNVAL10", "%s", 1, "NA");    /* NSTARS     */
    128   fits_modify (&theader, "TNVAL11", "%s", 1, "NA");    /* NTIMES     */
    129   fits_modify (&theader, "TNVAL12", "%s", 1, "NA");    /* FILTER     */
    130   fits_modify (&theader, "TNVAL13", "%s", 1, "NA");    /* LABEL      */
     118  fits_modify (&theader, "TNULL12", "%s", 1, "NULL");  /* INT_PHOT_SYS */
     119  fits_modify (&theader, "TNULL13", "%s", 1, "NULL");  /* REF_PHOT_SYS */
     120  fits_modify (&theader, "TNULL14", "%s", 1, "NULL");  /* LABEL      */
     121
     122  fits_modify (&theader, "TNVAL1",  "%s", 1, "Inf");   /* ZP_OBS       */
     123  fits_modify (&theader, "TNVAL2",  "%s", 1, "Inf");   /* ZP_REF       */
     124  fits_modify (&theader, "TNVAL3",  "%s", 1, "Inf");   /* ZP_ERR       */
     125  fits_modify (&theader, "TNVAL4",  "%s", 1, "Inf");   /* C_AIRMASS    */
     126  fits_modify (&theader, "TNVAL5",  "%s", 1, "Inf");   /* C_COLOR      */
     127  fits_modify (&theader, "TNVAL6",  "%s", 1, "NA");    /* START_TIME   */
     128  fits_modify (&theader, "TNVAL7",  "%s", 1, "NA");    /* STOP_TIME    */
     129  fits_modify (&theader, "TNVAL8",  "%s", 1, "NA");    /* C1_NAME      */
     130  fits_modify (&theader, "TNVAL9",  "%s", 1, "NA");    /* C2_NAME      */
     131  fits_modify (&theader, "TNVAL10", "%s", 1, "NA");    /* NSTARS       */
     132  fits_modify (&theader, "TNVAL11", "%s", 1, "NA");    /* NTIMES       */
     133  fits_modify (&theader, "TNVAL12", "%s", 1, "NA");    /* INT_PHOT_SYS */
     134  fits_modify (&theader, "TNVAL13", "%s", 1, "NA");    /* REF_PHOT_SYS */
     135  fits_modify (&theader, "TNVAL14", "%s", 1, "NA");    /* LABEL        */
    131136
    132137  /* create table, add data values */
     
    138143    startstr = sec_to_date (newdata[0].tstart);
    139144    stopstr = sec_to_date (newdata[0].tstop);
    140     n = photcodes.hashcode[newdata[0].c1];
    141     c1 = photcodes.code[n].name;
    142     n = photcodes.hashcode[newdata[0].c2];
    143     c2 = photcodes.code[n].name;
    144     n = photcodes.hashcode[newdata[0].photcode];
    145     code = photcodes.code[n].name;
     145    code    = GetPhotcodeNamebyCode (newdata[0].photcode);
     146    photsys = GetPhotcodeNamebyCode (newdata[0].refcode);
     147    c1      = GetPhotcodeNamebyCode (newdata[0].c1);
     148    c2      = GetPhotcodeNamebyCode (newdata[0].c2);
     149    if (code    == (char *) NULL) code    = PhotNA;
     150    if (photsys == (char *) NULL) photsys = PhotNA;
     151    if (c1      == (char *) NULL) c1      = PhotNA;
     152    if (c2      == (char *) NULL) c2      = PhotNA;
    146153
    147154    line = fits_table_print (&table, newdata[0].ZP, newdata[0].ZPo, newdata[0].dZP,
    148155              newdata[0].K, newdata[0].X, startstr, stopstr,
    149               c1, c2, newdata[0].Nmeas, newdata[0].Ntime, code, newdata[0].label);
     156              c1, c2, newdata[0].Nmeas, newdata[0].Ntime, code, photsys, newdata[0].label);
    150157    if (!fits_add_rows (&table, line, 1, strlen(line))) escape (IGNORE, (FILE *) NULL, (char *) NULL, NULL, "error writing dataline");
    151158
     
    172179 
    173180  int i, j;
    174   char *photstr, *timestr, *c1, *c2;
     181  char *photstr, *timestr, *c1, *c2, *refcode;
    175182 
    176183  /* print the selected entries */
     
    183190   
    184191    /* convert photcode to filter name */
    185     photstr = GetPhotnamebyCode (&photcodes, photdata[i].photcode);
    186     c1      = GetPhotnamebyCode (&photcodes, photdata[i].c1);
    187     c2      = GetPhotnamebyCode (&photcodes, photdata[i].c2);
     192    photstr = GetPhotcodeNamebyCode (photdata[i].photcode);
     193    refcode = GetPhotcodeNamebyCode (photdata[i].refcode);
     194    c1      = GetPhotcodeNamebyCode (photdata[i].c1);
     195    c2      = GetPhotcodeNamebyCode (photdata[i].c2);
    188196    if (photstr == (char *) NULL) photstr = PhotError;
    189     if (c1      == (char *) NULL) photstr = PhotError;
    190     if (c2      == (char *) NULL) photstr = PhotError;
     197    if (refcode == (char *) NULL) refcode = PhotError;
     198    if (c1      == (char *) NULL) c1      = PhotError;
     199    if (c2      == (char *) NULL) c2      = PhotError;
    191200     
    192     fprintf (stdout, "%s %s  %7.4f %7.4f %7.4f  %3d %3d  %7.4f %7.4f  %s %s %s\n",
    193              photstr, timestr, photdata[i].ZP, photdata[i].ZPo, photdata[i].dZP, photdata[i].Nmeas, photdata[i].Ntime, photdata[i].X, photdata[i].K, c1, c2, photdata[i].label);
     201    fprintf (stdout, "%s %s  %7.4f %7.4f %7.4f  %3d %3d  %7.4f %7.4f  %s  %s %s %s\n",
     202             photstr, timestr, photdata[i].ZP, photdata[i].ZPo, photdata[i].dZP, photdata[i].Nmeas, photdata[i].Ntime,
     203             photdata[i].X, photdata[i].K, refcode, c1, c2, photdata[i].label);
    194204    free (timestr);
    195205  }
Note: See TracChangeset for help on using the changeset viewer.