PSCalib::GeometryAccess Class Reference
[PSCalib package]

Class supports universal detector geometry description. More...

#include <GeometryAccess.h>

List of all members.

Public Types

typedef double image_t

Public Member Functions

 GeometryAccess (const std::string &path, unsigned pbits=0)
 Class constructor accepts path to the calibration "geometry" file and verbosity control bit-word.
virtual ~GeometryAccess ()
shpGO get_geo (const std::string &oname, const unsigned &oindex)
 Returns shared pointer to the geometry object specified by name and index.
shpGO get_top_geo ()
 Returns shared pointer to the top geometry object, for exampme CSPAD.
void get_pixel_coords (const double *&X, const double *&Y, const double *&Z, unsigned &size, const std::string &oname=std::string(), const unsigned &oindex=0, const bool do_tilt=true, const bool do_eval=false)
 Returns pixel coordinate arrays X, Y, Z, of size for specified geometry object.
void get_pixel_xy_at_z (const double *&XatZ, const double *&YatZ, unsigned &size, const double &Zplane=0, const std::string &oname=std::string(), const unsigned &oindex=0)
 Returns pixel coordinate arrays XatZ, YatZ, of size for specified Zplane and geometry object.
void get_pixel_areas (const double *&A, unsigned &size, const std::string &oname=std::string(), const unsigned &oindex=0)
 Returns pixel areas array A, of size for specified geometry object.
void get_pixel_mask (const int *&mask, unsigned &size, const std::string &oname=std::string(), const unsigned &oindex=0, const unsigned &mbits=0377)
 Returns pixel mask array of size for specified geometry object.
double get_pixel_scale_size (const std::string &oname=std::string(), const unsigned &oindex=0)
 Returns pixel scale size for specified geometry object through its children segment.
std::map< int, std::string > & get_dict_of_comments ()
 Returns dictionary of comments.
void print_list_of_geos ()
 Prints the list of geometry objects.
void print_list_of_geos_children ()
 Prints the list of geometry objects with children.
void print_comments_from_dict ()
 Prints comments loaded from input file and kept in the dictionary.
void print_pixel_coords (const std::string &oname=std::string(), const unsigned &oindex=0)
 Prints beginning of pixel coordinate arrays for specified geometry object (top object by default).
void get_pixel_coord_indexes (const unsigned *&iX, const unsigned *&iY, unsigned &size, const std::string &oname=std::string(), const unsigned &oindex=0, const double &pix_scale_size_um=0, const int *xy0_off_pix=0, const bool do_tilt=true)
 Returns pixel coordinate index arrays iX, iY of size for specified geometry object.
void get_pixel_xy_inds_at_z (const unsigned *&iX, const unsigned *&iY, unsigned &size, const double &Zplane=0, const std::string &oname=std::string(), const unsigned &oindex=0, const double &pix_scale_size_um=0, const int *xy0_off_pix=0)
 Returns pixel coordinate index arrays iX, iY of size for specified Zplane and geometry object.
ndarray< image_t, 2 > & ref_img_from_pixel_arrays (const unsigned *&iX, const unsigned *&iY, const double *W=0, const unsigned &size=0)
 Returns pointer to the data member ndarray<image_t, 2> image object.
void load_pars_from_file (const std::string &path=std::string())
 Loads calibration file.
void save_pars_in_file (const std::string &path=std::string())
 Saves calibration file.
void set_print_bits (unsigned pbits=0)
 Sets the m_pbits - printout control bitword.
void set_geo_pars (const std::string &oname=std::string(), const unsigned &oindex=0, const double &x0=0, const double &y0=0, const double &z0=0, const double &rot_z=0, const double &rot_y=0, const double &rot_x=0, const double &tilt_z=0, const double &tilt_y=0, const double &tilt_x=0)
 Sets self object geometry parameters.
void move_geo (const std::string &oname=std::string(), const unsigned &oindex=0, const double &dx=0, const double &dy=0, const double &dz=0)
 Adds offset for origin of the self object w.r.t. current position.
void tilt_geo (const std::string &oname=std::string(), const unsigned &oindex=0, const double &dt_x=0, const double &dt_y=0, const double &dt_z=0)
 Adds tilts to the self object w.r.t. current orientation.

Static Public Member Functions

static ndarray< image_t, 2 > img_from_pixel_arrays (const unsigned *&iX, const unsigned *&iY, const double *W=0, const unsigned &size=0)
 Static method returns image as ndarray<image_t, 2> object.


Detailed Description

Class supports universal detector geometry description.

This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.

Version:
Id
GeometryAccess.h 12031 2016-06-06 21:57:34Z dubrovin@SLAC.STANFORD.EDU
See also:
GeometryObject, CalibFileFinder, PSCalib/test/ex_geometry_access.cpp
Interface Description
Author:
Mikhail S. Dubrovin

