fitsmgmt.naming.fitsrenamer

fitsmgmt.naming.fitsrenamer(
    fpath=None,
    header=None,
    newtop=None,
    rename_by=None,
    mkdir_by=None,
    delimiter='_',
    archive_dir=None,
    keymap=None,
    key_deprecation=True,
    remove_keys=None,
    overwrite=False,
    fillnan='',
    trimsec=None,
    verbose=True,
    add_header=None,
)

Rename a FITS file using header values.

Parameters

fpath : path-like, optional. = None

The path to the target FITS file. Default: None.

header : ~astropy.io.fits.Header = None

The header of the fits file, especially if you want to just overwrite the header with this. Default: None.

newtop : path - like = None

The top path for the new FITS file. If None, the new path will share the parent path with fpath. Default: None.

rename_by : list of str = None

The keywords of the FITS header to rename by. Default: None which uses ['OBJECT'].

mkdir_by : list of str = None

The keys which will be used to make subdirectories to classify files. If given, subdirectories will be made with the header value of the keys. Default: None.

delimiter : str = '_'

The delimiter for the renaming. Default: '_'.

archive_dir : path-like or None = None

Where to move the original FITS file. If None, the original file will remain there. Deleting original FITS is dangerous so it is only supported to move the files. You may delete files manually if needed. Default: None.

keymap : dict or None = None

If not None, the keymapping is done by using the dict of keymap in the format of {<standard_key>:<original_key>}. Default: None.

key_deprecation : bool = True

Whether to change the original keywords’ comments to contain deprecation warning. If True, the original keywords’ comments will become DEPRECATED. See <standard_key>.. Default: True.

trimsec : str or None = None

FITS-style section string used to trim the image before writing the renamed file. WCS-bearing images require unit steps. Default is None.

fillnan : str = ''

The string that will be inserted if the keyword is not found from the header. Default: ''.

remove_keys : list of str, optional. = None

The header keywords to be removed. Default: None.

add_header : ~astropy.io.fits.Header or ~astropy.io.fits.Card, optional. = None

The header keyword, value (and comment) to add after the renaming. Default: None.

Notes

MEF(Multi-Extension FITS) currently is not supported.