IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4538


Ignore:
Timestamp:
Jul 12, 2005, 6:33:37 AM (21 years ago)
Author:
eugene
Message:

added 2mass quality flag selection

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

Legend:

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

    r4299 r4538  
    102102int MODE;
    103103char *DUMP;
     104char *SELECT_2MASS_QUALITY;
    104105
    105106time_t TIMEREF;
  • trunk/Ohana/src/addstar/src/args.c

    r4299 r4538  
    156156    remove_argument (N, &argc, argv);
    157157  }
     158  /* define 2MASS quality flags to keep */
     159  SELECT_2MASS_QUALITY = NULL;
     160  if ((N = get_argument (argc, argv, "-2massquality"))) {
     161    remove_argument (N, &argc, argv);
     162    SELECT_2MASS_QUALITY = strcreate (argv[N]);
     163    remove_argument (N, &argc, argv);
     164  }
    158165
    159166  /*** optional situations ***/
     
    189196  }
    190197
     198
    191199  if (argc != 2) {
    192200    fprintf (stderr, "USAGE: addstar (filename)\n");
  • trunk/Ohana/src/addstar/src/get2mass_as.c

    r4299 r4538  
    1616 
    1717  int FilterSkip, TimeSkip, Np;
    18   int i, Nstars, NSTARS, Nbyte, Nline, Nextra, code;
     18  int i, Nstars, NSTARS, Nbyte, Nline, Nextra, code, Qentry;
    1919  Stars *stars;
    2020  gzFile gf;
     21  char qc;
    2122  char *buffer, *filename;
    2223  char *p, *q, *ptr, *end, *tmp;
     
    3839      FilterSkip = 6;
    3940      TimeSkip = 23;
     41      Qentry   = 0;
    4042  }
    4143  if (thiscode[0].code == TM_H) {
    4244      FilterSkip = 10;
    4345      TimeSkip = 19;
     46      Qentry   = 1;
    4447  }
    4548  if (thiscode[0].code == TM_K) {
    4649      FilterSkip = 14;
    4750      TimeSkip = 15;
     51      Qentry   = 2;
    4852  }
    4953  if (!FilterSkip) Shutdown ("invalid photcode %d", thiscode[0].code);
     
    7680      if (DEC > 90) Shutdown ("weird DEC value: something is wrong");
    7781
    78       /* this test is now wrong */
     82      /* skip stars which are outside desired region */
    7983      if (DEC > DEC1) goto skip_star;
    8084      if (DEC < DEC0) goto skip_star;
     
    8892      dM = strtod (ptr, NULL);
    8993      time = get2mass_time (ptr, buffer, TimeSkip, Nbyte);
     94
     95      /* filter on the ph_qual flag for this filter (field 19) */
     96      if (SELECT_2MASS_QUALITY != NULL) {
     97        ptr = skipNbounds (p, '|', 18, Nbyte - (p - buffer));
     98        qc  = ptr[Qentry];
     99        if (strchr (SELECT_2MASS_QUALITY, qc) == NULL) goto skip_star;
     100      }
    90101
    91102      stars[Nstars].R     = RA;
Note: See TracChangeset for help on using the changeset viewer.