From d10cf85223482d708b822e03aa72704c548cd32e Mon Sep 17 00:00:00 2001 From: aeoranday Date: Tue, 27 Feb 2024 17:46:11 +0100 Subject: [PATCH] Added more details on Python trgtools module. --- docs/py-trgtools.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/py-trgtools.md b/docs/py-trgtools.md index 46148fa..6730431 100644 --- a/docs/py-trgtools.md +++ b/docs/py-trgtools.md @@ -50,12 +50,15 @@ tc_data.ta_data ta0_contents = ta_data.tp_data[0] tc0_contents = tc_data.ta_data[0] ``` -Data accessing follows a very similar procedure between the different readers. The TAReader and TCReader also contain the secondary information about the TPs and TAs that formed the TAs and TCs, respectively. For the `np.ndarray` objects, one can also specify the member data they want to access. For example +Data accessing follows a very similar procedure between the different readers. The TAReader and TCReader also contain the secondary information about the TPs and TAs that formed the TAs and TCs, respectively. For the `np.ndarray` objects, one can also specify the member data they want to access. For example, ```python ta_data.ta_data['time_start'] # Returns a np.ndarray of the time_starts for all read TAs ``` +The available data members for each reader can be used (and shown) with `tp_data.tp_dt`, `ta_data.ta_dt` and `ta_data.tp_dt`, and `tc_data.tc_dt` and `tc_data.ta_dt`. -Look at the contents of `*_dump.py` for more detailed examples of their usage +Look at the contents of `*_dump.py` for more detailed examples of data member usage. + +While using interactive Python, one can do `help(tp_data)` and `help(tp_data.read_fragment)` for documentation on their usage (and similarly for the other readers and plotters). # Plotting There is also a submodule `trgtools.plot` that features a class `PDFPlotter`. This class contains common plotting that was repeated between the `*_dump.py`. Loading this class requires `matplotlib` to be installed, but simply doing `import trgtools` does not have this requirement. @@ -75,3 +78,6 @@ pdf_plotter.plot_histogram(tp_data['adc_peak'], plot_style_dict) ``` By design, the `plot_style_dict` requires the keys `title`, `xlabel`, and `ylabel` at a minimum. More options are available to further change the style of the plot, and examples of this are available in the `*_dump.py`. + +### Development +The common plots available in `PDFPlotter` is rather limited right now. At this moment, these plots are sufficient, but more common plotting functions can be added.