Pixel grid

Data Structures

struct  muse_pixels_ext
 The pixel extension map. More...
struct  muse_pixgrid
 The pixel grid. More...

Functions

muse_pixgridmuse_pixgrid_create (muse_pixtable *aPixtable, cpl_propertylist *aHeader, cpl_size aXSize, cpl_size aYSize, cpl_size aZSize)
 Convert selected rows of a pixel table into pixel grid, linking the grid points to entries (=rows) in the pixel table.
muse_pixgridmuse_pixgrid_2d_create (cpl_table *aTable, double aDX, double aZMin, double aZMax, double aDZ, float *aXMin)
 Convert selected rows of a pixel table into 2D pixgrid, linking the grid points to entries (=rows) in the pixel table.
void muse_pixgrid_delete (muse_pixgrid *aPixels)
 Delete a pixgrid and remove its memory.
static cpl_size muse_pixgrid_get_index (muse_pixgrid *aPixels, cpl_size aX, cpl_size aY, cpl_size aZ, cpl_boolean aAllowOutside)
 Get the grid index determined from all three coordinates.
static cpl_size muse_pixgrid_get_count (muse_pixgrid *aPixels, cpl_size aIndex)
 Return the number of rows stored in one pixel.
static const cpl_size * muse_pixgrid_get_rows (muse_pixgrid *aPixels, cpl_size aIndex)
 Return a pointer to the rows stored in one pixel.

Detailed Description

The pixel grid is an index structure that is used when resampling a pixel table into a datacube but can generally be used to find neighbors in the 3D data of the pixel table.


Function Documentation

muse_pixgrid* muse_pixgrid_2d_create ( cpl_table *  aTable,
double  aDX,
double  aZMin,
double  aZMax,
double  aDZ,
float *  aXMin 
)

Convert selected rows of a pixel table into 2D pixgrid, linking the grid points to entries (=rows) in the pixel table.

Parameters:
aTable the table component of a MUSE pixel table
aDX X (spaxel) bin size
aZMin Lower z (wavelength) limit
aZMax Upper z (wavelength) limit
aDZ Z (wavelength) bin size
aXMin Lower x (spaxel) limit computed here (can be NULL)
Returns:
The output pixgrid or NULL on error.

The Y coordinate is ignored in this function.

Exceptions:
set CPL_ERROR_NULL_INPUT, return NULL aTable is NULL or it contains zero rows
set CPL_ERROR_ILLEGAL_INPUT, return NULL one of the sizes is not positive
set CPL_ERROR_DATA_NOT_FOUND, return NULL aTable is missing one of the coordinate columns

Definition at line 332 of file muse_pixgrid.c.

References muse_pixgrid_get_index().

muse_pixgrid* muse_pixgrid_create ( muse_pixtable aPixtable,
cpl_propertylist *  aHeader,
cpl_size  aXSize,
cpl_size  aYSize,
cpl_size  aZSize 
)

Convert selected rows of a pixel table into pixel grid, linking the grid points to entries (=rows) in the pixel table.

Parameters:
aPixtable the input pixel table
aHeader the FITS header of the MUSE datacube to be created
aXSize x size of the output grid
aYSize y size of the output grid
aZSize z size of the output grid (wavelength direction)
Returns:
A muse_pixels * buffer for the output pixel grid or NULL on error.
Remarks:
The returned pixel grid has to be deallocated after use with muse_pixgrid_delete().

Construct a standard C array, where the array indices representing the 3D grid in the sense the the x-coordinate is varying fastest, the lambda-coordinate varying slowest (like in FITS buffers), i.e. index = [i + nx * j + nx*ny * l] (i: x-axis index, j: y-axis index, l: lambda-axis index, nx: x-axis length, ny: y-axis length). For each pixel table row search for the closest grid point. Store the pixel table row number in that grid point.

Exceptions:
set CPL_ERROR_NULL_INPUT, return NULL aPixtable is NULL or it contains zero rows
set CPL_ERROR_ILLEGAL_INPUT, return NULL one of the sizes is not positive
set CPL_ERROR_UNSUPPORTED_MODE, return NULL the WCS in the pixel table is neither in pixels nor degrees
set CPL_ERROR_DATA_NOT_FOUND, return NULL aPixtable is missing one of the coordinate columns

Definition at line 169 of file muse_pixgrid.c.

References muse_wcs::cd22, muse_wcs::crpix2, muse_wcs::crval2, muse_pixtable::header, muse_wcs::iscelsph, muse_pfits_get_cd(), muse_pfits_get_crpix(), muse_pfits_get_crval(), muse_pfits_get_ctype(), muse_pixgrid_get_count(), muse_pixgrid_get_index(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_WCS_CELSPH, muse_pixtable_wcs_check(), MUSE_PIXTABLE_WCS_PIXEL, muse_wcs_new(), muse_wcs_pixel_from_celestial_fast(), muse_wcs_pixel_from_projplane_fast(), and muse_pixtable::table.

Referenced by muse_resampling_cube().

void muse_pixgrid_delete ( muse_pixgrid aPixels  ) 

Delete a pixgrid and remove its memory.

Parameters:
aPixels Pointer to pixgrid.

Definition at line 400 of file muse_pixgrid.c.

Referenced by muse_dar_check(), muse_postproc_cube_resample_and_collapse(), and muse_resampling_cube().

static cpl_size muse_pixgrid_get_count ( muse_pixgrid aPixels,
cpl_size  aIndex 
) [static]

Return the number of rows stored in one pixel.

Parameters:
aPixels Pointer to pixgrid.
aIndex Pixel index, as computed by muse_pixgrid_get_index().
Note:
This function is defined as static inline, i.e. should get integrated into the caller by the compiler, to maximise execution speed.

Definition at line 129 of file muse_pixgrid.h.

Referenced by muse_dar_check(), muse_pixgrid_create(), and muse_resampling_collapse_pixgrid().

static cpl_size muse_pixgrid_get_index ( muse_pixgrid aPixels,
cpl_size  aX,
cpl_size  aY,
cpl_size  aZ,
cpl_boolean  aAllowOutside 
) [static]

Get the grid index determined from all three coordinates.

Parameters:
aPixels Pointer to pixgrid.
aX x index
aY y index
aZ z index
aAllowOutside if true, return a positive value for pixels nominally outside the grid
Returns:
Index to be used in the other pixgrid functions, or -1 on error.
Note:
This function is defined as static inline, i.e. should get integrated into the caller by the compiler, to maximise execution speed.

Definition at line 89 of file muse_pixgrid.h.

Referenced by muse_dar_check(), muse_pixgrid_2d_create(), muse_pixgrid_create(), and muse_resampling_collapse_pixgrid().

static const cpl_size* muse_pixgrid_get_rows ( muse_pixgrid aPixels,
cpl_size  aIndex 
) [static]

Return a pointer to the rows stored in one pixel.

Parameters:
aPixels Pointer to pixgrid.
aIndex Pixel index, as computed by muse_pixgrid_get_index().
Note:
This function is defined as static inline, i.e. should get integrated into the caller by the compiler, to maximise execution speed.

Definition at line 150 of file muse_pixgrid.h.

Referenced by muse_dar_check(), and muse_resampling_collapse_pixgrid().


Generated on 26 Jan 2017 for MUSE Pipeline Reference Manual by  doxygen 1.6.1