GeometryAccess Namespace Reference


Classes

class  GeometryAccess

Functions

 GeometryAccess (const std::string &path, unsigned pbits)
 ~GeometryAccess ()
void load_pars_from_file (const std::string &path)
void save_pars_in_file (const std::string &path)
void add_comment_to_dict (const std::string &line)
GeometryAccess::shpGO parse_line (const std::string &line)
GeometryAccess::shpGO find_parent (const GeometryAccess::shpGO &geobj)
void set_relations ()
GeometryAccess::shpGO get_geo (const std::string &oname, const unsigned &oindex)
GeometryAccess::shpGO get_top_geo ()
void get_pixel_coords (const double *&X, const double *&Y, const double *&Z, unsigned &size, const std::string &oname, const unsigned &oindex, const bool do_tilt, const bool do_eval)
void get_pixel_xy_at_z (const double *&XatZ, const double *&YatZ, unsigned &size, const double &Zplain, const std::string &oname, const unsigned &oindex)
void get_pixel_areas (const double *&A, unsigned &size, const std::string &oname, const unsigned &oindex)
void get_pixel_mask (const int *&mask, unsigned &size, const std::string &oname, const unsigned &oindex, const unsigned &mbits)
double get_pixel_scale_size (const std::string &oname, const unsigned &oindex)
void set_geo_pars (const std::string &oname, const unsigned &oindex, const double &x0, const double &y0, const double &z0, const double &rot_z, const double &rot_y, const double &rot_x, const double &tilt_z, const double &tilt_y, const double &tilt_x)
void move_geo (const std::string &oname, const unsigned &oindex, const double &dx, const double &dy, const double &dz)
void tilt_geo (const std::string &oname, const unsigned &oindex, const double &dt_x, const double &dt_y, const double &dt_z)
void print_list_of_geos ()
void print_list_of_geos_children ()
void print_comments_from_dict ()
void print_pixel_coords (const std::string &oname, const unsigned &oindex)
void get_pixel_coord_indexes (const unsigned *&iX, const unsigned *&iY, unsigned &size, const std::string &oname, const unsigned &oindex, const double &pix_scale_size_um, const int *xy0_off_pix, const bool do_tilt)
void get_pixel_xy_inds_at_z (const unsigned *&iX, const unsigned *&iY, unsigned &size, const double &Zplain, const std::string &oname, const unsigned &oindex, const double &pix_scale_size_um, const int *xy0_off_pix)
ndarray< GeometryAccess::image_t, 2 > & ref_img_from_pixel_arrays (const unsigned *&iX, const unsigned *&iY, const double *W, const unsigned &size)
ndarray< GeometryAccess::image_t, 2 > img_from_pixel_arrays (const unsigned *&iX, const unsigned *&iY, const double *W, const unsigned &size)
def divide_protected
def img_default
def img_from_pixel_arrays
def test_access
def test_plot_quad
def test_mask_quad
def test_plot_cspad
def test_img_default
def test_save_pars_in_file
def test_load_pars_from_file
def test_cspad2x2
def test_epix100a
def test_cspad_xy_at_z

Variables

string __version__ = "$Revision: 12898 $"
string basedir = '/reg/g/psdm/detector/alignment/cspad/calib-cxi-ds1-2014-03-19/'
 fname = '/reg/d/psdm/cxi/cxii0114/calib/CsPadCalibV1/CxiDs1.0:Cspad.0/geometry/0-end.data' basedir = '/reg/neh/home1/dubrovin/LCLS/CSPadAlignment-v01/calib-cxi-ds1-2013-12-20/' fname_geometry = basedir + 'calib/CsPadCalibV1/CxiDs1.0:Cspad.0/geometry/1-end.data' fname_data = basedir + 'cspad-ndarr-ave-cxi83714-r0136.dat' amp_range = (0,0.5)
string fname_data = 'cspad-ndarr-ave-cxii0114-r0227.dat'
string fname_geometry = 'calib/CsPad::CalibV1/CxiDs1.0:Cspad.0/geometry/0-end.data'
tuple amp_range = (0,500)
tuple geometry = GeometryAccess(fname_geometry, 0)
 XPP basedir = '/reg/neh/home1/dubrovin/LCLS/CSPadAlignment-v01/calib-xpp-2013-01-29/' fname_data = basedir + 'cspad-xpptut13-r1437-nda.dat' fname_geometry = basedir + 'calib/CsPadCalibV1/XppGon.0:Cspad.0/geometry/0-end.data' amp_range = (1500,2500).
string msg = 'Use command: sys.argv[0] <num>, wher num=1,2,3,...,10'
tuple ga0 = GeometryAccess(fname_geometry, 0)


Function Documentation

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

Definition at line 48 of file GeometryAccess.cpp.

References src::psana_doc_info::info, load_pars_from_file(), MsgLog, setup::name, print_comments_from_dict(), print_list_of_geos(), and print_list_of_geos_children().

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

GeometryAccess::~GeometryAccess (  ) 

Definition at line 70 of file GeometryAccess.cpp.

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

Definition at line 80 of file GeometryAccess.cpp.

References add_comment_to_dict(), ex_save_load_nda::f, src::psana_doc_info::info, importCheetah::line, m_path, MsgLog, setup::name, parse_line(), and set_relations().

Referenced by GeometryAccess().

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

Definition at line 112 of file GeometryAccess.cpp.

References src::psana_doc_info::info, iter, MsgLog, and setup::name.

void GeometryAccess::add_comment_to_dict ( const std::string &  line  ) 

Definition at line 143 of file GeometryAccess.cpp.

References xtc2cxi::ind.

Referenced by load_pars_from_file().

GeometryAccess::shpGO GeometryAccess::parse_line ( const std::string &  line  ) 

Definition at line 198 of file GeometryAccess.cpp.

References GeometryObject::GeometryObject(), msg, MsgLog, and setup::name.

Referenced by load_pars_from_file().

GeometryAccess::shpGO GeometryAccess::find_parent ( const GeometryAccess::shpGO geobj  ) 

Definition at line 245 of file GeometryAccess.cpp.

References GeometryObject::GeometryObject().

Referenced by set_relations().

void GeometryAccess::set_relations (  ) 

Definition at line 282 of file GeometryAccess.cpp.

References find_parent(), src::psana_doc_info::info, MsgLog, and setup::name.

Referenced by load_pars_from_file().

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

Definition at line 307 of file GeometryAccess.cpp.

Referenced by get_pixel_areas(), get_pixel_coords(), get_pixel_mask(), get_pixel_scale_size(), move_geo(), set_geo_pars(), and tilt_geo().

GeometryAccess::shpGO GeometryAccess::get_top_geo (  ) 

Definition at line 320 of file GeometryAccess.cpp.

Referenced by get_pixel_areas(), get_pixel_coords(), get_pixel_mask(), get_pixel_scale_size(), move_geo(), set_geo_pars(), and tilt_geo().

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

Definition at line 328 of file GeometryAccess.cpp.

References ex_cspad_quads_data::geo, get_geo(), get_top_geo(), src::psana_doc_info::info, MsgLog, setup::name, and GeometryObject::string_geo_children().

Referenced by get_pixel_coord_indexes(), get_pixel_xy_at_z(), Detector::DetectorAccess::pixel_coords_x(), Detector::DetectorAccess::pixel_coords_y(), Detector::DetectorAccess::pixel_coords_z(), and print_pixel_coords().

void GeometryAccess::get_pixel_xy_at_z ( const double *&  XatZ,
const double *&  YatZ,
unsigned &  size,
const double &  Zplain,
const std::string &  oname,
const unsigned &  oindex 
)

Definition at line 349 of file GeometryAccess.cpp.

References get_pixel_coords(), ex_all_dets::i, MsgLog, setup::name, src::toolbox::R, and propagator::X.

Referenced by get_pixel_xy_inds_at_z().

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

Definition at line 407 of file GeometryAccess.cpp.

