fitsmgmt.naming.fits_newpath
fitsmgmt.naming.fits_newpath(
fpath,
rename_by,
mkdir_by=None,
header=None,
delimiter='_',
fillnan='',
fileext='.fits',
)Give the new path of a FITS file from header values.
Parameters
fpath : path - like-
The path to the original FITS file.
rename_by :listofstr-
The keywords of the FITS header to rename by.
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. header :~astropy.io.fits.Headerobject = None-
The header to extract
rename_byandmkdir_by. IfNone, the function will doheader = fits.getheader(fpath). Default:None. delimiter :str= '_'-
The delimiter for the renaming. Default:
'_'. fillnan :str= ''-
The string that will be inserted if the keyword is not found from the header. Default:
''. fileext :str= '.fits'-
The extension of the file name to be returned. Normally it should be
'.fits'since this function isfits_newpath, but you may prefer, e.g.,'.fit'for some reason. Iffileextdoes not start with a period ("."), one is prepended automatically. Default:'.fits'.
Returns
newpath : path-
The new path.