Last modified: December 2013

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


AHELP for CIAO 4.16

get_piximg

Context: crates

Synopsis

Return a CrateData object of an image from a crate.

Syntax

get_piximg(crate)

Description

Argument Description
crate The image crate.

The get_piximg command returns a CrateData object representing the contents of the image within the crate. To retrieve just the image data (without any metadata), use copy_piximgvals or get_piximgvals.


Example

>>> cr = read_file("3c186.radio.fits")
>>> img = get_piximg(cr)
>>> print(img)
  Name:     PRIMARY
  Datatype: float32
  Unit:     JY/BEAM
  Desc:     
  Eltype:   Array
     Ndim:     4
     Dimarr:   (1, 1, 1150, 1550)

which can be compared to the dmlist output:

unix% dmlist 3c186.radio.fits cols
 
--------------------------------------------------------------------------------
Columns for Image Block PRIMARY
--------------------------------------------------------------------------------
 
ColNo  Name                 Unit        Type             Range
   1   PRIMARY[1550,1150,1,1] JY/BEAM      Real4(1550x1150x1x1) -Inf:+Inf            
 
--------------------------------------------------------------------------------
Physical Axis Transforms for Image Block PRIMARY
--------------------------------------------------------------------------------
 
Group# Axis# 
   1   1,2    POS(X) = (#1) 
                 (Y)   (#2)
   2   3      Z                    = #3 
   3   4      #AXIS4               = #4 
 
--------------------------------------------------------------------------------
World Coordinate Axis Transforms for Image Block PRIMARY
--------------------------------------------------------------------------------
 
Group# Axis# 
   1   1,2    EQPOS(RA ) = (+116.250) +SIN[(-0.0005)* (POS(X)-(+774.0419))]
                   (DEC)   (+38.1183)      (+0.0005)  (   (Y) (+575.1304)) 
   2   3      FREQ                 = +1.4351E+09  +21875000.0 * (Z  -1.0)
   3   4      STOKES               = #AXIS4 

Information about the image can be found in fields and methods of the return value - for instance the pixel data (.values) and the pixel units (.unit):

>>> print(img.values.shape)
(1, 1, 1150, 1550)
>>> print(img.unit)
JY/BEAM

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_col, add_piximg, copy_piximgvals, cratedata, create_vector_column, create_virtual_column, 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_shape, get_piximgvals, get_transform, get_transform_matrix, set_piximgvals