Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/get_piximgvals.html
AHELP for CIAO 4.15

get_piximgvals

Context: crates

Synopsis

Get the pixel values from an image crate.

Syntax

get_piximgvals(crate)

Description

Argument Description
crate The image crate.

The get_piximgvals command returns an array of values from the input image crate.

The get_piximg command returns a CrateData object for the image, which is useful if you are interested in the metadata associated with it.


Example

>>> cr = read_file("image.fits")
>>> vals = get_piximgvals(cr)
>>> print(vals.shape)
(201, 201)
>>> print(vals.sum())
6696

The get_piximgvals() call returns a numpy array which contains the pixel values.


Should I use copy_piximgvals or get_piximgvals?

The copy_piximgvals routine is similar to get_piximgvals, so when should you use it? The return value from get_piximgvals reflects the contents of the Crate, so that changes to the return value also change the crate, whereas copy_piximgvals returns a copy of this data.

It is generally going to be safer to use copy_piximgvals rather than get_piximgvals unless:

If the image being read in is a virtual one then the data is always going to be copied, so in this particular case there is no difference between copy_piximgvals and get_piximgvals.


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_axis_transform, get_col, get_col_names, get_colvals, get_crate_item_type, get_crate_type, get_key, get_key_names, get_keyval, get_number_cols, get_number_rows, get_piximg, get_piximg_shape, get_transform, get_transform_matrix, set_piximgvals