| AHELP for CIAO 4.5 | 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)
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

![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)