diff --git a/src/stdatamodels/fits_support.py b/src/stdatamodels/fits_support.py index 4b7383c4..4c553f33 100644 --- a/src/stdatamodels/fits_support.py +++ b/src/stdatamodels/fits_support.py @@ -31,7 +31,7 @@ log.addHandler(logging.NullHandler()) -__all__ = ["to_fits", "from_fits", "fits_hdu_name", "get_hdu", "is_builtin_fits_keyword"] +__all__ = ["to_fits", "from_fits", "get_hdu", "is_builtin_fits_keyword"] _ASDF_EXTENSION_NAME = "ASDF" @@ -112,22 +112,10 @@ def _get_indexed_keyword(keyword, i): return keyword -def fits_hdu_name(name): - """ - Returns a FITS hdu name in the correct form for the current - version of Python. - """ - if isinstance(name, bytes): - return name.decode("ascii") - return name - - def _get_hdu_name(schema): hdu_name = schema.get("fits_hdu") if hdu_name in (None, "PRIMARY"): hdu_name = 0 - else: - hdu_name = fits_hdu_name(hdu_name) return hdu_name @@ -470,7 +458,6 @@ def normalize_array(node): def _save_extra_fits(hdulist, tree): # Handle _extra_fits for hdu_name, parts in tree.get("extra_fits", {}).items(): - hdu_name = fits_hdu_name(hdu_name) if "data" in parts: hdu_type = _get_hdu_type(hdu_name, value=parts["data"]) hdu = _get_or_make_hdu(hdulist, hdu_name, hdu_type=hdu_type, value=parts["data"])