Take a fullpath file name and extract the basename of a fits files. As of Jan2020 this routine also create a local file named "subdir.path" that lists the full path directory location for the input image.
% just_fitsname.sh /home/jove/guider/data/ACQ/20160110/20160110T100709.2_acm_sci.fits 25 20160110T100709.2_acm_sci Usage: just_fitsname.sh /dat1/sco/boo.fits arg1 - fullpath FITS file string The output is written to the file "just_fitsname.output": 1 == number of characters in the base name 2 == the basename string 3 == image location (=none if image does not exist, =loc if image is local, =fullpath if image has path in name) % cat subdir.path /home/jove/guider/data/ACQ/20160110 NOTE: The last "/" is not included in the subdir string.With the basename you can always easily rebuild the FITS file name in a bash script. In Jan2020 I decided to make the full subdirectory path available in case we want to build names based on the image name. For instance, the dssbase_run_markII creates DSS fits images using a basename that encodes the sky position and image size. It also creates two accompanying cdfp file: one for USNO data and onae for PS1 data. Here is and example:
In the subdirectory ./local_red/Store_DSS/ we see the files: dss_RA01c17c31p268DEC+53c20c40p56_297.fits dss_RA01c17c31p268DEC+53c20c40p56_297_ps1.cdfp dss_RA01c17c31p268DEC+53c20c40p56_297_usno_all.cdfpHence, with the contents of subdir.path, we can build fullpath namess to these cdfp files and use them in other scripts.