Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

Repository files navigation

psct_event_visualizer.py

You can use the psct_event_visualizer.py to plot images/animations of a r0 or r1 file. Right now some hardcoded legend/labels assume r0.

the script has some flags. It requires however at minimum the file (-file) one or the run (-r) one.

usage: psct_event_visualizer.py [-h] [-file FILE] [-r RUN] [-sr SUBRUN] [-ev EVENT] [-type TYPE] [-title TITLE] [-f FRAME] [-dt DISP_TYPE] [-display] [-proj]
                                [-save SAVE]

options:
  -h, --help            show this help message and exit
  -file FILE, --file FILE
                        r0_file
  -r RUN, --run RUN     run to see. Overridden by a -file input
  -sr SUBRUN, --subrun SUBRUN
                        subrun to see. Overidden by a -file input
  -ev EVENT, --event EVENT
                        Event to see
  -type TYPE, --type TYPE
                        Possible types: peak, time, ani, img, charge, std. The default is charge
  -title TITLE, --title TITLE
                        Title of image. Default is 'Run <run number here> Event <Event number here>'
  -f FRAME, --frame FRAME
                        Frame of event (timestamp), if -type is img
  -dt DISP_TYPE, --disp_type DISP_TYPE
                        Type of plot: camera, sector (for sector, it defaults to showing the sector of the first FPM in the list of FPMs)
  -display, --disp      Whether to show image or animation
  -proj, --projected    Whether to show it in camera perspective (default is telescope perspective)
  -save SAVE, --save SAVE
                        Path to save

-file: put the path of a r0, r1 file to fetch the event to be plotted. It will overwrite the -r and -sr flags

-r: put the number of a run. The config.txt file should have a default file name where run goes at the {0} spot, over formatting.

-sr: put the number of a subrun. The config.txt file should have a default file name where subrun goes at the {1} spot, over formatting. Default is 0

-ev: event to plot. If ev > number of events, it will do mod with the number of events, so it will plot something. Default is 0

-type: type of image to plot. Use "ani" for animation (will automatically correct the format to .gif if the save file is not consistent). Use "img" for a frame at t = f of event ev. Use "time" for time-of-peak plot. Use "peak" for peak-amplitude plot. Do not use the quotation marks

-title: Title of your image. It will by default do "Run (Run number from -r) Event (event number from ev)". It will do just "Event ##" for when using -file

-f: frame to plot. Only relevant for -type image. It will plot a frame at t = f of the event ev. It will do a mod with the number of samples so it will plot something even if it is out of range. Default is 0.

-dt: Type of display. Currently can use "sector" or "camera". Don't use quotation marks

-display: To show image/animation (CURRENTLY NOT WORKING)

-save: a path to save image/animation. Currently, just trying to plot and not save doesn't display anything so you should have some, at the very least, place to save so that you can see what you're plotting.

config.yaml

Should exist in the same folder as the psct_event_visualizer.py

Each element is explained in the file in the comments of each line

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages