ArraySquareCell¶
-
class
ArraySquareCell(ncel_x=1, ncel_y=1, size_cm=1.0)[source]¶ Bases:
objectunit : cm, cm^2
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_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)[source]¶ Add one on pixel associated to position
Parameters: apos (numpy array (n,2)) – array plan position of photon
-
empty_like(p_asc)[source]¶ Initiation of current with parameter of ArraySquareCell p_asc
Parameters: p_asc (ArraySquareCell) – array model
-
idx2pos(array_idx, pos='CTR')[source]¶ return array position
Parameters: - array_idx (int) – array index
- pos (string) – pos = {Center: CTR, left bottom :LB, right up :RU}
-
intersection(o_asc, vec_trans)[source]¶ 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
-
pos_center_cells()[source]¶ Return 2 array x and y with center cells
Returns: 2 array x and y with center cells Return type: numpy array
-
random_pos(nb_pos)[source]¶ random position in all array
Parameters: nb_pos (int) – number position to random
-
random_pos_rect(nb_pos, rec)[source]¶ random position in rectangle given by parameter return : nb_pos random position in rec
-
set_origin(p_pos_ori: <built-in function array>)[source]¶ vector PO where P=pos_array_lb and O: origin
-