References ex_cspad_quads_data::geo, get_geo(), get_top_geo(), src::psana_doc_info::info, msg, MsgLog, setup::name, and GeometryObject::string_geo_children().

Referenced by Detector::DetectorAccess::pixel_areas().

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

Definition at line 423 of file GeometryAccess.cpp.

References ex_cspad_quads_data::geo, get_geo(), get_top_geo(), src::psana_doc_info::info, msg, MsgLog, setup::name, and GeometryObject::string_geo_children().

Referenced by Detector::DetectorAccess::pixel_mask_geo().

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

Definition at line 442 of file GeometryAccess.cpp.

References ex_cspad_quads_data::geo, get_geo(), and get_top_geo().

Referenced by get_pixel_coord_indexes(), get_pixel_xy_inds_at_z(), and Detector::DetectorAccess::pixel_scale_size().

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

Definition at line 452 of file GeometryAccess.cpp.

References ex_cspad_quads_data::geo, get_geo(), and get_top_geo().

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

Definition at line 472 of file GeometryAccess.cpp.

References ex_cspad_quads_data::geo, get_geo(), and get_top_geo().

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

Definition at line 486 of file GeometryAccess.cpp.

References ex_cspad_quads_data::geo, get_geo(), and get_top_geo().

void GeometryAccess::print_list_of_geos (  ) 

Definition at line 499 of file GeometryAccess.cpp.

References src::psana_doc_info::info, MsgLog, and setup::name.

Referenced by GeometryAccess().

void GeometryAccess::print_list_of_geos_children (  ) 

Definition at line 513 of file GeometryAccess.cpp.

References src::psana_doc_info::info, MsgLog, and setup::name.

Referenced by GeometryAccess().

void GeometryAccess::print_comments_from_dict (  ) 

Definition at line 528 of file GeometryAccess.cpp.

References src::psana_doc_info::info, iter, MsgLog, and setup::name.

Referenced by GeometryAccess().

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

Definition at line 544 of file GeometryAccess.cpp.

References get_pixel_coords(), ex_all_dets::i, src::psana_doc_info::info, MsgLog, setup::name, CalibPars::size, and propagator::X.

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

Definition at line 567 of file GeometryAccess.cpp.

References get_pixel_coords(), get_pixel_scale_size(), ex_all_dets::i, and propagator::X.

Referenced by Detector::DetectorAccess::get_image(), Detector::DetectorAccess::pixel_indexes_x(), and Detector::DetectorAccess::pixel_indexes_y().

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

Definition at line 620 of file GeometryAccess.cpp.

References get_pixel_scale_size(), get_pixel_xy_at_z(), ex_all_dets::i, and propagator::X.

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

Definition at line 673 of file GeometryAccess.cpp.

References ex_all_dets::i, ex_all_dets::img, and ex_algos::shape.

ndarray<GeometryAccess::image_t, 2> GeometryAccess::img_from_pixel_arrays ( const unsigned *&  iX,
const unsigned *&  iY,
const double *  W,
const unsigned &  size 
)

Definition at line 701 of file GeometryAccess.cpp.

References ex_all_dets::i, and ex_all_dets::img.

def GeometryAccess::divide_protected (   num,
  den,
  vsub_zero = 0 
)

Returns result of devision of numpy arrays num/den with substitution of value vsub_zero for zero den elements.

Definition at line 115 of file GeometryAccess.py.

