IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 1, 2012, 3:24:39 PM (14 years ago)
Author:
eugene
Message:

support for parallel dvo in mextract, avextract, avmerge, gstar, gcat; remove some if-def-ed out code already moved to libdvo; list -vectors and -buffers options (store names of vectors and buffers in lists); list -copy give error if missing source; catlist, hosts & remote functions to support parallel dvos; skyregion -save option; new skycoverage modes (-min-ubercal; -min-dmag-sys; -min-mcal; -max-mcal); gstar output formatting cleanups; add more average info to gstar output; functions for spectral similarity analysis; coords returns nans for projections off the sphere; fix cumulative function; add name:type option to opihi/read function (eg read a:float 2 b:time 3 c:int 4); line -frac option; vtype function to get vector types; threshold function; write -fits option; code for unfinished mtype function (matching vtype)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/gstar.c

    r31667 r33662  
    6868  }
    6969
     70  int PARALLEL = FALSE;
     71  if ((N = get_argument (argc, argv, "-parallel"))) {
     72    remove_argument (N, &argc, argv);
     73    PARALLEL = TRUE;
     74  }
     75
    7076  if (argc != 4) {
    7177    gprint (GP_ERR, "USAGE: gstar RA DEC Radius [-m]\n");
     
    8995  }
    9096
     97  HostTable *table = NULL; 
     98  if (PARALLEL) {
     99    char *CATDIR = GetCATDIR();
     100    table = HostTableLoad (CATDIR, sky->hosts);
     101    if (!table) {
     102      gprint (GP_ERR, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
     103      return FALSE;
     104    }   
     105
     106    SkyRegion *region = skylist[0].regions[0];
     107    int hostID = (region->hostFlags & DATA_USE_BCK) ? region->backupID : region->hostID;
     108    int index = table->index[hostID];
     109   
     110    char hostfile[1024];
     111    snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, region->name);
     112    catalog.filename = hostfile;
     113  } else {
     114    catalog.filename = skylist[0].filename[0];
     115  }
     116
    91117  /* lock, load, unlock catalog */
    92   catalog.filename = skylist[0].filename[0];
    93118  catalog.catflags = GetMeasures ? LOAD_AVES | LOAD_MEAS | LOAD_SECF : LOAD_AVES | LOAD_SECF;
    94119  catalog.Nsecfilt = 0;
     
    177202            gprint (GP_LOG, "%f ",     catalog.average[k].duD);
    178203            gprint (GP_LOG, "%f ",     catalog.average[k].P);
    179             gprint (GP_LOG, "%f ",     catalog.average[k].dP);
     204            gprint (GP_LOG, "%f   ",     catalog.average[k].dP);
     205
     206            gprint (GP_LOG, "%f   ",     catalog.average[k].ChiSqAve);
     207            gprint (GP_LOG, "%f   ",     catalog.average[k].ChiSqPM);
     208            gprint (GP_LOG, "%f   ",     catalog.average[k].ChiSqPar);
     209
     210            date = ohana_sec_to_date (catalog.average[k].Tmean);
     211            gprint (GP_LOG, "%20s ",     date);
     212            gprint (GP_LOG, "%f   ",     catalog.average[k].Trange / 86400.0);
    180213        }
    181214
     
    197230        for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 2);
    198231        gprint (GP_LOG, "\n");
    199       }
    200 
     232
     233        if (FULL_OUTPUT) {
     234          /* Map */
     235          for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 5);
     236          gprint (GP_LOG, "\n");
     237
     238          /* M_20 */
     239          for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 6);
     240          gprint (GP_LOG, "\n");
     241
     242          /* M_80 */
     243          for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 7);
     244          gprint (GP_LOG, "\n");
     245
     246          /* secfilt flags */
     247          for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 4);
     248          gprint (GP_LOG, "\n");
     249
     250        }
     251      }
    201252      if (GetMeasures || SaveVectors) {
    202253        m = catalog.average[k].measureOffset;
     
    218269            gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dR);
    219270            gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dD);
    220             gprint (GP_LOG, "%4x ",    catalog.measure[m].photFlags);
    221             gprint (GP_LOG, "%3x ",    catalog.measure[m].dbFlags);
     271            gprint (GP_LOG, "0x%08x ", catalog.measure[m].photFlags);
     272            gprint (GP_LOG, "0x%08x ", catalog.measure[m].dbFlags);
    222273            gprint (GP_LOG, "%5d ",    catalog.measure[m].photcode);
    223274            gprint (GP_LOG, "%-20s ",  GetPhotcodeNamebyCode (catalog.measure[m].photcode));
     
    226277
    227278            if (FULL_OUTPUT) {
    228                 gprint (GP_LOG, "%f ", catalog.measure[m].Mcal);
    229                 gprint (GP_LOG, "%f ", catalog.measure[m].Map);
    230                 gprint (GP_LOG, "%f ", pow(10.0, 0.4*catalog.measure[m].dt));
    231                 gprint (GP_LOG, "%f ", 1.0 + catalog.measure[m].airmass);
    232                 gprint (GP_LOG, "%f ", catalog.measure[m].az);
    233                 gprint (GP_LOG, "%f ", catalog.measure[m].Xccd);
    234                 gprint (GP_LOG, "%f ", catalog.measure[m].Yccd);
    235                 gprint (GP_LOG, "%f ", FromShortPixels(catalog.measure[m].dXccd));
    236                 gprint (GP_LOG, "%f ", FromShortPixels(catalog.measure[m].dYccd));
    237                 gprint (GP_LOG, "%f ", catalog.measure[m].Sky);
    238                 gprint (GP_LOG, "%f ", catalog.measure[m].dSky);
    239                 gprint (GP_LOG, "%d ", catalog.measure[m].averef);
    240                 gprint (GP_LOG, "%d ", catalog.measure[m].detID);
    241                 gprint (GP_LOG, "%d ", catalog.measure[m].imageID);
    242                 gprint (GP_LOG, "%f ", catalog.measure[m].psfQual);
    243                 gprint (GP_LOG, "%f ", catalog.measure[m].psfChisq);
    244                 gprint (GP_LOG, "%f ", catalog.measure[m].crNsigma);
    245                 gprint (GP_LOG, "%f ", catalog.measure[m].extNsigma);
    246                 gprint (GP_LOG, "%f ", FromShortDegrees(catalog.measure[m].theta));
     279                gprint (GP_LOG, "%6.3f ", catalog.measure[m].Mcal);
     280                gprint (GP_LOG, "%6.3f ", catalog.measure[m].Map);
     281                gprint (GP_LOG, "%5.1f ", pow(10.0, 0.4*catalog.measure[m].dt));
     282                gprint (GP_LOG, "%5.3f ", catalog.measure[m].airmass);
     283                gprint (GP_LOG, "%6.1f ", catalog.measure[m].az);
     284                gprint (GP_LOG, "%6.1f ", catalog.measure[m].Xccd);
     285                gprint (GP_LOG, "%6.1f ", catalog.measure[m].Yccd);
     286                gprint (GP_LOG, "%3.1f ", FromShortPixels(catalog.measure[m].dXccd));
     287                gprint (GP_LOG, "%3.1f ", FromShortPixels(catalog.measure[m].dYccd));
     288                gprint (GP_LOG, "%6.1f ", catalog.measure[m].Sky);
     289                gprint (GP_LOG, "%5.1f ", catalog.measure[m].dSky);
     290                gprint (GP_LOG, "%8d ", catalog.measure[m].averef);
     291                gprint (GP_LOG, "0x%08x ", catalog.measure[m].detID);
     292                gprint (GP_LOG, "0x%08x ", catalog.measure[m].imageID);
     293                gprint (GP_LOG, "%.3f ", catalog.measure[m].psfQual);
     294                gprint (GP_LOG, "%.1f ", catalog.measure[m].psfChisq);
     295                gprint (GP_LOG, "%.1f ", catalog.measure[m].crNsigma);
     296                gprint (GP_LOG, "%.1f ", catalog.measure[m].extNsigma);
     297                gprint (GP_LOG, "%.1f ", FromShortDegrees(catalog.measure[m].theta));
    247298            }
    248299            gprint (GP_LOG, "\n");
     
    295346void print_double (double value) {
    296347  if (isnan(value))
    297     gprint (GP_LOG, "NaN    ");
     348    gprint (GP_LOG, "  NaN    ");
    298349  else
    299     gprint (GP_LOG, "%6.3f ", value);
     350    gprint (GP_LOG, "  %6.3f ", value);
    300351}
    301352
    302353void print_short (double value, short int ival) {
    303354  if (ival == NAN_S_SHORT)
    304     gprint (GP_LOG, "NaN    ");
     355    gprint (GP_LOG, "  NaN    ");
    305356  else
    306     gprint (GP_LOG, "%6.3f ", value);
     357    gprint (GP_LOG, "  %6.3f ", value);
    307358}
    308359
     
    370421    case 3: /* filter names */
    371422      code = GetPhotcodebyNsec (seq);
    372       gprint (GP_LOG, "%-6s ", code[0].name);
    373       break;
    374   }
    375 }
     423      gprint (GP_LOG, "  %-6s ", code[0].name);
     424      break;
     425
     426    case 4: /* secfilt flags */
     427      if (seq == -1) {
     428        gprint (GP_LOG, "%08x ", 0);
     429      } else {
     430        gprint (GP_LOG, "%08x ", secfilt[seq].flags);
     431      }
     432      break;
     433
     434    case 5: /* average ap mags */
     435      if (seq == -1) {
     436        print_double (NAN);
     437      } else {
     438        print_double (secfilt[seq].Map);
     439      }
     440      break;
     441
     442    case 6: /* average ap mags */
     443      if (seq == -1) {
     444        print_double (NAN);
     445      } else {
     446        print_short (0.001*secfilt[seq].M_20, secfilt[seq].M_20);
     447      }
     448      break;
     449
     450    case 7: /* average ap mags */
     451      if (seq == -1) {
     452        print_double (NAN);
     453      } else {
     454        print_short (0.001*secfilt[seq].M_20, secfilt[seq].M_80);
     455      }
     456      break;
     457
     458  }
     459}
Note: See TracChangeset for help on using the changeset viewer.