|
1 | | -###Term Project Readme |
2 | | -Basic project construct: use newfound python knowledge combined with pandas and matplotlib modules to create a simple set of data visualization tools for environmental chemistry and monitoring data. |
3 | | - |
4 | | -**Desired Key Elements** |
5 | | -* Read in environmental data from format delivered |
6 | | -* Visualize detected results on a single image |
7 | | -* Apply estimate flag to qualified results |
8 | | -* Add axis and constituent labeling as appropriate |
9 | | -* Plot multiple sets of data on shared axis graphs or a single image for monitoring/environmental data |
10 | | - |
11 | | -####Part 1: Read in data |
12 | | -Environmental chemistry data is delivered in csv or xlsx format. After validation it is almost always delivered as an xlsx file. Use pandas module along with other techniques to create a data set for plotting. |
13 | | - |
14 | | -Several points to work out: |
15 | | -* multiple sample names per sheet -- need unique list of samples |
16 | | -* create list (or tuple?) of parameters analyzed in each sample |
17 | | -* take advantage of index feature to pull out flags |
18 | | -* make dict of plotting parameters to pass to chart |
| 1 | +##Term Project Readme |
| 2 | +Basic project construct: use newfound python knowledge combined with pandas and matplotlib modules to create a simple data visualization tool for environmental chemistry data. |
| 3 | + |
| 4 | +###plotprep Class Attributes |
| 5 | +All attributes at this time are mutable to allow for tinkering. |
| 6 | + |
| 7 | +_raw_data_ |
| 8 | +Raw import of the data used in class initialization |
| 9 | + |
| 10 | +_selected_data_ |
| 11 | +Columns selected from raw_data that are processed as part of the plotprep. Original raw_data is left untouched in the event it needs to be examined later. |
| 12 | + |
| 13 | +_samples_ |
| 14 | +A list of unique sample identifiers pulled from selected_data. |
| 15 | + |
| 16 | +_qc_samples_ |
| 17 | +A llist of unique qc sample identifiers pulled from selected_data |
| 18 | + |
| 19 | +_sampleData_ |
| 20 | +Analytical results selected based on the sample id handed to the selectSample method. |
| 21 | + |
| 22 | +_plotData_ |
| 23 | +Analytical results for the sample identified using selectSample and the method provided to selectForPlot. Results do not include spiked sample recoveries. |
| 24 | + |
| 25 | +_plot_dict_ |
| 26 | +Plotting dictionary created by makePlotobj method, requires that both plotData already have been selected and assigned as an attribute of the class instance |
| 27 | + |
| 28 | + |
| 29 | +####Class Methods |
| 30 | +_showOptions_ |
| 31 | +Automatically called by other methods to display a unique list of options for the user such as sample identifiers or methods used on a specific sample. |
| 32 | + |
| 33 | +_selectSample_ |
| 34 | +Returns sampleData attribute to the class instance. sampleData are the columns of selected_data reduced down to only the selected sample. |
| 35 | + |
| 36 | +Syntax: selectSample(sample_id) |
| 37 | + |
| 38 | +Note: type(sample_id) must match what is in the raw_data. |
| 39 | + |
| 40 | +_selectForPlot_ |
| 41 | +Returns plotData attribute to the class instance. plotData is the set of analytical results from the selected_data reduced down by sample in _selectSample_ and by the method entered. |
| 42 | + |
| 43 | +Syntax: selectForPlot(analytical_method) |
| 44 | + |
| 45 | +_makePlotobj_ |
| 46 | +Returns plotting dictionary attribute to the class instance. Method takes no arguments, but requires that selectSample and selectForPlot have already been run to be fully populated |
| 47 | + |
| 48 | +###Createplot.py |
| 49 | +Script initializes plotprep object and creates plotting dictionary for sample-method pair passed in as test_samp dictonary using _makeSampdict_. |
| 50 | + |
| 51 | +_plotSampdict(**kwargs)_ |
| 52 | +Takes plotting dictionary created in the plotprep instance of _makeSampdict_ and renders a bar chart of results with labeling and laboratory flags applied to the top of each column. Returns figure and subplot objects for further tinkering. |
0 commit comments