You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Content

Hierarchical geometry

It is assumed that all geometry components can be embedded in the higher level objects forming tree-like structure. For example for CSPAD, eight 2x1s can be embedded in quad, four quads can form CSPAD, CSPAD can be located somewhere relative to IP, etc. The building blocks of this hierarchical structure is a GeometryObject with appropriate functionality as explained below.

Class pyimgalgos.GeometryObject

Member data and functionality

  • GeometryObject (geo) holds member data for one record in the geometry file - set by input parameters at initialization
  • has reference to parent and the list of children objects - filled after the data file is loaded and all geos are defined
  • if geo is at lowest level, it has a reference to access pixel coordinate maps 

     from PyCSPadImage.PixCoords2x1 import PixCoords2x1
    ...
        if self.oname == 'SENS2X1:V1' : self.algo = PixCoords2x1(use_wide_pix_center=False)
        else                          : self.algo = None
  • Method

xarr, yarr, zarr = geo.get_pixel_coords()

returns x,y,z pixel coordinate arrays of this and all underlying geos.

  • if geo.algo is None - then this is not lowest level and the coordinate maps are extracted from children
  • if  geo.pname is None - then this is a top parent, root of the hierarchical tree.

Associated methods in the same file

Method

fname = '/reg/d/psdm/cxi/cxii0114/calib/CsPad::CalibV1/CxiDs1.0:Cspad.0/geometry/0-end.data'
list_of_geos = load_pars_from_file(fname)

loads parameters from geometry file, saves each data line from this file in geo, creates and  returns the  list_of_geos with already set relations between children and parents.

Other methods are for internal consumption:

geo=parse_line(line)

parent = find_parent(geo, list_of_geos) # if the parent name is missing in the list_of_geos, object is considered as a top

set_relations(list_of_geos)

In find_parent(geo, list_of_geos)  if the parent name is missing in the list_of_geos, object names, then object is considered as a top-parent and

one more object is added in the list_of_geos

top_parent = GeometryObject(pname=None, pindex=-1, oname=geobj.pname, oindex=geobj.pindex)

list_of_geos.append(top_parent)

Interface

    # Initialization
    fname = '/reg/d/psdm/cxi/cxii0114/calib/CsPad::CalibV1/CxiDs1.0:Cspad.0/geometry/0-end.data'
    list_of_geos = load_pars_from_file(fname)

	# Information printout
    for geo in list_of_geos : geo.print_geo()
    for geo in list_of_geos : geo.print_geo_children()

    # Access to the pixel coordinate arrays 
	top_geo = list_of_geos[-1] # the top parent object is appaended as a last element of the list
	xarr, yarr, zarr = top_geo.get_pixel_coords()

 

References

  • No labels