catm-python-lib
Loading...
Searching...
No Matches
catmviewer.py File Reference

analysis utilities related to CAT-M More...

Go to the source code of this file.

Functions

 catmlib.util.catmviewer.find_nearest_index (array, value)
 find index of nearest point
 catmlib.util.catmviewer.calculate_track_dipole_magnet_analytical_solution (v0=np.array([1, 0, 0]), x0=np.array([0, 0, 0]), omega=1, t=0)
 analytical solution for equation of moyion in uniform magnetic field
 catmlib.util.catmviewer.calculate_unit_vector (v=np.array([-0.2, 0.01, 0.01]))
 calculate and return unit vector
 catmlib.util.catmviewer.calculate_extrapolated_position (position, direction, target_value, direction_to_extrapolate=2)
 calculate and return extrapolated_position
 catmlib.util.catmviewer.plot_3d_trajectory (x=[], y=[], z=[], u=[], v=[], w=[], x_lim=None, y_lim=None, z_lim=None, bpad=None, rpad=None, spad=None, bid=None, rid=None, sid=None, anaflag=-1, showflag=True, savepath=None, user_colors=['#B844A0','#36797A','#36797A','#B844A0'])
 plot 3 disimensional trajectories
 catmlib.util.catmviewer.plot_2d_trajectory (x=[], y=[], z=[], u=[], v=[], w=[], x_lim=None, y_lim=None, z_lim=None, bpad=None, rpad=None, spad=None, bid=None, rid=None, sid=None, anaflag=-1, showflag=True, savepath=None, user_colors=['#B844A0','#36797A','#36797A','#B844A0'])
 plot 3 disimensional trajectories
 catmlib.util.catmviewer.plot_2d_categories (x_lim=None, y_lim=None, z_lim=None, bpad=None, rpad=None, spad=None, bid=None, rid=None, sid=None, blabel=None, rlabel=None, slabel=None, showflag=True, savepath=None, user_colors=[['#B844A0'],['#36797A'],["#5CA3EF"]], legendFlag=False, title_name="Map file checker (Cobo, AsAd, AGET, Channel), [-1] = all")
 plot categories with 2 disimension
 catmlib.util.catmviewer.check_catm_view ()
 plot catm readpad using matplotlib

Detailed Description

analysis utilities related to CAT-M

Version
1
Author
Fumitaka ENDO
Date
2025-01-28T13:22:04+09:00

Definition in file catmviewer.py.

Function Documentation

◆ calculate_extrapolated_position()

catmlib.util.catmviewer.calculate_extrapolated_position ( position,
direction,
target_value,
direction_to_extrapolate = 2 )

calculate and return extrapolated_position

Parameters
positionreference position
directionrefarence vector
target_valueextrapolated value
direction_to_extrapolateextrapolated axis
Returns
extrapolated position (np.array([x, y, z]))

Definition at line 51 of file catmviewer.py.

◆ calculate_track_dipole_magnet_analytical_solution()

catmlib.util.catmviewer.calculate_track_dipole_magnet_analytical_solution ( v0 = np.array([1,0,0]),
x0 = np.array([0,0,0]),
omega = 1,
t = 0 )

analytical solution for equation of moyion in uniform magnetic field

Parameters
v0initial vector [m] (numpy.array([x,y,z]))
x0initial position [m] (numpy.array([x,y,z]))
omegacyclotron frequency (qB/m [C][T][m]^-1)
tlist of time, which you want to calculate the position
Returns
list of 3 component : [x1,x2,..,x3],[y1,y2,..,y3], [z1,z2,..,z3]

Definition at line 27 of file catmviewer.py.

◆ calculate_unit_vector()

catmlib.util.catmviewer.calculate_unit_vector ( v = np.array([-0.2, 0.01, 0.01]))

calculate and return unit vector

Parameters
vvector (np.array([-x, y, z]))
Returns
unit vector of input vector

Definition at line 42 of file catmviewer.py.

◆ check_catm_view()

catmlib.util.catmviewer.check_catm_view ( )

plot catm readpad using matplotlib

Definition at line 568 of file catmviewer.py.

◆ find_nearest_index()

catmlib.util.catmviewer.find_nearest_index ( array,
value )

find index of nearest point

Parameters
arrayreference array for sorting index
referencevalue
Returns
index value

Definition at line 16 of file catmviewer.py.

◆ plot_2d_categories()

