We have a few instances of repeating the same pattern for classifying IGRINS data based on its filename alone. For example:
if ".spec_a0v.fits" in filepath: #Grab base file name for the uncertainity file
path_base = filepath[:-14]
elif ".spec_flattened.fits" in filepath:
path_base = filepath[:-20]
elif ".spec.fits" in filepath:
path_base = filepath[:-10]
This should streamline lots of methods that reapply the same logic, and should futureproof against future methods that need these qualifiers in order to process the data. For example, knowing if the file is online versus local changes the way we would search for the existence or not of ancillary files.
We have a few instances of repeating the same pattern for classifying IGRINS data based on its filename alone. For example:
We should put this in to a modular function:
This should streamline lots of methods that reapply the same logic, and should futureproof against future methods that need these qualifiers in order to process the data. For example, knowing if the file is online versus local changes the way we would search for the existence or not of ancillary files.