Using the ACT Library to Plot VAPS Debugging Data

Written by David H Hagan Last Updated: March 2, 2014

1. Import the library


In [1]:
import ACT

# Set the directory where VAPS data is located
runDir = "C:/Users/David/Desktop/VAPS Data/"

2. Create instance of VAPS_Debug


In [2]:
vapsData = ACT.VAPS_Debug(runDir)

2.1 You can see exactly what your data contains by using the following command:


In [3]:
vapsData.data.info()


<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 56051 entries, 2013-04-28 14:03:05 to 2013-05-01 19:53:55
Freq: 5S
Data columns (total 22 columns):
6PV                          2438 non-null float64
6PV/VL                       2438 non-null float64
Bank 0 Relay States          2438 non-null float64
Bank 1 Relay States          2438 non-null float64
CELL                         2438 non-null float64
Cell-6PV/VL                  1911 non-null float64
Cell-6PV/VL-GC               527 non-null float64
Heater                       2438 non-null float64
Hum-Cell/HT                  2438 non-null float64
Humidifier                   2438 non-null float64
Humidity                     2437 non-null float64
Qpurge                       2437 non-null float64
TC10_GC_AMS_transferline1    2436 non-null float64
TC11_GC_AMS_transferline2    2436 non-null float64
TC6_pretrap                  2437 non-null float64
TC7_trapin                   2437 non-null float64
TC8_oven                     1397 non-null float64
TC8_trapout                  1040 non-null float64
TC9_cell_joint               1396 non-null float64
TC9_oven                     1040 non-null float64
TempHum                      2437 non-null float64
dPsmp                        2437 non-null float64
dtypes: float64(22)

2.2 If you only want a portion of the data to be plotted, you can select by date or datetime using pandas date-splicing notation

If you want to grab all data from a date: vapsData.data = vapsData.data['4-28-2013'] If you want to grab all data between two dates: vapsData.data = vapsData.data['4-28-2013':'4-30-2013'] If you want to grab all data between two datetimes: vapsData.data = vapsData.data['4-28-2013 10:00':'4-28-2013 16:00']

3. Plot the VAPS Data

3.1 Plotting the Thermocouple Data

General Instuctions: 1. Get data as shown above 2. Select specific times you want to plot if neeeded 3. Define the columns you want to plot define the label as well as color - The color options can be found by googling matplotlib colors - Colors can also be defined as hex codes as shown below Other fun things: 1. To change the title, xlabel, or ylabel: vapsData.title = "Whatever title you want" vapsData.xlabel = "" vapsData.ylabel = ""

In [4]:
# We are only going to use a certain datetime range 
vapsData.data = vapsData.data['4-29-2013 10:00':'4-29-2013 12:00']
vaps_tc = {
    '6PV': {
            'label':'6 Port Valve',
            'color':'b',
            },
    '6PV/VL':{
            'label':'6 Port Valve to Valveless Injector',
            'color': 'g',
            },
    'CELL':{
            'label':'Cell',
            'color':'r',
            },
    'Cell-6PV/VL':{
            'label':'Cell-6PV/VL',
            'color':'c',
            },
    'Cell-6PV/VL-GC':{
            'label':'Cell-GC',
            'color':'m',
            },
    'Heater':{
            'label':'Heater',
            'color':'y',
            },
    'Hum-Cell/HT':{
            'label':'Heater',
            'color':'k',
            },
    'Humidifier':{
            'label':'Humidifier',
            'color':'#FF9966'
            },
    'TC10_GC_AMS_transferline1':{
            'label':'AMS Transfer Line',
            'color':'#FF99FF'
            },
    'TC11_GC_AMS_transferline2':{
            'label':'AMS Transfer Line 2',
            'color':'#CC00FF'
            },
    'TC9_cell_joint':{
            'label':'Cell Joint',
            'color':'#CC6600'
            },
    }

f, a = vapsData.plot_trap(args=vaps_tc)


Plotting the Thermocouple data around the trap

Notes: 1. If you don't see something on the chart, it may just not exist for that specific time range (especially if the headers were changed)

In [5]:
# Try changing the title
vapsData.title = "VAPS TC Data around the Trap"

trap = {
    'TC6_pretrap': {
            'color': 'g',
            'label':'Pretrap'
            },
    'TC7_trapin':{
            'color':'b',
            'label':'Trapin'
            },
    'TC8_trapout':{
            'color':'r',
            'label':'Trapout'
            },
    }

f, a = vapsData.plot_trap(args=trap)