| AHELP for CIAO 4.5 | set_piximgvals |
Context: crates |
Synopsis
Set the pixel values in an image crate.
Syntax
set_piximgvals(crate, values)
Description
- crate - input image crate
- values - Numpy array of values
The set_piximgvals command sets the pixel values in the input IMAGECrate data array. The new array does not need to match the dimensionality or data type of the original data.
The value is only changed in the crate; the input file is unaffected. The write_file command ("ahelp write_file") can be used to save the modified crate to a file.
Example
>>> cr = read_file("image.fits")
>>> vals = get_piximgvals(cr)
>>> expo = get_keyval(cr, "EXPOSURE")
>>> newvals = vals/expo
>>> set_piximgvals(cr, newvals)
>>> write_file(cr, "div_image.fits")Divide the values from image.fits by the exposure time from the EXPOSURE header keyword. Set the new values in the crate, then write out the new image values in div_image.fits.
Bugs
See the bug pages on the CIAO website for an up-to-date listing of known bugs.
Refer to the CIAO bug pages for an up-to-date listing of known issues.
See Also
- contrib
- set_key
- crates
- add_piximg, copy_piximgvals, delete_piximg, get_piximg, get_piximg_shape, get_piximgvals, set_colvals, set_keyval

![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)