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 withfpath. Default:None. rename_by :listofstr= None-
The keywords of the FITS header to rename by. Default:
Nonewhich uses['OBJECT']. mkdir_by :listofstr= 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 orNone= 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 :dictorNone= None-
If not
None, the keymapping is done by using thedictofkeymapin 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 becomeDEPRECATED. See <standard_key>.. Default:True. trimsec :strorNone= 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 :listofstr, optional. = None-
The header keywords to be removed. Default:
None. add_header :~astropy.io.fits.Headeror~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.