4.5. save_as

Saves the Fits file to the specified output path.


Fits.save_as(output, override=False) Self

Saves the Fits file to the specified output path.

Parameters

outputstr

New path to save the file.

overridebool, optional, default=False

If True, will overwrite the output path if a file already exists.

Returns

Fits

A new Fits object representing the saved FITS file.

Raises

FileExistsError

If the file already exists and override is False.


4.5.1. Example:

from myraflib import Fits

fits = Fits.sample()
data = fits.save_as("NEW/FILE/PATH")