Last modified: December 2013

Jump to: Description · Example · Bugs · See Also

AHELP for CIAO 4.15


Context: crates


Set the pixel values in an image crate.


set_piximgvals(crate, values)


Argument Description
crate The image crate.
values A 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.

Only the crate is changed; the input file is unaffected. The write_file command can be used to save the modified crate to a file.


>>> 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.


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

add_piximg, copy_piximgvals, delete_piximg, get_piximg, get_piximg_shape, get_piximgvals, set_colvals, set_key, set_keyval