Last modified: December 2019

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


AHELP for CIAO 4.16

add_piximg

Context: crates

Synopsis

Add an image to a crate.

Syntax

add_piximg(crate, cratedata)

Description

Argument Description
crate The image crate.
cratedata The CrateData object containing the image data to add.

The add_piximg command adds an image to the crate. Any existing image in the crate will be replaced.

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

>>> img = np.arange(12).reshape(3, 4)
>>> cd = CrateData()
>>> cd.values = img
>>> cr = IMAGECrate()
>>> add_piximg(cr, cd)
>>> write_file(cr, "newimg.fits")

Here we create a FITS image file called newimg.fits which contains a 4 (x) by 3 (y) pixel image containing the values 0 to 11, inclusive. Use dmlist to examine the output file:

unix% dmlist newimg.fits blocks
 
----------------------------------------------------------------------
Dataset: newimg.fits
----------------------------------------------------------------------
 
     Block Name                Type         Dimensions
----------------------------------------------------------------------
Block    1: PRIMARY              Image      Int4(4x3)

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
make_image_crate, make_table_crate, scale_image_crate, smooth_image_crate, write_arrays, write_columns
crates
add_col, add_key, copy_piximgvals, cratedata, create_vector_column, create_virtual_column, delete_col, delete_key, delete_piximg, get_col, get_colvals, get_piximg, get_piximg_shape, get_piximgvals, read_file, read_pha, read_rmf, set_piximgvals, write_file, write_pha, write_rmf