Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/set_piximgvals.html
Jump to: Description · Example · Bugs · See Also


AHELP for CIAO 4.17

set_piximgvals

Context: crates

Synopsis

Set the pixel values in an image crate.

Syntax

set_piximgvals(crate, values)

Description

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.


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

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