IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34873


Ignore:
Timestamp:
Dec 23, 2012, 6:48:28 AM (14 years ago)
Author:
eugene
Message:

add -cpt and -region to setphot, setastrom, setposangle, delstar

Location:
branches/eam_branches/ipp-20121219/Ohana/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121219/Ohana/src/libdvo/src/skyregion_ops.c

    r34872 r34873  
    1111char *filebasename_ptr (char *name) {
    1212 
    13   char *c, *file;
     13  char *c;
    1414
    1515  c = strrchr (name, '/');
     
    2121SkyList *SkyRegionByCPT (SkyTable *table, char *filename) {
    2222 
    23   int i, Ns, Ne, No;
    24   SkyRegion *region;
     23  int i;
    2524  SkyList *list;
    2625
     
    4443
    4544  for (i = 0; i < table[0].Nregions; i++) {
    46     char *regbase = filebasename_ptr (table[0].region[i].name);
     45    char *regbase = filebasename_ptr (table[0].regions[i].name);
    4746    if (strncmp (regbase, tgtbase, Ntgtbase)) continue;
    4847
    49     list[0].regions[0] = &table[0].region[i];
     48    list[0].regions[0] = &table[0].regions[i];
    5049    list[0].filename[0] = table[0].filename[i];
    5150    list[0].Nregions = 1;
    5251    return (list);
    5352  }
     53 
     54  free (list[0].regions);
     55  free (list[0].filename);
     56  free (list);
    5457  return NULL;
    5558}
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/include/setastrom.h

    r34868 r34873  
    2323int          PARALLEL_SERIAL;
    2424char        *UPDATE_CATFORMAT;
     25char        *SINGLE_CPT;
    2526
    2627SkyRegion    UserPatch;
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/include/setphot.h

    r33963 r34873  
    2525char        *HOSTDIR;
    2626char        *IMAGES;
     27char        *SINGLE_CPT;
    2728int          VERBOSE;
    2829int          RESET;
     
    3435int          PARALLEL_SERIAL;
    3536int          IMAGES_ONLY;
     37
     38SkyRegion    UserPatch;
    3639
    3740/***** prototypes ****/
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/include/setphot_client.h

    r33654 r34873  
    7878time_t       TSTOP;
    7979PhotCode    *photcode;
     80
     81SkyRegion    UserPatch;
    8082
    8183enum {black, white, red, orange, yellow, green, blue, indigo, violet};
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/include/setposangle.h

    r34749 r34873  
    2525char        *HOSTDIR;
    2626char        *IMAGES;
     27char        *SINGLE_CPT;
    2728int          VERBOSE;
    2829int          RESET;
     
    3132int          PARALLEL_MANUAL;
    3233int          PARALLEL_SERIAL;
     34
     35SkyRegion    UserPatch;
    3336
    3437/***** prototypes ****/
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/initialize_setastrom.c

    r34868 r34873  
    4949  int N;
    5050
     51  SINGLE_CPT = NULL;
     52  if ((N = get_argument (argc, argv, "-cpt"))) {
     53    remove_argument (N, &argc, argv);
     54    SINGLE_CPT = strcreate (argv[N]);
     55    remove_argument (N, &argc, argv);
     56  }
     57
    5158  /* specify portion of the sky : allow default of all sky? */
    5259  UserPatch.Rmin = 0;
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/initialize_setphot.c

    r34749 r34873  
    4949  if ((N = get_argument (argc, argv, "-reset"))) {
    5050    RESET = TRUE;
     51    remove_argument (N, &argc, argv);
     52  }
     53
     54  SINGLE_CPT = NULL;
     55  if ((N = get_argument (argc, argv, "-cpt"))) {
     56    remove_argument (N, &argc, argv);
     57    SINGLE_CPT = strcreate (argv[N]);
     58    remove_argument (N, &argc, argv);
     59  }
     60
     61  // region of interest
     62  UserPatch.Rmin = 0;
     63  UserPatch.Rmax = 360;
     64  UserPatch.Dmin = -90;
     65  UserPatch.Dmax = +90;
     66  if ((N = get_argument (argc, argv, "-region"))) {
     67    remove_argument (N, &argc, argv);
     68    UserPatch.Rmin = atof (argv[N]);
     69    remove_argument (N, &argc, argv);
     70    UserPatch.Rmax = atof (argv[N]);
     71    remove_argument (N, &argc, argv);
     72    UserPatch.Dmin = atof (argv[N]);
     73    remove_argument (N, &argc, argv);
     74    UserPatch.Dmax = atof (argv[N]);
    5175    remove_argument (N, &argc, argv);
    5276  }
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/initialize_setphot_client.c

    r34749 r34873  
    3636  if ((N = get_argument (argc, argv, "-reset"))) {
    3737    RESET = TRUE;
     38    remove_argument (N, &argc, argv);
     39  }
     40
     41  // region of interest
     42  UserPatch.Rmin = 0;
     43  UserPatch.Rmax = 360;
     44  UserPatch.Dmin = -90;
     45  UserPatch.Dmax = +90;
     46  if ((N = get_argument (argc, argv, "-region"))) {
     47    remove_argument (N, &argc, argv);
     48    UserPatch.Rmin = atof (argv[N]);
     49    remove_argument (N, &argc, argv);
     50    UserPatch.Rmax = atof (argv[N]);
     51    remove_argument (N, &argc, argv);
     52    UserPatch.Dmin = atof (argv[N]);
     53    remove_argument (N, &argc, argv);
     54    UserPatch.Dmax = atof (argv[N]);
    3855    remove_argument (N, &argc, argv);
    3956  }
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/initialize_setposangle.c

    r34872 r34873  
    170170  }
    171171
     172  // region of interest
     173  UserPatch.Rmin = 0;
     174  UserPatch.Rmax = 360;
     175  UserPatch.Dmin = -90;
     176  UserPatch.Dmax = +90;
     177  if ((N = get_argument (argc, argv, "-region"))) {
     178    remove_argument (N, &argc, argv);
     179    UserPatch.Rmin = atof (argv[N]);
     180    remove_argument (N, &argc, argv);
     181    UserPatch.Rmax = atof (argv[N]);
     182    remove_argument (N, &argc, argv);
     183    UserPatch.Dmin = atof (argv[N]);
     184    remove_argument (N, &argc, argv);
     185    UserPatch.Dmax = atof (argv[N]);
     186    remove_argument (N, &argc, argv);
     187  }
     188
    172189  HOST_ID = 0;
    173190  if ((N = get_argument (argc, argv, "-hostID"))) {
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/update_dvo_setastrom.c

    r34868 r34873  
    2020
    2121  // determine the populated SkyRegions overlapping the requested area (default depth)
    22   skylist = SkyListByPatch (sky, -1, &UserPatch);
     22  if (SINGLE_CPT) {
     23      skylist = SkyRegionByCPT (sky, SINGLE_CPT);
     24  } else {
     25      skylist = SkyListByPatch (sky, -1, &UserPatch);
     26  }
     27  myAssert (skylist, "ooops!");
    2328
    2429  // update measurements for each populated catalog
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/update_dvo_setphot.c

    r33963 r34873  
    44int update_dvo_setphot (Image *image, off_t Nimage, FlatCorrectionTable *flatcorr) {
    55
    6   SkyRegion UserPatch;
    76  SkyTable *sky = NULL;
    87  SkyList *skylist = NULL;
     
    3433
    3534  // determine the populated SkyRegions overlapping the requested area (default depth)
    36   UserPatch.Rmin = 0;
    37   UserPatch.Rmax = 360;
    38   UserPatch.Dmin = -90;
    39   UserPatch.Dmax = +90;
    40   skylist = SkyListByPatch (sky, -1, &UserPatch);
     35  if (SINGLE_CPT) {
     36      skylist = SkyRegionByCPT (sky, SINGLE_CPT);
     37  } else {
     38      skylist = SkyListByPatch (sky, -1, &UserPatch);
     39  }
     40  myAssert (skylist, "ooops!");
    4141
    4242  // update measurements for each populated catalog
     
    110110
    111111    char command[1024];
    112     snprintf (command, 1024, "setphot_client -hostID %d -catdir %s -hostdir %s -images %s",
    113               table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile);
     112    snprintf (command, 1024, "setphot_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
     113              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
     114              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    114115
    115116    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ipp-20121219/Ohana/src/uniphot/src/update_dvo_setposangle.c

    r34872 r34873  
    33int update_dvo_setposangle (ImageSubset *image, off_t Nimage) {
    44
    5   SkyRegion UserPatch;
    65  SkyTable *sky = NULL;
    76  SkyList *skylist = NULL;
     
    3635
    3736  // determine the populated SkyRegions overlapping the requested area (default depth)
    38   if (!SINGLE_CPT) {
     37  if (SINGLE_CPT) {
     38      skylist = SkyRegionByCPT (sky, SINGLE_CPT);
     39  } else {
    3940      skylist = SkyListByPatch (sky, -1, &UserPatch);
    40   } else {
    41       skylist = SkyListByCPT (sky, cptname);
    4241  }
    4342  myAssert (skylist, "ooops!");
     
    114113
    115114    char command[1024];
    116     snprintf (command, 1024, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s -region STUFF",
    117               table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile);
     115    snprintf (command, 1024, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
     116              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
     117              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    118118
    119119    fprintf (stderr, "command: %s\n", command);
Note: See TracChangeset for help on using the changeset viewer.