IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 21, 2010, 6:04:41 PM (16 years ago)
Author:
eugene
Message:

add options for different cmf types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/largefiles.20100314/Ohana/src/addstar/src/mkcmf.c

    r20936 r27379  
    5656  }
    5757
     58  // add support for all cmf types
     59  static char *type = "PS1_V1";
     60  if ((N = get_argument (argc, argv, "-type"))) {
     61    remove_argument (N, &argc, argv);
     62    type = strcreate (argv[N]);
     63    remove_argument (N, &argc, argv);
     64  }
     65
    5866  if (argc != 3) {
    59     fprintf (stderr, "USAGE mkcmf (input) (output) [-date date] [-time time] [-radec ra dec]\n");
     67    fprintf (stderr, "USAGE mkcmf (input) (output) [-date date] [-time time] [-radec ra dec] [-cmftype type]\n");
    6068    exit (2);
    6169  }
     
    8694
    8795  // XXX add gaussian-distributed noise based on counts
     96  // this needs to make different output 'stars' entries depending on the desired type
    8897  ALLOCATE (stars, PS1_DEV_1, Nstars);
    8998  gauss_init (2048);
     
    162171
    163172  ftable.header = &theader;
    164   gfits_table_set_PS1_DEV_1 (&ftable, stars, Nstars);
     173
     174  // set up desired CMF type:
     175  found = FALSE;
     176  if (!strcmp(type, "PS1_DEV_0")) {
     177    gfits_table_set_PS1_DEV_1 (&ftable, stars, Nstars);
     178    gfits_modify (&theader, "EXTTYPE",   "%s", 1, "PS1_DEV_0");
     179    found = TRUE;
     180  }
     181  if (!strcmp(type, "PS1_DEV_1")) {
     182    gfits_table_set_PS1_DEV_1 (&ftable, stars, Nstars);
     183    gfits_modify (&theader, "EXTTYPE",   "%s", 1, "PS1_DEV_1");
     184    found = TRUE;
     185  }
     186  if (!strcmp(type, "PS1_V1")) {
     187    gfits_table_set_PS1_V1 (&ftable, stars, Nstars);
     188    gfits_modify (&theader, "EXTTYPE",   "%s", 1, "PS1_V1");
     189    found = TRUE;
     190  }
     191  if (!strcmp(type, "PS1_V2")) {
     192    gfits_table_set_PS1_V2 (&ftable, stars, Nstars);
     193    gfits_modify (&theader, "EXTTYPE",   "%s", 1, "PS1_V2");
     194    found = TRUE;
     195  }
     196  if (!found) {
     197    fprintf (stderr, "ERROR: unknown CMF type %s\n", type);
     198    exit (1);
     199  }
     200
     201  gfits_modify (&theader, "EXTHEAD",   "%s", 1, "Chip.hdr");
    165202  gfits_modify (&theader, "EXTNAME",   "%s", 1, "Chip.psf");
    166   gfits_modify (&theader, "EXTTYPE",   "%s", 1, "PS1_DEV_1");
    167   gfits_modify (&theader, "EXTHEAD",   "%s", 1, "Chip.hdr");
    168203
    169204  fits = fopen (argv[2], "w");
Note: See TracChangeset for help on using the changeset viewer.