IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34872


Ignore:
Timestamp:
Dec 22, 2012, 3:19:47 PM (14 years ago)
Author:
eugene
Message:

add -cpt options to setposangle and delstar

Location:
branches/eam_branches/ipp-20121219/Ohana/src
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121219/Ohana/src/delstar/Makefile

    r34749 r34872  
    3131$(SRC)/delete_image_photcodes.$(ARCH).o \
    3232$(SRC)/delete_photcodes.$(ARCH).o \
     33$(SRC)/delete_photcodes_single.$(ARCH).o \
    3334$(SRC)/delete_times.$(ARCH).o     \
    3435$(SRC)/gimages.$(ARCH).o          \
     
    4546$(SRC)/args.$(ARCH).o             \
    4647$(SRC)/delete_photcodes.$(ARCH).o \
     48$(SRC)/delete_photcodes_single.$(ARCH).o \
    4749$(SRC)/Shutdown.$(ARCH).o         
    4850
  • branches/eam_branches/ipp-20121219/Ohana/src/delstar/include/delstar.h

    r34844 r34872  
    100100int delete_photcodes_catalog (Catalog *catalog, PhotCode **photcodes, int Nphotcodes);
    101101int delete_image_photcodes (FITS_DB *db);
     102int delete_photcodes_single (char *cptname);
  • branches/eam_branches/ipp-20121219/Ohana/src/delstar/src/args.c

    r34844 r34872  
    169169goodtime:
    170170
     171  if ((N = get_argument (argc, argv, "-cpt"))) {
     172    remove_argument (N, &argc, argv);
     173    char *filename = strcreate (argv[N]);
     174    remove_argument (N, &argc, argv);
     175
     176    if (argc != 1) {
     177      fprintf (stderr, "USAGE: delstar -cpt filename.cpt\n");
     178      exit (2);
     179    }
     180
     181    switch (MODE) {
     182      case MODE_IMAGEFILE:
     183      case MODE_IMAGENAME:
     184      case MODE_TIME:
     185      case MODE_ORPHAN:
     186      case MODE_MISSED:
     187        fprintf (stderr, "mode not available for single cpt deletion\n");
     188        break;
     189      case MODE_PHOTCODES: {
     190        if (!delete_photcodes_single (filename)) {
     191          fprintf (stderr, "failure deleting measurements\n");
     192          exit (1);
     193        }
     194        exit (0);
     195      }
     196      default:
     197        usage ();
     198    }
     199    exit (0);
     200  }
     201
    171202  /* restrict to a single photcode (not compatible with -image)
    172   PHOTCODE = NULL;
    173   if ((N = get_argument (argc, argv, "-photcode"))) {
    174     remove_argument (N, &argc, argv);
    175     PHOTCODE = GetPhotcodebyName (argv[N]);
    176     remove_argument (N, &argc, argv);
    177   }*/
     203     PHOTCODE = NULL;
     204     if ((N = get_argument (argc, argv, "-photcode"))) {
     205     remove_argument (N, &argc, argv);
     206     PHOTCODE = GetPhotcodebyName (argv[N]);
     207     remove_argument (N, &argc, argv);
     208     }*/
    178209
    179210  if (argc != 1) usage ();
  • branches/eam_branches/ipp-20121219/Ohana/src/libdvo/include/dvo.h

    r34844 r34872  
    658658SkyTable  *SkyTableLoadOptimal     PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE));
    659659int        SkyTableSetDepth        PROTO((SkyTable *sky, int depth));
     660SkyList   *SkyRegionByCPT          PROTO((SkyTable *table, char *filename));
    660661SkyList   *SkyRegionByPoint        PROTO((SkyTable *table, int depth, double ra, double dec));
    661662SkyList   *SkyListByPoint          PROTO((SkyTable *table, double ra, double dec));
  • branches/eam_branches/ipp-20121219/Ohana/src/libdvo/src/skyregion_ops.c

    r33649 r34872  
    77   If the region at the given depth is populated with an image table, then 'image' is TRUE.
    88   I have defined no accelerators other than the table hierarchy */
     9
     10/* given /path/file.ext return pointer to file.ext */
     11char *filebasename_ptr (char *name) {
     12 
     13  char *c, *file;
     14
     15  c = strrchr (name, '/');
     16  if (c) return (c+1);
     17  return name;
     18}
     19
     20/* find region which matches the named file */
     21SkyList *SkyRegionByCPT (SkyTable *table, char *filename) {
     22 
     23  int i, Ns, Ne, No;
     24  SkyRegion *region;
     25  SkyList *list;
     26
     27  ALLOCATE (list, SkyList, 1);
     28  ALLOCATE (list[0].regions,  SkyRegion *, 1);
     29  ALLOCATE (list[0].filename,  char *, 1);
     30  list[0].Nregions = 0;
     31  list[0].ownElements = FALSE; // this list is only holding a view to the elements
     32  strcpy (list[0].hosts, table[0].hosts);
     33
     34  // i'd like to select the region from the given cpt filename, but
     35  // in a parallel environment, the filename does not match the canonical name
     36  // i select the basename to match
     37
     38  // we might have been given foo.cpt or just foo:
     39  char *tgtbase = filebasename_ptr (filename);
     40  int Ntgtbase = strlen(tgtbase);
     41  if ((Ntgtbase > 4) && (!strcmp (&tgtbase[Ntgtbase - 4], ".cpt"))) {
     42    Ntgtbase -= 4;
     43  }
     44
     45  for (i = 0; i < table[0].Nregions; i++) {
     46    char *regbase = filebasename_ptr (table[0].region[i].name);
     47    if (strncmp (regbase, tgtbase, Ntgtbase)) continue;
     48
     49    list[0].regions[0] = &table[0].region[i];
     50    list[0].filename[0] = table[0].filename[i];
     51    list[0].Nregions = 1;
     52    return (list);
     53  }
     54  return NULL;
     55}
    956
    1057/* find region which overlaps c at given depth (-1 : populated ) */
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/initialize_setposangle.c

    r34844 r34872  
    5858  // XXX for now, hardwire gpc1 photcodes
    5959
     60  SINGLE_CPT = NULL;
     61  if ((N = get_argument (argc, argv, "-cpt"))) {
     62    remove_argument (N, &argc, argv);
     63    SINGLE_CPT = strcreate (argv[N]);
     64    remove_argument (N, &argc, argv);
     65  }
     66
     67  // region of interest
     68  UserPatch.Rmin = 0;
     69  UserPatch.Rmax = 360;
     70  UserPatch.Dmin = -90;
     71  UserPatch.Dmax = +90;
     72  if ((N = get_argument (argc, argv, "-region"))) {
     73    remove_argument (N, &argc, argv);
     74    UserPatch.Rmin = atof (argv[N]);
     75    remove_argument (N, &argc, argv);
     76    UserPatch.Rmax = atof (argv[N]);
     77    remove_argument (N, &argc, argv);
     78    UserPatch.Dmin = atof (argv[N]);
     79    remove_argument (N, &argc, argv);
     80    UserPatch.Dmax = atof (argv[N]);
     81    remove_argument (N, &argc, argv);
     82  }
     83
    6084  PARALLEL = FALSE;
    6185  if ((N = get_argument (argc, argv, "-parallel"))) {
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/update_dvo_setposangle.c

    r34749 r34872  
    3636
    3737  // determine the populated SkyRegions overlapping the requested area (default depth)
    38   UserPatch.Rmin = 0;
    39   UserPatch.Rmax = 360;
    40   UserPatch.Dmin = -90;
    41   UserPatch.Dmax = +90;
    42   skylist = SkyListByPatch (sky, -1, &UserPatch);
     38  if (!SINGLE_CPT) {
     39      skylist = SkyListByPatch (sky, -1, &UserPatch);
     40  } else {
     41      skylist = SkyListByCPT (sky, cptname);
     42  }
     43  myAssert (skylist, "ooops!");
    4344
    4445  // update measurements for each populated catalog
     
    113114
    114115    char command[1024];
    115     snprintf (command, 1024, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s",
     116    snprintf (command, 1024, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s -region STUFF",
    116117              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile);
    117118
Note: See TracChangeset for help on using the changeset viewer.