Definition at line 165 of file GeometryAccess.h.


Member Typedef Documentation

typedef double PSCalib::GeometryAccess::image_t

Definition at line 173 of file GeometryAccess.h.


Constructor & Destructor Documentation

PSCalib::GeometryAccess::GeometryAccess ( const std::string &  path,
unsigned  pbits = 0 
)

Class constructor accepts path to the calibration "geometry" file and verbosity control bit-word.

Parameters:
[in] path path to the calibration "geometry" file
[in] pbits verbosity control bit-word;
=0 print nothing,
+1 info about loaded file,
+2 list of geometry objects,
+8 list of geometry objects with childrens,
+16 info about setting relations between geometry objects,
+32 info about pixel coordinate reconstruction

virtual PSCalib::GeometryAccess::~GeometryAccess (  )  [virtual]


Member Function Documentation

std::map<int, std::string>& PSCalib::GeometryAccess::get_dict_of_comments (  )  [inline]

Returns dictionary of comments.

Definition at line 274 of file GeometryAccess.h.

shpGO PSCalib::GeometryAccess::get_geo ( const std::string &  oname,
const unsigned &  oindex 
)

Returns shared pointer to the geometry object specified by name and index.

void PSCalib::GeometryAccess::get_pixel_areas ( const double *&  A,
unsigned &  size,
const std::string &  oname = std::string(),
const unsigned &  oindex = 0 
)

Returns pixel areas array A, of size for specified geometry object.

Parameters:
[out] A - pointer to pixel areas array
[out] size - size of the pixel array (number of pixels)
[in] oname - object name
[in] oindex - object index

void PSCalib::GeometryAccess::get_pixel_coord_indexes ( const unsigned *&  iX,
const unsigned *&  iY,
unsigned &  size,
const std::string &  oname = std::string(),
const unsigned &  oindex = 0,
const double &  pix_scale_size_um = 0,
const int *  xy0_off_pix = 0,
const bool  do_tilt = true 
)

Returns pixel coordinate index arrays iX, iY of size for specified geometry object.

Parameters:
[out] iX - pointer to x pixel index coordinate array
[out] iY - pointer to y pixel index coordinate array
[out] size - size of the pixel coordinate array (number of pixels)
[in] oname - object name (deafault - top object)
[in] oindex - object index (default = 0)
[in] pix_scale_size_um - ex.: 109.92 (default - search for the first segment pixel size)
[in] xy0_off_pix - array containing X and Y coordinates of the offset (default - use xmin, ymin)
[in] do_tilt - on/off tilt angle correction

Referenced by ImgAlgos::NDArrImageProducer::getCalibPars().

void PSCalib::GeometryAccess::get_pixel_coords ( const double *&  X,
const double *&  Y,
const double *&  Z,
unsigned &  size,
const std::string &  oname = std::string(),
const unsigned &  oindex = 0,
const bool  do_tilt = true,
const bool  do_eval = false 
)

Returns pixel coordinate arrays X, Y, Z, of size for specified geometry object.

Parameters:
[out] X - pointer to x pixel coordinate array
[out] Y - pointer to y pixel coordinate array
[out] Z - pointer to z pixel coordinate array
[out] size - size of the pixel coordinate array (number of pixels)
[in] oname - object name
[in] oindex - object index
[in] do_tilt - on/off tilt angle correction
[in] do_eval - update all evaluated arrays

void PSCalib::GeometryAccess::get_pixel_mask ( const int *&  mask,
unsigned &  size,
const std::string &  oname = std::string(),
const unsigned &  oindex = 0,
const unsigned &  mbits = 0377 
)

Returns pixel mask array of size for specified geometry object.

Parameters:
[out] mask - pointer to pixel mask array
[out] size - size of the pixel array (number of pixels)
[in] oname - object name
[in] oindex - object index
[in] mbits - mask control bits; +1-mask edges, +2-two wide central columns, +4-non-bounded, +8-non-bounded neighbours.

double PSCalib::GeometryAccess::get_pixel_scale_size ( const std::string &  oname = std::string(),
const unsigned &  oindex = 0 
)

Returns pixel scale size for specified geometry object through its children segment.

Parameters:
[in] oname - object name
[in] oindex - object index

Referenced by PSQt::GeoImage::getImage().

void PSCalib::GeometryAccess::get_pixel_xy_at_z ( const double *&  XatZ,
const double *&  YatZ,
unsigned &  size,
const double &  Zplane = 0,
const std::string &  oname = std::string(),
const unsigned &  oindex = 0 
)

Returns pixel coordinate arrays XatZ, YatZ, of size for specified Zplane and geometry object.

Parameters:
[out] XatZ - pointer to x pixel coordinate array at specified Zplane
[out] YatZ - pointer to y pixel coordinate array
[out] size - size of the pixel coordinate array (number of pixels)
[in] Zplane - z-coordinate of the plane for projection
[in] oname - object name
[in] oindex - object index

