4.13. pow¶
Performs a power operation on the Fits object.
- Fits.pow(other, output=None, override=False) Self¶
Performs a power operation on the
Fitsobject.Notes
This method can raise numeric values or another
Fitsobject to a power.If
otheris numeric, each element of the matrix will be raised to that number.If
otheris anotherFitsobject, element-wise power will be performed.
Parameters
otherUnion[Self, float, int]Either a
Fitsobject, a float, or an integer.outputOptional[str]New path to save the resulting file.
overridebool, optional, default=FalseIf
True, will overwrite theoutputpath if a file already exists.
Returns
FitsA new
Fitsobject representing the result of the power operation.
Raises
FileExistsErrorIf the file already exists and
overrideisFalse.
4.13.1. Example:¶
from myraflib import Fits
fits = Fits.sample()
other = Fits.sample()
new_fits_1 = fits.pow(2)
new_fits_2 = fits.pow(other)