MaskRandom

class MaskRandom(cel_x=1, ncel_y=1, size_cm=1)[source]

Bases: common.num.array_square_cell.ArraySquareCell

Methods Summary

add_hit(apos) Add one on pixel associated to position
empty_like(p_asc) Initiation of current with parameter of ArraySquareCell p_asc
get_ij_cell_surrounded_no_0()
get_nb_cell()
get_nb_cell_x()
get_nb_cell_y()
get_shape()
get_sizecm()
get_surface() return : [cm]^2
idx2pos(array_idx[, pos]) return array position
idx2pos_inf(array_idx)
idx2pos_sup(array_idx)
intersection(o_asc, vec_trans) Intersection entre le tableau en attribut et un tableau passé en paramètre à translater
intersection_rect(p_r1, p_r2)
plot([p_mes])
plot_ijdet([p_mes])
pos2idx(pos_cm[, round_func])
pos2idx_inf(pos_cm)
pos2idx_rect(p_rect[, p_boundary]) p_rect is one rectangle
pos2idx_sup(pos_cm)
pos_center_cells() Return 2 array x and y with center cells
pos_corner_lb() return : [cm] position corner ‘l’eft ‘b’ottom
pos_corner_ru() return : [cm] position corner ‘r’ight ‘u’pper
pos_rect_array()
pos_rect_cell(idx) for one cell
pos_rect_cells(aidx) for array index cells
random_mask(p_percent_empty)
random_pos(nb_pos) random position in all array
random_pos_rect(nb_pos, rec) random position in rectangle given by parameter
random_value(pmin, pmax)
sample_up(pfact) pfact is int
set_array(p_ar)
set_origin(p_pos_ori) vector PO where P=pos_array_lb and O: origin
set_origin_center()
set_pos_corner_lb(p_pos_ori) vector OP where P=pos_array_lb and O: origin
set_val(p_val)
surf_intersection_rect(p_r1, p_r2)
value(idx)
value_array(aidx) aidx (n, 2)
value_at_pos(pos)
value_at_pos_check(pos)

Methods Documentation

add_hit(apos)

Add one on pixel associated to position

Parameters:apos (numpy array (n,2)) – array plan position of photon
empty_like(p_asc)

Initiation of current with parameter of ArraySquareCell p_asc

Parameters:p_asc (ArraySquareCell) – array model
get_ij_cell_surrounded_no_0()
get_nb_cell()
get_nb_cell_x()
get_nb_cell_y()
get_shape()
get_sizecm()
get_surface()

return : [cm]^2

idx2pos(array_idx, pos='CTR')

return array position

Parameters:
  • array_idx (int) – array index
  • pos (string) – pos = {Center: CTR, left bottom :LB, right up :RU}
idx2pos_inf(array_idx)
idx2pos_sup(array_idx)
intersection(o_asc, vec_trans)

Intersection entre le tableau en attribut et un tableau passé en paramètre à translater return [[x_lb, y_lb], [x_ru, y_ru]] rectangle intersection, lb: left bottom, ru: right uppper

intersection_rect(p_r1, p_r2)
plot(p_mes='')
plot_ijdet(p_mes='')
pos2idx(pos_cm, round_func=None)
pos2idx_inf(pos_cm)
pos2idx_rect(p_rect, p_boundary=False)

p_rect is one rectangle

pos2idx_sup(pos_cm)
pos_center_cells()

Return 2 array x and y with center cells

Returns:2 array x and y with center cells
Return type:numpy array
pos_corner_lb()

return : [cm] position corner ‘l’eft ‘b’ottom

pos_corner_ru()

return : [cm] position corner ‘r’ight ‘u’pper

pos_rect_array()
pos_rect_cell(idx)

for one cell

pos_rect_cells(aidx)

for array index cells

random_mask(p_percent_empty)[source]
random_pos(nb_pos)

random position in all array

Parameters:nb_pos (int) – number position to random
random_pos_rect(nb_pos, rec)

random position in rectangle given by parameter return : nb_pos random position in rec

random_value(pmin, pmax)
sample_up(pfact)

pfact is int

result: repeat pfactxpfact each element

set_array(p_ar)
set_origin(p_pos_ori: <built-in function array>)

vector PO where P=pos_array_lb and O: origin

set_origin_center()
set_pos_corner_lb(p_pos_ori: <built-in function array>)

vector OP where P=pos_array_lb and O: origin

set_val(p_val)
surf_intersection_rect(p_r1, p_r2)
value(idx)
value_array(aidx: <built-in function array>)

aidx (n, 2)

value_at_pos(pos)
value_at_pos_check(pos)