void PSCalib::GeometryAccess::get_pixel_xy_inds_at_z ( const unsigned *&  iX,
const unsigned *&  iY,
unsigned &  size,
const double &  Zplane = 0,
const std::string &  oname = std::string(),
const unsigned &  oindex = 0,
const double &  pix_scale_size_um = 0,
const int *  xy0_off_pix = 0 
)

Returns pixel coordinate index arrays iX, iY of size for specified Zplane and geometry object.

Parameters:
[out] iX - pointer to x pixel index coordinate array
[out] iY - pointer to y pixel index coordinate array
[out] size - size of the pixel coordinate array (number of pixels)
[in] Zplane - z-coordinate of the plane for projection (default=0 - evaluated as average z ovetr all pixels)
[in] oname - object name (deafault - top object)
[in] oindex - object index (default = 0)
[in] pix_scale_size_um - ex.: 109.92 (default - search for the first segment pixel size)
[in] xy0_off_pix - array containing X and Y coordinates of the offset (default - use xmin, ymin)

Referenced by PSQt::GeoImage::getImage().

shpGO PSCalib::GeometryAccess::get_top_geo (  ) 

Returns shared pointer to the top geometry object, for exampme CSPAD.

Referenced by PSQt::GeoImage::getImage().

static ndarray<image_t, 2> PSCalib::GeometryAccess::img_from_pixel_arrays ( const unsigned *&  iX,
const unsigned *&  iY,
const double *  W = 0,
const unsigned &  size = 0 
) [static]

Static method returns image as ndarray<image_t, 2> object.

Parameters:
[in] iX - pointer to x pixel index coordinate array
[in] iY - pointer to y pixel index coordinate array
[in] W - pointer to the intensity (weights) array (default - set 1 for each pixel)
[in] size - size of the pixel coordinate array (number of pixels)

Referenced by Detector::DetectorAccess::get_image(), main(), and test_cspad2x2().

void PSCalib::GeometryAccess::load_pars_from_file ( const std::string &  path = std::string()  ) 

Loads calibration file.

Parameters:
[in] path - path to the file with calibration parameters of type "geometry"

void PSCalib::GeometryAccess::move_geo ( const std::string &  oname = std::string(),
const unsigned &  oindex = 0,
const double &  dx = 0,
const double &  dy = 0,
const double &  dz = 0 
)

Adds offset for origin of the self object w.r.t. current position.

void PSCalib::GeometryAccess::print_comments_from_dict (  ) 

Prints comments loaded from input file and kept in the dictionary.

void PSCalib::GeometryAccess::print_list_of_geos (  ) 

Prints the list of geometry objects.

void PSCalib::GeometryAccess::print_list_of_geos_children (  ) 

Prints the list of geometry objects with children.

void PSCalib::GeometryAccess::print_pixel_coords ( const std::string &  oname = std::string(),
const unsigned &  oindex = 0 
)

Prints beginning of pixel coordinate arrays for specified geometry object (top object by default).

Referenced by ImgAlgos::NDArrImageProducer::getCalibPars().

ndarray<image_t, 2>& PSCalib::GeometryAccess::ref_img_from_pixel_arrays ( const unsigned *&  iX,
const unsigned *&  iY,
const double *  W = 0,
const unsigned &  size = 0 
)

Returns pointer to the data member ndarray<image_t, 2> image object.

Referenced by PSQt::GeoImage::getImage().

void PSCalib::GeometryAccess::save_pars_in_file ( const std::string &  path = std::string()  ) 

Saves calibration file.

Parameters:
[in] path - path to the file with calibration parameters of type "geometry"

Referenced by PSQt::GeoTree::saveGeometryInFile().

void PSCalib::GeometryAccess::set_geo_pars ( const std::string &  oname = std::string(),
const unsigned &  oindex = 0,
const double &  x0 = 0,
const double &  y0 = 0,
const double &  z0 = 0,
const double &  rot_z = 0,
const double &  rot_y = 0,
const double &  rot_x = 0,
const double &  tilt_z = 0,
const double &  tilt_y = 0,
const double &  tilt_x = 0 
)

Sets self object geometry parameters.

void PSCalib::GeometryAccess::set_print_bits ( unsigned  pbits = 0  )  [inline]

Sets the m_pbits - printout control bitword.

Parameters:
[in] pbits - printout control bitword

Definition at line 365 of file GeometryAccess.h.

References src::PyDetectorAccess::pbits.

void PSCalib::GeometryAccess::tilt_geo ( const std::string &  oname = std::string(),
const unsigned &  oindex = 0,
const double &  dt_x = 0,
const double &  dt_y = 0,
const double &  dt_z = 0 
)

Adds tilts to the self object w.r.t. current orientation.


The documentation for this class was generated from the following file:
Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7