Submodule ringplot

This module manage the creation of plot.

LordOfRings.ringplot.data_show(filename, ax=None)

data_show show the sparse matrix contained in the file txt.

Parameters
filenamestr

The name of the txt file (including the extension).

axmatplotlib axes (default None)

The axes in wich plot the sparse matrix, if None define a new ax.

Returns
matplotlib axes

The axes in wich plot the sparse matrix, if None returne a new ax.

LordOfRings.ringplot.ptolemy_contourf(idx_event, dict_events, maxhits=64, t=1, annotate=False, thr=0.2, GPU=False)

ptolemy_contourf makes 4 contourf plot (one for each triplet) having as z the value p associated to the Ptolemy theorem : p = AB * BC + AD * CD - AC * BD. Triplets values are choosen using the function ‘LordOfRings.core.init_triplet’. The function plots also the hits of the sparse matrix highlighting the triplet’s points.

Parameters
idx_eventint

The index of the event in the list that we want to plot.

dict_eventsdictionary

Dictionary whose keys are the name of .txt files and whose values are the x, y coordinates of the relative event in a list. This format is the output of the function LordOfRing.ringfit.load_data.

maxhitsint

The maximum number of points after the second pruning. If a circle has more than maxhits points after the first pruning remove them randomly until they reach maxhits.

tfloat

Treshold value for the selection of the triplets, it defines the minimum reciprocal distance of the three points in the same triplet.

annotateboolean

If True write on each point of triplets the letter that correspond to the sequential order of the 3 points forming the triplet itself.

thrfloat

Threshold on the p value: if a hit has p < thr it is highlighted in the plot.

GPUboolean

If you want to extract triplet from GPU set this value on True, else choose False.

Returns
LordOfRings.ringplot.show_circle_fit(list_events, rr, xc, yc, ncircline)

show_circle_fit makes a plot of sparse matrices contained in list_events. In each plot is also shown the fit results corresponding to that event. The subplots layout is optimized by the function.

Parameters
list_eventslist of str

List of .txt files that contain the sparse matrix of each events. These files are contained in the folder ./data/.

rr2d numpy-array [float]

The radii predicted by the multiring alghoritm in the format described in the return of the function ‘LordOfRings.ringfit.multi_ring_fit’.

xc2d numpy-array [float]

The x coordinates of the center predicted by the multiring alghoritm in the format described in the return of the function ‘LordOfRings.ringfit.multi_ring_fit’.

yc2d numpy-array [float]

The y coordinates of the center predicted by the multiring alghoritm in the format described in the return of the function ‘LordOfRings.ringfit.multi_ring_fit’.

ncirclelineint

It correspondes to the number of sparse matrix in each row. This number has to be lower or equal to the number of events.

Returns