{ } Raw JSON

bundles / astropy 7.0.1 / astropy / io / fits / hdu / image / _ImageBaseHDU / scale

function

astropy.io.fits.hdu.image:_ImageBaseHDU.scale

source: /astropy/io/fits/hdu/image.py :451

Signature

def   scale ( self type = None option = old bscale = None bzero = None )

Summary

Scale image data by using BSCALE/BZERO.

Extended Summary

Call to this method will scale data and update the keywords of BSCALE and BZERO in the HDU's header. This method should only be used right before writing to the output file, as the data will be scaled and is therefore not very usable after the call.

Parameters

type : str, optional

destination data type, use a string representing a numpy dtype name, (e.g. 'uint8', 'int16', 'float32' etc.). If is None, use the current data type.

option : str, optional

How to scale the data: "old" uses the original BSCALE and BZERO values from when the data was read/created (defaulting to 1 and 0 if they don't exist). For integer data only, "minmax" uses the minimum and maximum of the data to scale. User-specified bscale/bzero values always take precedence.

bscale, bzero : int, optional

User-specified BSCALE and BZERO values

Aliases

  • astropy.io.fits.hdu.image._ImageBaseHDU.scale