catmlib.util.catmviewer.plot_2d_categories ( x_lim = None,
y_lim = None,
z_lim = None,
bpad = None,
rpad = None,
spad = None,
bid = None,
rid = None,
sid = None,
blabel = None,
rlabel = None,
slabel = None,
showflag = True,
savepath = None,
user_colors = [['#B844A0'],['#36797A'],["#5CA3EF"]],
legendFlag = False,
title_name = "Map file checker (Cobo, AsAd, AGET, Channel), [-1] = all" )

plot categories with 2 disimension

Parameters
x_limdraw range for X
y_limdraw range for Y
z_limdraw range for Z
bpadbeam tpc pad info (TReadoutPadArray)
rpadrecoil tpc pad info (TReadoutPadArray)
spadsilicon pad info (TReadoutPadArray)
bidbeam tpc categories list ([ [1,2,...], [3,6...] ])
ridrecoil tpc categories list ([ [1,2,...], [3,6...] ])
sidsilicon hit categories list ([ [1,2,...], [3,6...] ])
showflagdraw flag (default : True)
savepathsave path
user_colorscolor set
title_nameplot title
Returns
None

Definition at line 388 of file catmviewer.py.

◆ plot_2d_trajectory()

catmlib.util.catmviewer.plot_2d_trajectory ( x = [],
y = [],
z = [],
u = [],
v = [],
w = [],
x_lim = None,
y_lim = None,
z_lim = None,
bpad = None,
rpad = None,
spad = None,
bid = None,
rid = None,
sid = None,
anaflag = -1,
showflag = True,
savepath = None,
user_colors = ['#B844A0','#36797A','#36797A','#B844A0'] )

plot 3 disimensional trajectories

Parameters
xpoint data list : [[x1,x2,..x3],[x1,x2,..x3],[x1,x2,..x3]]
ypoint data list : [[y1,y2,..y3],[y1,y2,..y3],[y1,y2,..y3]]
zpoint data list : [[z1,z2,..z3],[z1,z2,..z3],[z1,z2,..z3]]
uline data list : [[x1,x2,..x3],[x1,x2,..x3],[x1,x2,..x3]]
vline data list : [[y1,y2,..y3],[y1,y2,..y3],[y1,y2,..y3]]
wline data list : [[z1,z2,..z3],[z1,z2,..z3],[z1,z2,..z3]]
x_limdraw range for X
y_limdraw range for Y
z_limdraw range for Z
bpadbeam tpc pad info (TReadoutPadArray)
rpadrecoil tpc pad info (TReadoutPadArray)
spadsilicon pad info (TReadoutPadArray)
bidbeam tpc hit id
ridrecoil tpc hit id
sidsilicon hit id
anaflaganalysis flag (-1:tpc, 1:si)
showflagdraw flag (default : True)
savepathsave path
user_colorscolor set
Returns
None

Definition at line 220 of file catmviewer.py.

◆ plot_3d_trajectory()

catmlib.util.catmviewer.plot_3d_trajectory ( x = [],
y = [],
z = [],
u = [],
v = [],
w = [],
x_lim = None,
y_lim = None,
z_lim = None,
bpad = None,
rpad = None,
spad = None,
bid = None,
rid = None,
sid = None,
anaflag = -1,
showflag = True,
savepath = None,
user_colors = ['#B844A0','#36797A','#36797A','#B844A0'] )

plot 3 disimensional trajectories

Parameters
xpoint data list : [[x1,x2,..x3],[x1,x2,..x3],[x1,x2,..x3]]
ypoint data list : [[y1,y2,..y3],[y1,y2,..y3],[y1,y2,..y3]]
zpoint data list : [[z1,z2,..z3],[z1,z2,..z3],[z1,z2,..z3]]
uline data list : [[x1,x2,..x3],[x1,x2,..x3],[x1,x2,..x3]]
vline data list : [[y1,y2,..y3],[y1,y2,..y3],[y1,y2,..y3]]
wline data list : [[z1,z2,..z3],[z1,z2,..z3],[z1,z2,..z3]]
x_limdraw range for X
y_limdraw range for Y
z_limdraw range for Z
bpadbeam tpc pad info (TReadoutPadArray)
rpadrecoil tpc pad info (TReadoutPadArray)
spadsilicon pad info (TReadoutPadArray)
bidbeam tpc hit id
ridrecoil tpc hit id
sidsilicon hit id
anaflaganalysis flag (-1:tpc, 1:si)
showflagdraw flag (default : True)
savepathsave path
user_colorscolor set
Returns
None

Definition at line 93 of file catmviewer.py.