Adding a script to plot channel loss as a function of time. Can also draw a secondary axis and plot an additional observable on the pad using the transparent pad trick.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[X] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Motivation and Context
Need a tool to plot channel loss as a function of time.
How Has This Been Tested?
Help menu:
./plotChanLossRate.py -h
usage: plotChanLossRate.py [-h] [-f FILEOBSDATA] [-c] [-d DELIMITER] [--debug]
[-p] [--logy1] [--logy2] [-n] [-t TOTALCHAN]
[-s STARTDATE] [--startDateFormat STARTDATEFORMAT]
[-e ENDDATE] [--endDateFormat ENDDATEFORMAT]
fileChanLoss
Makes a time series plot
positional arguments:
fileChanLoss physical filename specifying channel loss data
optional arguments:
-h, --help show this help message and exit
-f FILEOBSDATA, --fileObsData FILEOBSDATA
If provided plots the data contained here on a
secondary y-axis on top of the channel loss data.
Format should be a delimited file (matching
'delimiter'), first line should be a column header.
Subsequent lines are delimited datetime then
observable data. Datetime is expected to be in format
'YYYY.MM.DD hh:mm:ss'.
-c, --cummulative If provided a cummulative channel loss plot is made
instead of an instantaneous loss plots
-d DELIMITER, --delimiter DELIMITER
delimiter in fileChanLoss file
--debug print additional debugging info
-p, --percentage provide output data as a percentage of the total
number of channels in a detector
--logy1 primary y-axis is logarithmic
--logy2 secondary y-axis is logarithmic
-n, --noLeg Do not draw TLegend
-t TOTALCHAN, --totalChan TOTALCHAN
Specify the total number of channels in a detector
Datetime and Datetime Formatting:
Parameters specfiying the datetime format in fileChanLoss; if fileObsData
is *not* provided this also specifies the starting and ending dates
-s STARTDATE, --startDate STARTDATE
starting date given in format specified by
'startDateFormat'
--startDateFormat STARTDATEFORMAT
specifiy starting datetime format, use characters
'Y','M','D','m','h','s' to define format, e.g.
'2018.11.05.23.59' is in format 'YYYY.MM.HH.DD.hh.mm'
while '18.25.04 12:13' is 'YY.MM.DD hh:mm'
-e ENDDATE, --endDate ENDDATE
ending date given in format specified by
'endDateFormat'
--endDateFormat ENDDATEFORMAT
specifiy ending datetime format, use characters
'Y','M','D','m','h','s' to define format, e.g.
'2018.11.05.23.59' is in format 'YYYY.MM.HH.DD.hh.mm'
while '18.25.04 12:13' is 'YY.MM.DD hh:mm'
Description
Adding a script to plot channel loss as a function of time. Can also draw a secondary axis and plot an additional observable on the pad using the transparent pad trick.
Types of changes
Motivation and Context
Need a tool to plot channel loss as a function of time.
How Has This Been Tested?
Help menu:
Example usage:
Here
CMSPeakInstLumi_2017to2018.txt
is a csv file with datetime inYYYY.MM.DD hh:mm:ss
format and looks like:Which was from CMS fill summary and I used Excel to reformat the date time.
Here
ChanLoss_AllDet_20181105.txt
is a csv file which gives a chamber name and a path to channel loss data:And
/some/path/ChanLoss_GEMINIm27L1_20181105.txt
is a csv file and looks like:Notice datetime is given in scandate (
YYYY.MM.DD.hh.mm
). Notice you can use the options menu above to change the datetime formatting here.Screenshots (if appropriate):
Checklist: