GIRAFFE Pipeline Reference Manual

Giraffe Images

Functions

GiImage * giraffe_image_new (cpl_type type)
 Creates an empty image container. More...
 
GiImage * giraffe_image_create (cpl_type type, cxint nx, cxint ny)
 Creates an image container of a given type. More...
 
GiImage * giraffe_image_duplicate (const GiImage *self)
 Creates a copy of an image. More...
 
void giraffe_image_delete (GiImage *self)
 Destroys an image. More...
 
cpl_image * giraffe_image_get (const GiImage *self)
 Gets the image data. More...
 
cxint giraffe_image_set (GiImage *self, cpl_image *image)
 Sets the image data. More...
 
cpl_propertylist * giraffe_image_get_properties (const GiImage *self)
 Get the properties of an image. More...
 
cxint giraffe_image_set_properties (GiImage *self, cpl_propertylist *properties)
 Attaches a property list to an image. More...
 
cxint giraffe_image_copy_matrix (GiImage *self, cpl_matrix *matrix)
 Copies matrix elements into an image. More...
 
cxint giraffe_image_load_pixels (GiImage *self, const cxchar *filename, cxint position, cxint plane)
 Gets image data from a file. More...
 
cxint giraffe_image_load_properties (GiImage *self, const cxchar *filename, cxint position)
 Gets image properties from a file. More...
 
cxint giraffe_image_load (GiImage *self, const cxchar *filename, cxint position)
 Gets image data and properties from a file. More...
 
cxint giraffe_image_save (GiImage *self, const cxchar *filename)
 Write a Giraffe image to a file. More...
 
cxint giraffe_image_paste (GiImage *self, const GiImage *image, cxint x, cxint y, cxbool clip)
 Paste an image into another at a given position. More...
 
void giraffe_image_print (GiImage *self)
 Prints status information about a Giraffe image. More...
 
cxint giraffe_image_add_info (GiImage *image, const GiRecipeInfo *info, const cpl_frameset *set)
 Add additional frame information to an image. More...
 

Detailed Description

The module implements an Giraffe image type which inherits the cpl_image type and extends it by a property list to allow for storing image meta data together with its associated image. A pointer to a Giraffe image can be cast into a pointer to a cpl_image.

Function Documentation

cxint giraffe_image_add_info ( GiImage *  image,
const GiRecipeInfo *  info,
const cpl_frameset *  set 
)

Add additional frame information to an image.

TBD

Definition at line 781 of file giimage.c.

References giraffe_add_frameset_info(), giraffe_add_recipe_info(), and giraffe_image_get_properties().

cxint giraffe_image_copy_matrix ( GiImage *  self,
cpl_matrix *  matrix 
)

Copies matrix elements into an image.

Parameters
selfThe image to which the matrix elements are copied.
matrixThe matrix whose elements will be copied.
Returns
The function returns 0 on success, or 1 otherwise.

The function copies the matrix elements of the source matrix matrix into the pixel buffer of the image image.

Definition at line 353 of file giimage.c.

Referenced by giraffe_compute_fiber_profiles(), and giraffe_localize_spectra().

GiImage* giraffe_image_create ( cpl_type  type,
cxint  nx,
cxint  ny 
)

Creates an image container of a given type.

Parameters
nxDimension in X direction
nyDimension in Y direction
typePixel type
Returns
The newly created image.

The function creates a new image container and an allocates memory for an image of the given dimensions nx, ny. The allocated image is suitable for pixels of type type. The created property list is empty.

Definition at line 103 of file giimage.c.

References giraffe_image_delete(), and giraffe_image_new().

Referenced by giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), giraffe_localize_spectra(), giraffe_stacking_average(), giraffe_stacking_ksigma(), giraffe_stacking_median(), and giraffe_stacking_minmax().

void giraffe_image_delete ( GiImage *  self)

Destroys an image.

Parameters
selfThe image to destroy.

The function deallocates the memory used for the image data and all image properties.

Definition at line 189 of file giimage.c.

Referenced by giraffe_extract_spectra(), giraffe_fov_build(), giraffe_fov_clear(), giraffe_image_create(), and giraffe_rebinning_destroy().

GiImage* giraffe_image_duplicate ( const GiImage *  self)

Creates a copy of an image.

Parameters
selfThe image to copy.
Returns
Pointer to the newly allocated image.

The function creates a deep copy of the source image image, i.e. the image data and all properties are copied.

Definition at line 147 of file giimage.c.

References giraffe_image_new().

Referenced by giraffe_fov_build().

cpl_image* giraffe_image_get ( const GiImage *  self)
cpl_propertylist* giraffe_image_get_properties ( const GiImage *  self)

Get the properties of an image.

Parameters
selfImage to query.
Returns
Pointer to the image properties stored in the container.

The function returns a reference pointer to the properties, i.e. the keyword list stored in the image container self.

Definition at line 290 of file giimage.c.

Referenced by giraffe_add_rvcorrection(), giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_calibrate_wavelength(), giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), giraffe_fov_build(), giraffe_frame_create_image(), giraffe_get_raw_areas(), giraffe_grating_create(), giraffe_grating_setup(), giraffe_image_add_info(), giraffe_localize_spectra(), giraffe_rebin_spectra(), giraffe_subtract_dark(), giraffe_trim_raw_areas(), and giraffe_wlsolution_create().

cxint giraffe_image_load ( GiImage *  self,
const cxchar *  filename,
cxint  position 
)

Gets image data and properties from a file.

Parameters
selfGiraffe image.
filenameFile from which the pixel data and properties are read.
positionImage index within the file
Returns
The function returns 0 on success or 1 in case the pixel data or the image properties could not be loaded.

The function reads the pixel data and the properties for image number position from the file filename into the target image self.

In case the file contains a data cube at position position the plane number 0 is loaded.

See also
giraffe_image_load_pixels, giraffe_image_load_properties

Definition at line 544 of file giimage.c.

References giraffe_image_load_pixels(), and giraffe_image_load_properties().

cxint giraffe_image_load_pixels ( GiImage *  self,
const cxchar *  filename,
cxint  position,
cxint  plane 
)

Gets image data from a file.

Parameters
selfImage into which the data is read.
filenameFile from which the pixel data is read.
positionImage index within the file.
planePlane index within a data cube.
Returns
The function returns 0 on success or 1 in case the pixel data could not be loaded.

The function reads the pixel data for image number index from the file filename into the target image self. The pixel data type is converted to the target type if necessary. If the pixel data at position index in the file form a data cube, the function loads the plane with the index plane, otherwise plane is ignored.

Definition at line 459 of file giimage.c.

Referenced by giraffe_image_load().

cxint giraffe_image_load_properties ( GiImage *  self,
const cxchar *  filename,
cxint  position 
)

Gets image properties from a file.

Parameters
selfGiraffe image
filenameFile from which the properties are read
positionImage index within the file
Returns
The function returns 0 on success or 1 in case the image properties could not be loaded.

The function reads the image properties for the image at position position within the file filename and stores them in self.

If there are already properties associated to an image they will be replaced by calling this function.

Definition at line 496 of file giimage.c.

Referenced by giraffe_image_load().

GiImage* giraffe_image_new ( cpl_type  type)

Creates an empty image container.

Returns
Pointer to the newly created image container.

The function allocates memory for an empty image container.

Definition at line 73 of file giimage.c.

Referenced by giraffe_calibrate_flux(), giraffe_fov_build(), giraffe_image_create(), and giraffe_image_duplicate().

cxint giraffe_image_paste ( GiImage *  self,
const GiImage *  image,
cxint  x,
cxint  y,
cxbool  clip 
)

Paste an image into another at a given position.

Parameters
selfThe destination image.
imageThe source image.
xPixel offset along the x-axis.
yPixel offset along the y-axis.
clipFlag controlling the image clipping.
Returns
The function returns 0 on success or a non-zero value if an error occurred.

The function pastes the image image into the destination image self at the pixel position given by the coordinates x and y. The coordinates x and y indicate the position of the lower left pixel of image, starting from (0, 0). If clip is set to true, the image image is properly clipped, if parts of image would fall outside of the destination image because of the given coordinates x and y. If clip is false and the source image does not fit entirely into the destination image the function fails and the error code CPL_ERROR_ACCESS_OUT_RANGE is set.

Definition at line 661 of file giimage.c.

References giraffe_image_get().

void giraffe_image_print ( GiImage *  self)

Prints status information about a Giraffe image.

Parameters
selfGiraffe image
Returns
Nothing.

The function prints internal status information abaout the Giraffe image self to the standard output. This function is provided for debugging purposes.

Definition at line 749 of file giimage.c.

cxint giraffe_image_save ( GiImage *  self,
const cxchar *  filename 
)

Write a Giraffe image to a file.

Parameters
selfGiraffe image to write.
filenameFile to which self is written.
Returns
The function returns 0 on success and 1 otherwise.

The Giraffe image self is written to the file filename. Currently a Giraffe image can only be written as a FITS file with the image data in the primary data unit. The image properties are written/converted to the primary FITS header.

Definition at line 578 of file giimage.c.

Referenced by giraffe_frame_create_image().

cxint giraffe_image_set ( GiImage *  self,
cpl_image *  image 
)

Sets the image data.

Parameters
selfThe image to store the data.
imageThe source image the data is taken from.
Returns
The function returns 0 on success, or 1 in case of errors.

The function copies the pixel data of image into self. The pixel type of the source and the target image must match. If the type do not match the function returns an error.

Definition at line 252 of file giimage.c.

Referenced by giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_fov_build(), and giraffe_trim_raw_areas().

cxint giraffe_image_set_properties ( GiImage *  self,
cpl_propertylist *  properties 
)

Attaches a property list to an image.

Parameters
selfImage the properties will be attached to.
propertiesProperty list to attach.
Returns
The function returns 0 on success, or 1 otherwise.

The function stores a copy of the property list properties in the image container self.

If there is already a property list stored in the container self, it is replaced with the reference properties. If the properties cannot be copied, the function returns an error.

Definition at line 320 of file giimage.c.

Referenced by giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), giraffe_fov_build(), and giraffe_localize_spectra().


This file is part of the GIRAFFE Pipeline Reference Manual 2.14.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Wed Mar 11 2015 13:19:42 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2004