-
-
Notifications
You must be signed in to change notification settings - Fork 132
Closed
Labels
Milestone
Description
When trying to associate an identifier with my particular type of FITS file, the loader cannot decide between the generic FITS loader and my STIS-specific FITS loader.
IORegistryError: Format is ambiguous - options are: cubetest1, stis-format, tabular-fits
Location of error in AstroPy source code
My identifier:
# Define an optional identifier. If made specific enough, this circumvents the
# need to add `format="my-format"` in the `Spectrum1D.read` call.
def identify_stis_fits(origin, *args, **kwargs):
from astropy.io import fits
import os
import six
if isinstance(args[0], six.string_types) and (os.path.splitext(args[0].lower())[1] == '.fits'):
with fits.open( args[0]) as f:
return f[0].header.get('INSTRUME', '') == 'STIS'
else:
return FalseGlue gets around this by allowing the specification of loader priorities.