IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33564


Ignore:
Timestamp:
Mar 17, 2012, 2:49:51 PM (14 years ago)
Author:
eugene
Message:

use unique names for dvo master/client I/O files; mark stars for which average used SYNTH or UBERCAL

Location:
branches/eam_branches/ipp-20111122/Ohana/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/libdvo/include/dvo.h

    r33520 r33564  
    172172/* Secfilt.flags values -- these values are 32 bit (as of PS1_V1) */
    173173typedef enum {
    174   ID_SECF_STAR_FEW  = 0x00000001, // used within relphot: skip star
    175   ID_SECF_STAR_POOR = 0x00000002, // used within relphot: skip star
    176   ID_PHOTOM_PASS_0  = 0x00000100, // average magnitude calculated in 0th pass
    177   ID_PHOTOM_PASS_1  = 0x00000200, // average magnitude calculated in 1th pass
    178   ID_PHOTOM_PASS_2  = 0x00000400, // average magnitude calculated in 2th pass
    179   ID_PHOTOM_PASS_3  = 0x00000800, // average magnitude calculated in 3th pass
    180   ID_PHOTOM_PASS_4  = 0x00001000, // average magnitude calculated in 4th pass
    181   ID_SECF_OBJ_EXT   = 0x01000000, // extended in this band
     174  ID_SECF_STAR_FEW    = 0x00000001, // used within relphot: skip star
     175  ID_SECF_STAR_POOR   = 0x00000002, // used within relphot: skip star
     176  ID_SECF_USE_SYNTH   = 0x00000004, // synthetic photometry used in average measurement
     177  ID_SECF_USE_UBERCAL = 0x00000008, // synthetic photometry used in average measurement
     178  ID_PHOTOM_PASS_0    = 0x00000100, // average magnitude calculated in 0th pass
     179  ID_PHOTOM_PASS_1    = 0x00000200, // average magnitude calculated in 1th pass
     180  ID_PHOTOM_PASS_2    = 0x00000400, // average magnitude calculated in 2th pass
     181  ID_PHOTOM_PASS_3    = 0x00000800, // average magnitude calculated in 3th pass
     182  ID_PHOTOM_PASS_4    = 0x00001000, // average magnitude calculated in 4th pass
     183  ID_SECF_OBJ_EXT     = 0x01000000, // extended in this band
    182184} DVOSecfiltFlags;
    183185
     
    254256  char *hostname;             // name of remote machine
    255257  char *pathname;             // name of directory for this machine's data
     258  char *results;              // name of file machine's result data
    256259  int hostID;                 // remove machine ID in SkyTable
    257260  int stdio[3];               // fd's for communication with the remote host
  • branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c

    r33544 r33564  
    99    hosts[i].hostname = NULL;
    1010    hosts[i].pathname = NULL;
     11    hosts[i].results = NULL;
    1112    hosts[i].stdio[HOST_STDIN] = -1;
    1213    hosts[i].stdio[HOST_STDOUT] = -1;
  • branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_host_utils.c

    r33563 r33564  
    88int HostTableLaunchJobs (HostTable *table, char *basecmd, char *options) {
    99
     10  char uniquer[12];
     11  int TIME = time(NULL);
     12  int PID = getpid();
     13  snprintf (uniquer, 12, "%05d.%05d", PID, TIME % 100000);
     14
    1015  int i;
    1116  for (i = 0; i < table->Nhosts; i++) {
     
    1621    table->hosts[i].pathname = tmppath;
    1722
    18     char resultFile[MAX_PATH_LENGTH];
    19     snprintf (resultFile, MAX_PATH_LENGTH, "%s/dvo.results.fits", table->hosts[i].pathname);
     23    // need to save the results filename with the uniquer
     24    // XXX a bit of a waste (but only 1024 * 60 bytes or so
     25    ALLOCATE (table->hosts[i].results, char, MAX_PATH_LENGTH);
     26    snprintf (table->hosts[i].results, MAX_PATH_LENGTH, "%s/dvo.results.%s.fits", table->hosts[i].pathname, uniquer);
    2027
    21     char *commandFile = abspath("dvo_client.command.txt", MAX_PATH_LENGTH);
     28    char commandBase[MAX_PATH_LENGTH];
     29    snprintf (commandBase, MAX_PATH_LENGTH, "dvo.command.%s.txt", uniquer);
     30    char *commandFile = abspath(commandBase, MAX_PATH_LENGTH);
     31
    2232    FILE *f = fopen (commandFile, "w");
    2333    fprintf (f, "%s\n", basecmd);
     
    2535
    2636    char command[1024];
    27     snprintf (command, 1024, "dvo_client %s -result %s %s -hostID %d -hostdir %s", commandFile, resultFile, options, table->hosts[i].hostID, table->hosts[i].pathname);
     37    snprintf (command, 1024, "dvo_client %s -result %s %s -hostID %d -hostdir %s", commandFile, table->hosts[i].results, options, table->hosts[i].hostID, table->hosts[i].pathname);
    2838    free (commandFile);
    2939
     
    134144    if (table->hosts[i].status) continue;
    135145
    136     char resultFile[MAX_PATH_LENGTH];
    137     snprintf (resultFile, MAX_PATH_LENGTH, "%s/dvo.results.fits", table->hosts[i].pathname);
    138        
    139146    int    Ninvec = 0;
    140     Vector **invec = ReadVectorTableFITS (resultFile, "RESULT", &Ninvec);
     147    Vector **invec = ReadVectorTableFITS (table->hosts[i].results, "RESULT", &Ninvec);
     148    free (table->hosts[i].results);
     149    table->hosts[i].results = NULL;
    141150
    142151    if (Nelements == 0) {
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/load_catalogs.c

    r33547 r33564  
    127127    table->hosts[i].pathname = tmppath;
    128128
    129     char catalogFile[512];
    130     snprintf (catalogFile, 512, "%s/relastro.catalog.subset.dat", table->hosts[i].pathname);
     129    ALLOCATE (table->hosts[i].results, char, 1024);
     130    snprintf (table->hosts[i].results, 1024, "%s/relastro.catalog.subset.dat", table->hosts[i].pathname);
    131131
    132132    // options / arguments that can affect relastro_client -load:
     
    211211  for (i = 0; i < table->Nhosts; i++) {
    212212
    213     // XXX save this name in table->hosts[]?  it is created above as well...
    214     char catalogFile[512];
    215     snprintf (catalogFile, 512, "%s/relastro.catalog.subset.dat", table->hosts[i].pathname);
    216 
    217     BrightCatalog *bcatalog = BrightCatalogLoad (catalogFile);
     213    BrightCatalog *bcatalog = BrightCatalogLoad (table->hosts[i].results);
    218214    assert (bcatalog);
    219215   
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c

    r33549 r33564  
    200200        int Ncode = 0;
    201201        int Next = 0;
     202        int haveSynth = FALSE;
     203        int haveUbercal = FALSE;
    202204
    203205        N = 0;
     
    250252            }
    251253          }
     254          // ignore SYNTH photocdes until PASS == 4 (where we also accept saturated stars)
     255          if ((catalog[i].measure[m].photcode >= 3001) && (catalog[i].measure[m].photcode <= 3005)) {
     256            if (pass < 4) continue;
     257            haveSynth = TRUE;
     258          }
    252259
    253260          // dlist gives the error, which is used as the weight in WT_MEAN.
     
    262269          if (catalog[i].measureT[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) {
    263270            dlist[N] = MAX (0.1*catalog[i].measureT[m].dM, MIN_ERROR);
     271            haveUbercal = TRUE;
    264272          }
    265273
     
    299307        }
    300308
     309        if (haveSynth) {
     310          catalog[i].secfilt[Nsecfilt*j+Nsec].flags |= ID_SECF_USE_SYNTH;
     311        }       
     312        if (haveUbercal) {
     313          catalog[i].secfilt[Nsecfilt*j+Nsec].flags |= ID_SECF_USE_UBERCAL;
     314        }       
     315
    301316        /* use sigma or error in dM for output? */
    302317        catalog[i].secfilt[Nsecfilt*j+Nsec].M  = stats.mean;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c

    r33483 r33564  
    6060        ID_PHOTOM_PASS_2 |
    6161        ID_PHOTOM_PASS_3 |
    62         ID_PHOTOM_PASS_4;
     62        ID_PHOTOM_PASS_4 |
     63        ID_SECF_USE_SYNTH |
     64        ID_SECF_USE_UBERCAL |
     65        ID_SECF_OBJ_EXT;
    6366      for (Ns = 0; Ns < Nphotcodes; Ns++) {
    6467
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/load_catalogs.c

    r33548 r33564  
    127127    table->hosts[i].pathname = tmppath;
    128128
    129     char catalogFile[512];
    130     snprintf (catalogFile, 512, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
     129    ALLOCATE (table->hosts[i].results, char, 1024);
     130    snprintf (table->hosts[i].results, 1024, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
    131131
    132132    // options / arguments that can affect relphot_client -load:
     
    144144    char command[1024];
    145145    snprintf (command, 1024, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D CAMERA %s -D MAG_LIM %f -D SIGMA_LIM %f",
    146               PhotcodeList, catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM);
     146              PhotcodeList, table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM);
    147147
    148148    char tmpline[1024];
     
    202202  for (i = 0; i < table->Nhosts; i++) {
    203203
    204     char catalogFile[512];
    205     snprintf (catalogFile, 512, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
    206 
    207204    BrightCatalog *bcatalog = NULL;
    208     while ((bcatalog = BrightCatalogLoad (catalogFile)) == NULL) {
     205    while ((bcatalog = BrightCatalogLoad (table->hosts[i].results)) == NULL) {
    209206      // failed to get the data from this host.  This can happen for various reasons.  Give the user a chance to try again...
    210207      fprintf (stderr, "failed to read data from %s, stopping operations until this can be fixed\n", table->hosts[i].hostname);
     
    212209      int pid = getpid();
    213210      kill (pid, SIGSTOP);
    214       fprintf (stderr, "retrying %s\n", catalogFile);
    215     }
     211      fprintf (stderr, "retrying %s\n", table->hosts[i].results);
     212    }
     213    free (table->hosts[i].results);
     214    table->hosts[i].results = NULL;
    216215   
    217216    BrightCatalogSplit (catalogs, bcatalog);
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot_objects.c

    r33548 r33564  
    6767        ID_PHOTOM_PASS_2 |
    6868        ID_PHOTOM_PASS_3 |
    69         ID_PHOTOM_PASS_4;
    70 
     69        ID_PHOTOM_PASS_4 |
     70        ID_SECF_USE_SYNTH |
     71        ID_SECF_USE_UBERCAL |
     72        ID_SECF_OBJ_EXT;
     73     
    7174      for (j = 0; j < catalog.Naverage; j++) {
    7275        catalog.average[j].flags = 0;
     
    128131    table->hosts[i].pathname = tmppath;
    129132
    130     char catalogFile[512];
    131     snprintf (catalogFile, 512, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
    132 
    133133    // options / arguments that can affect relphot_client -update-objects:
    134134    // VERBOSE, VERBOSE2
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/setMrelFinal.c

    r33452 r33564  
    2222   
    2323    // flags used by the photometry analysis (excluding UBERCAL)
    24     unsigned int PHOTOM_PASSES =
     24    unsigned int secfiltFlags =
    2525      ID_PHOTOM_PASS_0 | // average measured at pass 0
    2626      ID_PHOTOM_PASS_1 | // average measured at pass 1
    2727      ID_PHOTOM_PASS_2 | // average measured at pass 2
    2828      ID_PHOTOM_PASS_3 | // average measured at pass 3
    29       ID_PHOTOM_PASS_4;  // average measured at pass 4
     29      ID_PHOTOM_PASS_4 | // average measured at pass 3
     30      ID_SECF_USE_SYNTH | // average measured at pass 3
     31      ID_SECF_USE_UBERCAL | // average measured at pass 3
     32      ID_SECF_OBJ_EXT; // average measured at pass 3
    3033   
    3134    int Ns;
     
    4548        catalog[0].secfilt[N].Ncode  = 0;
    4649        catalog[0].secfilt[N].Nused  = 0;
    47         catalog[0].secfilt[N].flags &= ~PHOTOM_PASSES;
     50        catalog[0].secfilt[N].flags &= ~secfiltFlags;
    4851        catalog[0].secfilt[N].ubercalDist = 1000;
    4952
Note: See TracChangeset for help on using the changeset viewer.