def GeometryAccess::img_default (   shape = (10,10,
  dtype = np.float32 
)

Returns default image

Definition at line 686 of file GeometryAccess.py.

def GeometryAccess::img_from_pixel_arrays (   iX,
  iY,
  W = None,
  dtype = np.float32,
  vbase = 0 
)

Returns image from iX, iY coordinate index arrays and associated weights W.

Definition at line 695 of file GeometryAccess.py.

def GeometryAccess::test_access (   geometry  ) 

Tests geometry acess methods of the class GeometryAccess

Definition at line 731 of file GeometryAccess.py.

def GeometryAccess::test_plot_quad (   geometry  ) 

Tests geometry acess methods of the class GeometryAccess object for CSPAD quad

Definition at line 783 of file GeometryAccess.py.

def GeometryAccess::test_mask_quad (   geometry,
  mbits 
)

Tests geometry acess methods of the class GeometryAccess object for CSPAD quad

Definition at line 803 of file GeometryAccess.py.

def GeometryAccess::test_plot_cspad (   geometry,
  fname_data,
  amp_range = (0,0.5 
)

The same test as previous, but use get_pixel_coord_indexes(...) method

Definition at line 823 of file GeometryAccess.py.

def GeometryAccess::test_img_default (  ) 

Test default image

Definition at line 860 of file GeometryAccess.py.

def GeometryAccess::test_save_pars_in_file (   geometry  ) 

Test default image

Definition at line 869 of file GeometryAccess.py.

def GeometryAccess::test_load_pars_from_file (   geometry  ) 

Test default image

Definition at line 881 of file GeometryAccess.py.

def GeometryAccess::test_cspad2x2 (  ) 

Test cspad2x2 geometry table

Definition at line 890 of file GeometryAccess.py.

Referenced by main().

def GeometryAccess::test_epix100a (  ) 

Test test_epix100a geometry table

Definition at line 925 of file GeometryAccess.py.

def GeometryAccess::test_cspad_xy_at_z (  ) 

Test cspad geometry table

Definition at line 953 of file GeometryAccess.py.


Variable Documentation

string GeometryAccess::__version__ = "$Revision: 12898 $" [static]

Definition at line 103 of file GeometryAccess.py.

string GeometryAccess::basedir = '/reg/g/psdm/detector/alignment/cspad/calib-cxi-ds1-2014-03-19/' [static]

fname = '/reg/d/psdm/cxi/cxii0114/calib/CsPadCalibV1/CxiDs1.0:Cspad.0/geometry/0-end.data' basedir = '/reg/neh/home1/dubrovin/LCLS/CSPadAlignment-v01/calib-cxi-ds1-2013-12-20/' fname_geometry = basedir + 'calib/CsPadCalibV1/CxiDs1.0:Cspad.0/geometry/1-end.data' fname_data = basedir + 'cspad-ndarr-ave-cxi83714-r0136.dat' amp_range = (0,0.5)

Definition at line 1002 of file GeometryAccess.py.

Referenced by main(), and test_cspad2x2().

string GeometryAccess::fname_data = 'cspad-ndarr-ave-cxii0114-r0227.dat' [static]

Definition at line 1003 of file GeometryAccess.py.

Referenced by main(), and test_cspad2x2().

string GeometryAccess::fname_geometry = 'calib/CsPad::CalibV1/CxiDs1.0:Cspad.0/geometry/0-end.data' [static]

Definition at line 1004 of file GeometryAccess.py.

Referenced by main(), and test_cspad2x2().

tuple GeometryAccess::amp_range = (0,500) [static]

Definition at line 1006 of file GeometryAccess.py.

tuple GeometryAccess::geometry = GeometryAccess(fname_geometry, 0) [static]

XPP basedir = '/reg/neh/home1/dubrovin/LCLS/CSPadAlignment-v01/calib-xpp-2013-01-29/' fname_data = basedir + 'cspad-xpptut13-r1437-nda.dat' fname_geometry = basedir + 'calib/CsPadCalibV1/XppGon.0:Cspad.0/geometry/0-end.data' amp_range = (1500,2500).

Definition at line 1029 of file GeometryAccess.py.

Referenced by CSPadImageProducer::getGeometryPars(), CSPadPixCoords::CSPad2x2ImageProducer::getGeometryPars(), main(), PSQt::GeoImage::onGeometryIsLoaded(), and test_cspad2x2().

string GeometryAccess::msg = 'Use command: sys.argv[0] <num>, wher num=1,2,3,...,10' [static]

Definition at line 1031 of file GeometryAccess.py.

Referenced by get_pixel_areas(), get_pixel_mask(), and parse_line().

tuple GeometryAccess::ga0 = GeometryAccess(fname_geometry, 0) [static]

Definition at line 1040 of file GeometryAccess.py.


Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7