IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41629


Ignore:
Timestamp:
Jun 2, 2021, 10:02:44 AM (5 years ago)
Author:
eugene
Message:

strip nebdir elements from file name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/getstar/src/ReadImageFiles.c

    r37807 r41629  
    11# include "dvoImageOverlaps.h"
     2
     3// given FOO:BAR:file.ext return file.ext
     4char *nebbasename (char *name) {
     5 
     6  char *c, *file;
     7
     8  ALLOCATE (file, char, strlen(name) + 16);
     9
     10  c = strrchr (name, ':');
     11  if (c == (char *) NULL) {
     12    strcpy (file, name);
     13  } else {
     14    strcpy (file, c+1);
     15  }
     16  return (file);
     17}
    218
    319Image *ReadImageFiles (char *filename, off_t *Nimages) {
     
    6379        continue;
    6480      }
     81
     82      // the image name just needs to be a useful identifier
     83      // remove the full path and in the case of nebulous files, remove the rest of
     84      // the nebulous path:
     85      // 14508045500.gpc1:ipp.tdbtest.tag.ps1.20210527.gentoo:o8966g0113o.1602706:o8966g0113o.1602706.cm.2417132.smf
     86      // -> o8966g0113o.1602706.cm.2417132.smf
    6587     
    6688      /* find image rootname */
    67       name = filebasename (file[i]);
     89      char *rawname = filebasename (file[i]);
     90      name = nebbasename (rawname); //
     91      free (rawname);
     92
    6893      snprintf (image[N].name, DVO_IMAGE_NAME_LEN, "%s", name);
    6994      free (name);
     
    188213
    189214  /* find image rootname */
    190   name = filebasename (file[0]);
    191 
     215  char *rawname = filebasename (file[0]);
     216  name = nebbasename (rawname);
     217  free (rawname);
     218 
    192219  // now run through the images, interpret the headers and read the stars
    193220  for (i = N = 0; i < Nimage; i++) {
Note: See TracChangeset for help on using the changeset viewer.