; ----
; Long list of desired features for future implementation:
; -----
; General:
;  bias frames
;  gain correction?
;  lots more check plots
;  check-related files into check directory?
;  multiple data-dir
;  More consistent recognition of dome, sci, etc. and ability to override
;  split r and l into multi-extension files in prepare and enable ccd/ files to recognize this (or not; has downsides)
;  use system variables to make life easier
;  convenience tools to mark bad files
;  file_dirname, file_basename could replace remove_path, fileroot, etc.
; Spectroscopic pipeline:
;  Implement individual diagnostic plots for flexure correction
;  Better support for poor standards (better line lists etc.)
;  More careful cosmic ray flagging - in multiple exposures in particular
;  support (even if partial) for multi-slit mode
;  wavlength calibrate 2D files
;  need an option for skipping spectroscopic flats entirely
;  direct alignment of dithered frames via cross-correlation
;  determine S/N when doing the tracing
;  imaging zapper zaps the edges sometimes - 150715_0151r - not sure if still an issue
;  archival pixel flats (from X or elsewhere)
;  archival response curves and airmass adjustment - for plotting at minimum
;  automatically fix 0.7" spectra for slit problem?
;  (still) better sky subtraction for twilight blue spectra
;  need a new method for the slit-averaged flats - maybe linear extrapolation fit
;  Solar spectrum for wavelength correction on blue in twilight?
;  Use(allow) physical coordinates for tracing (and wavelength solution)
;  objectpos.txt in physical coordinates to be robust to cropping changes
;  Implement line filtering / response division for all flat types
;  Optimal extraction
;  Eventually: a formal vertical flexure correction (beyond 0.7" slit)
;  spectroscopic aperture and slit loss correction for point sources
;  better tracing for very faint or diffuse targets (use slit?)
;  interactive / pause mode
;  Improvements to tracing: trace the standards and then perturb (2nd order) the targets?
;  don't crop red, but instead mark the bad regions in the header
;  better flat-fielding: deal with chip-gap noise
;  check why some standard spectra are processed as science observations
;  definition of central wavelength for improperly windowed science observations
; Imaging pipeline:
;  imaging thumbnails
;  need to find a way to unify r/l chip photometric catalogs to use both in air solution / scaling - calling of autolrisphot is already setup
;  "pre-astrometry": check for regular offset shift
;  evaluate if photometric or not
;  check that USNO catalogs are loaded OK
;  check for user-specified star catalogs for calibration
;  automated halo removal for bright stars?
;  background subtraction neighbor recognition and exclusion (????)
;  use supersky reflat constructed using multiple filters if aren't enough images in one?
;
;
; Done:
;  ability to scale blue to red rather than red to blue
;  use of PanSTARRS for imaging
;  during flux calibration:  re-normalize consistently for proper airmass interpolation/extrapolation.
;  More info in header of response files
;  matching of apertures for red/blue...?
;  use B-R offset information in tracing
;  Permit flat-fielding on red with a different dichroic
;  flat field file names include date - done
;  transpose images too for consistency - done
; re-enable support for other file naming conventions (e.g. KOA)
; Automate arc summation or combination - done (could be improved)
; response summary plot
; Match B and R files
; readd sky in specextract (and then resubtract out of background aperture)
; split step actually causes blue to be overcropped!! - fixed?
; implement new lamps
; old red side re-enable - mostly done, needs some checks (e.g. r+l imaging reconnection)
; better text output; error/warning log written to disk
; Stack spectra in 2D space
; overwrite prompt in photometry - fixed
; standard function to convert targname to unix-friendly file string - done
; use good standards where possible (e.g., don't use BD+26 for blue) - done
; use standard stars to guess trace pos - done
; mask specific lines for specific flux standards - done?
; common LRIS header reader function - mostly done
; faster CR cleaner for blue (and old red): done?
; use region of best mutual response for red/blue connection - done
; replace photometric solver with generic one - done
; prevent zapping causing interpolation of edge regions. - done
; telluric correction - done
; probably want a global arc solution, rather than each exposure (more robust) - done
; need sky-line refined wavelength solution - done
; deal with flats taken in wrong binning mode - done
; recognize mira files - done
; need to recognize saturated standards - done
; cleanup of autoastrometry files - done
; standard quality - red vs. blue - done
; done - superskyflats looking at mirror settings to better remove dust rings and glue defect (on red)
; done - selectfile messes up the order on multi-night runs.
; deal with when object name isn't read in properly
; option to make flats that aren't needed if files exist (beginning of night, compare dome vs. sky, etc.)
; lriscat slit info
; lines not appearing on trace plots
; replace the common blocks with structures (partial)
