IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2007, 10:15:51 AM (19 years ago)
Author:
eugene
Message:

extensive updates to the avextract / mextract / skyregion system

File:
1 edited

Legend:

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

    r12332 r14401  
    77  int i, j, m, N, Nr, mode[2];
    88  int Nsecfilt, NSTAR;
    9   char *RegionName, *RegionList;
    109  double M1, M2, dM2, color;
    1110
     
    1413  Vector **vec;
    1514  SkyList *skylist;
     15  SkyRegionSelection *selection;
    1616
    1717  /* these need to be freed in the end */
     
    1919  catalog.secfilt = NULL;
    2020  catalog.measure = NULL;
    21   RegionName = NULL;
    22   RegionList = NULL;
    2321  skylist = NULL;
     22  selection = NULL;
    2423  vec = NULL;
    2524
     
    3029  /* command line arguments */
    3130  SetSelectionParam (0);
    32   if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape;
     31
     32  // parse skyregion options
     33  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
    3334  if (!SetPhotSelections (&argc, argv, 2)) goto usage;
    3435
     
    5051  if ((vec[Np]  = SelectVector ("cal:nphot",    ANYVECTOR, TRUE)) == NULL) goto escape;
    5152  if ((vec[Nc]  = SelectVector ("cal:ncode",    ANYVECTOR, TRUE)) == NULL) goto escape;
    52   if ((vec[Nt]  = SelectVector ("cal:ncrit",    ANYVECTOR, TRUE)) == NULL) goto escape;
     53  // if ((vec[Nt]       = SelectVector ("cal:ncrit",    ANYVECTOR, TRUE)) == NULL) goto escape;
    5354  if ((vec[Nx]  = SelectVector ("cal:chisq",    ANYVECTOR, TRUE)) == NULL) goto escape;
    5455  if ((vec[Nd1] = SelectVector ("cal:dm1",      ANYVECTOR, TRUE)) == NULL) goto escape;
     
    5657
    5758  /* load region corresponding to selection above */
    58   if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
     59  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
    5960
    6061  for (Nr = 0; Nr < skylist[0].Nregions; Nr++) {
     
    7374    dvo_catalog_unlock (&catalog);
    7475
     76    # if (0)
    7577    /* extract values, assign to vectors */
    7678    for (i = 0; i < catalog.Naverage; i++) {
     
    104106      vec[Nc ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCODE);
    105107      vec[Np ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NPHOT);
    106       vec[Nt ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCRIT);
     108      // vec[Nt ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCRIT);
    107109      N ++;
    108110      if (N == NSTAR) {
     
    113115      }
    114116    }
     117    # endif
    115118    dvo_catalog_free (&catalog);
    116119  }
    117120
    118   SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    119121  for (i = 0; i < NVEC; i++) {
    120122    vec[i][0].Nelements = N;
    121123  }
     124
     125  SkyListFree (skylist);
     126  FreeSkyRegionSelection (selection);
    122127  return (TRUE);
    123128 
     
    127132
    128133escape:
    129   if (RegionName != NULL) free (RegionName);
    130   if (RegionList != NULL) free (RegionList);
    131   SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
     134  SkyListFree (skylist);
     135  FreeSkyRegionSelection (selection);
    132136  for (i = 0; i < NVEC; i++) {
    133137    DeleteVector (vec[i]);
Note: See TracChangeset for help on using the changeset viewer.