Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

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


AHELP for CIAO 4.9

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

chips> img = np.arange(12).reshape(3, 4)
chips> cd = CrateData()
chips> cd.values = img
chips> cr = IMAGECrate()
chips> add_piximg(cr, cd)
chips> 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)

or use ChIPS to display it by saying:

chips> add_image(cr)

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

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.