IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36813


Ignore:
Timestamp:
Jun 4, 2014, 12:16:40 PM (12 years ago)
Author:
eugene
Message:

fix problem with image ID map for dvomerge if input catalog has no images; fix problem with bad photcodes causing segfaults in relastro

Location:
branches/eam_branches/ipp-20140423/Ohana/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140423/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c

    r36528 r36813  
    168168
    169169  if (!IDmap->old) {
     170    fprintf (stderr, "input database has image IDs, but no Image table\n");
     171    return FALSE;
     172  }
     173
     174  if (!IDmap->Nmap) {
    170175    fprintf (stderr, "input database has image IDs, but no Image table\n");
    171176    return FALSE;
  • branches/eam_branches/ipp-20140423/Ohana/src/dvomerge/src/dvomergeImageIDs.c

    r35765 r36813  
    1818  if (inDB.dbstate == LCK_EMPTY) {
    1919    dvo_image_unlock (&inDB); // unlock input
     20    IDmap->old = NULL;
     21    IDmap->new = NULL;
    2022    IDmap->Nmap = 0;
    2123    return TRUE;
     
    99101  if (inDB.dbstate == LCK_EMPTY) {
    100102    dvo_image_unlock (&inDB); // unlock input
     103    IDmap->old = NULL;
     104    IDmap->new = NULL;
    101105    IDmap->Nmap = 0;
    102106    return TRUE;
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/include/relastro.h

    r36809 r36813  
    535535
    536536int strextend (char *input, char *format,...);
     537
     538int areImagesLoaded ();
     539int areImagesMatched ();
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/GetAstromError.c

    r33652 r36813  
    3030
    3131  code  = GetPhotcodebyCode (measure[0].photcode);
     32  if (!code) return NAN;
    3233
    3334  // do not raise an exception, just send back the result
     
    7273
    7374  code  = GetPhotcodebyCode (measure[0].photcode);
     75  if (!code) return NAN;
    7476
    7577  // do not raise an exception, just send back the result
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/ImageOps.c

    r36809 r36813  
    3939// N_onImage was 'Nlist'
    4040// N_ONIMAGE was 'NLIST'
     41
     42int areImagesLoaded () {
     43
     44  if (image) return TRUE;
     45  return FALSE;
     46}
     47
     48int areImagesMatched () {
     49
     50  if (MeasureToImage) return TRUE;
     51  return FALSE;
     52}
    4153
    4254Image *getimages (off_t *N, off_t **line_number) {
     
    574586
    575587  int Noff = NoffRAave + NoffDECave + NoffRAori + NoffDECori;
    576   if (VERBOSE && (Noff > 0)) fprintf (stderr, "Noff ave RA %d, Noff ave DEC %d, Noff ori RA %d, Noff ori DEC %d\n", NoffRAave, NoffDECave, NoffRAori, NoffDECori);
     588  if (VERBOSE2 && (Noff > 0)) fprintf (stderr, "Noff ave RA %d, Noff ave DEC %d, Noff ori RA %d, Noff ori DEC %d\n", NoffRAave, NoffDECave, NoffRAori, NoffDECori);
    577589  saveOffsets (dPos, nPos, im);
    578590
     
    10951107    } else {
    10961108      code = GetPhotcodebyCode (measure[0].photcode);
     1109      if (!code) return FALSE;
    10971110      mask = code[0].astromBadMask;
    10981111    }
     
    11611174    } else {
    11621175      code = GetPhotcodebyCode (measure[0].photcode);
     1176      if (!code) return FALSE;
    11631177      mask = code[0].astromBadMask;
    11641178    }
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/UpdateObjects.c

    r36808 r36813  
    8080  memset (&fitPAR, 0, sizeof(fitPAR));
    8181  initObjectData (catalog, Ncatalog);
     82
     83  int setRefColor = areImagesMatched();
    8284
    8385  /* project coordinates to a plane centered on the object with units of arcsec */
     
    228230        dD[N] = dY[N] / 3600.0;
    229231
    230         float color = getColor (m+k, i);
    231         if (!isnan(color)) {
    232           C[Nc] = color;
    233           Nc++;
     232        if (setRefColor) {
     233          float color = getColor (m+k, i);
     234          if (!isnan(color)) {
     235            C[Nc] = color;
     236            Nc++;
     237          }
    234238        }
    235239
     
    354358      }
    355359
    356       dsort (C, Nc);
    357       float colorMedian = (Nc > 0) ? C[(int)(0.5*Nc)] : NAN;
    358       catalog[i].average[j].refColor = colorMedian;
     360      if (setRefColor) {
     361        dsort (C, Nc);
     362        float colorMedian = (Nc > 0) ? C[(int)(0.5*Nc)] : NAN;
     363        catalog[i].average[j].refColor = colorMedian;
     364      }
    359365
    360366      /* choose the result based on the chisq values */
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/relastro_objects.c

    r36630 r36813  
    4040    snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
    4141    catalog.filename  = hostID ? hostfile : skylist[0].filename[i];
     42
     43    // set up the basic catalog info
    4244    catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    4345    catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
Note: See TracChangeset for help on using the changeset viewer.