write(data,
fname,
scalefac=1,
allow_overflow=0)
| source code
|
- Parameters:
data - is a class gpk_img object containing data to be written (note
that the header information is ignored except for the sampling
rate (CDELT2 ) and bits per pixel
(BITPIX )). The length and number of channels is
taken from data.d.shape .
fname (str or file,) - is the name of a file to write it to (or a file object),
scalefac - is a factor to multiply the data
allow_overflow - can be either
-
OV_ERROR (default, means raise a ValueError
exception if the data*scalefac overflows),
-
OV_LIMIT (means limit the data*scalefac to
prevent overflows -- this clips the audio), or
-
OV_IGNORE (means let the overflows happen
and don't worry.)
- Raises:
ValueError - Missing information in data .
Overflow - The output format is clipping the data. Strictly speaking, on
16-bit data, 32767 is considered clipping even though it possibly
might be OK. However such extreme values are very likely to be
generated by clipping at an earlier stage of the processing, so
it's probably an error even if the error is not being made here.
|