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

URL: http://cxc.harvard.edu/ciao/add_piximg.html
AHELP for CIAO 4.4

add_piximg

Context: crates

Synopsis

Add an image to a crate.

Syntax

add_piximg(crate, cratedata)

Description

  • crate - input crate
  • cratedata - CrateData object to be added

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

The image is only added to the crate. The write_file ("ahelp 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)

Changes in CIAO 4.4

The routine no longer returns a value (1) to indicate it was succesfull.

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, delete_col, delete_key, delete_piximg, get_piximg, get_piximg_shape, get_piximgvals, read_file, read_pha, read_rmf, set_piximgvals, write_file, write_pha, write_rmf

Last modified: December 2011
CXC logo

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