IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35336


Ignore:
Timestamp:
Mar 30, 2013, 2:25:04 PM (13 years ago)
Author:
eugene
Message:

added region and cpt options, test case for dvosecfilt

Location:
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/include/dvomerge.h

    r35333 r35336  
    3636int    REPLACE_BY_PHOTCODE;
    3737
     38char *SINGLE_CPT;
    3839SkyRegion UserPatch;  // used by MODE CAT
    3940
     
    108109int        dvosecfilt_client_args  PROTO((int *argc, char **argv));
    109110
    110 int        dvosecfilt_catalogs     PROTO((SkyTable *insky, int Nsecfilt));
     111int        dvosecfilt_catalogs     PROTO((int Nsecfilt));
    111112int        dvosecfilt_parallel     PROTO((SkyTable *insky, int Nsecfilt));
    112113
  • branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/args.c

    r35333 r35336  
    179179  }
    180180
     181  SINGLE_CPT = NULL;
     182  if ((N = get_argument (*argc, argv, "-cpt"))) {
     183    remove_argument (N, argc, argv);
     184    SINGLE_CPT = strcreate (argv[N]);
     185    remove_argument (N, argc, argv);
     186  }
     187
     188  /* specify portion of the sky : allow default of all sky? */
     189  UserPatch.Rmin = 0;
     190  UserPatch.Rmax = 360;
     191  UserPatch.Dmin = -90;
     192  UserPatch.Dmax = +90;
     193  if ((N = get_argument (*argc, argv, "-region"))) {
     194    remove_argument (N, argc, argv);
     195    UserPatch.Rmin = atof (argv[N]);
     196    remove_argument (N, argc, argv);
     197    UserPatch.Rmax = atof (argv[N]);
     198    remove_argument (N, argc, argv);
     199    UserPatch.Dmin = atof (argv[N]);
     200    remove_argument (N, argc, argv);
     201    UserPatch.Dmax = atof (argv[N]);
     202    remove_argument (N, argc, argv);
     203  }
     204
    181205  PARALLEL = FALSE;
    182206  if ((N = get_argument (*argc, argv, "-parallel"))) {
     
    219243  PARALLEL_SERIAL = FALSE;
    220244
     245  SINGLE_CPT = NULL;
     246  if ((N = get_argument (*argc, argv, "-cpt"))) {
     247    remove_argument (N, argc, argv);
     248    SINGLE_CPT = strcreate (argv[N]);
     249    remove_argument (N, argc, argv);
     250  }
     251
     252  /* specify portion of the sky : allow default of all sky? */
     253  UserPatch.Rmin = 0;
     254  UserPatch.Rmax = 360;
     255  UserPatch.Dmin = -90;
     256  UserPatch.Dmax = +90;
     257  if ((N = get_argument (*argc, argv, "-region"))) {
     258    remove_argument (N, argc, argv);
     259    UserPatch.Rmin = atof (argv[N]);
     260    remove_argument (N, argc, argv);
     261    UserPatch.Rmax = atof (argv[N]);
     262    remove_argument (N, argc, argv);
     263    UserPatch.Dmin = atof (argv[N]);
     264    remove_argument (N, argc, argv);
     265    UserPatch.Dmax = atof (argv[N]);
     266    remove_argument (N, argc, argv);
     267  }
     268
    221269  HOST_ID = 0;
    222270  if ((N = get_argument (*argc, argv, "-hostID"))) {
  • branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/dvosecfilt.c

    r35333 r35336  
    1212  int Nsecfilt = atoi(argv[2]);
    1313
    14   // load the sky table for the existing database
    15   SkyTable *insky = SkyTableLoadOptimal (CATDIR, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE);
    16   SkyTableSetFilenames (insky, CATDIR, "cpt");
    17 
    18   dvosecfilt_catalogs (insky, Nsecfilt);
     14  dvosecfilt_catalogs (Nsecfilt);
    1915
    2016  exit (0);
  • branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c

    r35333 r35336  
    11# include "dvomerge.h"
    22
    3 int dvosecfilt_catalogs (SkyTable *insky, int Nsecfilt) {
     3int dvosecfilt_catalogs (int Nsecfilt) {
    44
    55  off_t i, j, k, NsecInput, Nstart;
     
    77  SecFilt *insec, *outsec;
    88  char filename[DVO_MAX_PATH];
     9  SkyList *skylist;
     10
     11  SkyTable *sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE);
     12  SkyTableSetFilenames (sky, CATDIR, "cpt");
    913
    1014  if (PARALLEL && !HOST_ID) {
    11     int status = dvosecfilt_parallel (insky, Nsecfilt);
     15    int status = dvosecfilt_parallel (sky, Nsecfilt);
    1216    return status;
    1317  }
    1418
     19  // determine the populated SkyRegions overlapping the requested area (default depth)
     20  if (SINGLE_CPT) {
     21      skylist = SkyRegionByCPT (sky, SINGLE_CPT);
     22  } else {
     23      skylist = SkyListByPatch (sky, -1, &UserPatch);
     24  }
     25  myAssert (skylist, "ooops!");
     26
    1527  // loop over all input catalogs
    16   for (i = 0; i < insky[0].Nregions; i++) {
    17     if (!insky[0].regions[i].table) continue;
    18     if (VERBOSE) fprintf (stderr, "table: %s\n", insky[0].regions[i].name);
     28  for (i = 0; i < skylist->Nregions; i++) {
     29    if (!skylist->regions[i]->table) continue;
     30    if (VERBOSE) fprintf (stderr, "table: %s\n", skylist->regions[i]->name);
    1931
    2032    // does this host ID match the desired location for the table?
    21     if (!HostTableTestHost(&insky[0].regions[i], HOST_ID)) continue;
     33    if (!HostTableTestHost(skylist->regions[i], HOST_ID)) continue;
    2234
    2335    char hostfile[1024];
    24     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, insky[0].regions[i].name);
    25     catalog.filename  = HOST_ID ? hostfile : insky[0].filename[i];
     36    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
     37    catalog.filename  = HOST_ID ? hostfile : skylist->filename[i];
    2638
    2739    // always load all of the data (if any exists)
     
    3143    catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
    3244
    33     if (!dvo_catalog_open (&catalog, &insky[0].regions[i], VERBOSE, "w")) {
     45    if (!dvo_catalog_open (&catalog, skylist->regions[i], VERBOSE, "w")) {
    3446        fprintf (stderr, "ERROR: failure to open catalog file %s\n", filename);
    3547        exit (2);
     
    7789
    7890// launch the dvosecfilt_client jobs to the parallel hosts
    79 int dvosecfilt_parallel (SkyTable *insky, int Nsecfilt) {
     91int dvosecfilt_parallel (SkyTable *sky, int Nsecfilt) {
    8092
    8193  // ensure that the paths are absolute path names
     
    8395
    8496  // load the list of hosts
    85   HostTable *table = HostTableLoad (CATDIR, insky->hosts);
     97  HostTable *table = HostTableLoad (CATDIR, sky->hosts);
    8698  if (!table) {
    87     fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", insky->hosts, CATDIR);
     99    fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
    88100    exit (1);
    89101  }   
     
    99111    // options / arguments that can affect relastro_client -update-objects:
    100112    char command[DVO_MAX_PATH];
    101     snprintf (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s",
    102               abscatdir, Nsecfilt, table->hosts[i].hostID, table->hosts[i].pathname
     113    snprintf (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s -region %f %f %f %f",
     114              abscatdir, Nsecfilt, table->hosts[i].hostID, table->hosts[i].pathname,
     115              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax
    103116      );
    104117
    105118    char tmpline[DVO_MAX_PATH];
    106     if (VERBOSE)         { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); }
     119    if (VERBOSE)    { snprintf (tmpline, DVO_MAX_PATH, "%s -v",      command);             strcpy (command, tmpline); }
     120    if (SINGLE_CPT) { snprintf (tmpline, DVO_MAX_PATH, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
    107121
    108122    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/dvosecfilt_client.c

    r35333 r35336  
    1212  int Nsecfilt = atoi(argv[2]);
    1313
    14   // load the sky table for the existing database
    15   SkyTable *insky = SkyTableLoadOptimal (CATDIR, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE);
    16   SkyTableSetFilenames (insky, CATDIR, "cpt");
    17 
    18   dvosecfilt_catalogs (insky, Nsecfilt);
     14  dvosecfilt_catalogs (Nsecfilt);
    1915
    2016  exit (0);
Note: See TracChangeset for help on using the changeset viewer.