ctools  2.0.0
 All Classes Namespaces Files Functions Variables Macros Pages
cscripts.csfootprint.csfootprint Class Reference
Inheritance diagram for cscripts.csfootprint.csfootprint:

Public Member Functions

def __init__
 
def __getstate__
 
def __setstate__
 
def process
 
def save
 

Private Member Functions

def _get_parameters
 
def _load_statistics
 
def _format_time
 
def _format_footprint
 
def _get_global_information
 
def _global_statistics
 
def _daily_statistics
 
def _tools_statistics
 
def _create_figure
 
def _plot_daily
 
def _plot_pie
 

Private Attributes

 _statistics
 

Detailed Description

Carbon footprint report script

Definition at line 32 of file csfootprint.py.

Constructor & Destructor Documentation

def cscripts.csfootprint.csfootprint.__init__ (   self,
  argv 
)
Constructor

Parameters
----------
argv : list of str
    List of IRAF command line parameter strings of the form
    ``parameter=3``.

Definition at line 38 of file csfootprint.py.

Member Function Documentation

def cscripts.csfootprint.csfootprint.__getstate__ (   self)
Extend ctools.cscript __getstate__ method

Returns
-------
state : dict
    Pickled instance

Definition at line 58 of file csfootprint.py.

References cscripts.csfootprint.csfootprint._statistics.

def cscripts.csfootprint.csfootprint.__setstate__ (   self,
  state 
)
Extend ctools.cscript __setstate__ method

Parameters
----------
state : dict
    Pickled instance

Definition at line 74 of file csfootprint.py.

References cscripts.csfootprint.csfootprint._statistics.

def cscripts.csfootprint.csfootprint._create_figure (   self,
  outfile,
  statistics 
)
private
Create figure

Parameters
----------
outfile : str
    Figure file name
statistics : dict
    Statistics dictionary

Definition at line 571 of file csfootprint.py.

References cscripts.csfootprint.csfootprint._get_global_information(), cscripts.csfootprint.csfootprint._plot_daily(), and cscripts.csfootprint.csfootprint._plot_pie().

Referenced by cscripts.csfootprint.csfootprint.save().

def cscripts.csfootprint.csfootprint._daily_statistics (   self,
  statistics 
)
private
Log daily statistics

Parameters
----------
statistics : dict
    Statistics dictionary

Definition at line 431 of file csfootprint.py.

References cscripts.csfootprint.csfootprint._format_footprint(), and cscripts.csfootprint.csfootprint._format_time().

Referenced by cscripts.csfootprint.csfootprint.process().

def cscripts.csfootprint.csfootprint._format_footprint (   self,
  gCO2e,
  latex = False 
)
private
Format carbon footprint

Parameters
----------
gCO2e : float
    Carbon footprint in gCO2e
latex : bool, optional
    Use LaTeX formatting

Definition at line 287 of file csfootprint.py.

Referenced by cscripts.csfootprint.csfootprint._daily_statistics(), cscripts.csfootprint.csfootprint._get_global_information(), and cscripts.csfootprint.csfootprint._tools_statistics().

def cscripts.csfootprint.csfootprint._format_time (   self,
  seconds 
)
private
Format time

Parameters
----------
seconds : float
    Time in seconds

Definition at line 266 of file csfootprint.py.

Referenced by cscripts.csfootprint.csfootprint._daily_statistics(), cscripts.csfootprint.csfootprint._get_global_information(), and cscripts.csfootprint.csfootprint._tools_statistics().

def cscripts.csfootprint.csfootprint._get_global_information (   self,
  statistics,
  latex = False 
)
private
Get global information from statistics

Parameters
----------
statistics : dict
    Statistics dictionary
latex : bool, optional
    Use LaTeX formatting

Definition at line 316 of file csfootprint.py.

References cscripts.csfootprint.csfootprint._format_footprint(), and cscripts.csfootprint.csfootprint._format_time().

Referenced by cscripts.csfootprint.csfootprint._create_figure(), and cscripts.csfootprint.csfootprint._global_statistics().

def cscripts.csfootprint.csfootprint._global_statistics (   self,
  statistics 
)
private
Log global statistics

Parameters
----------
statistics : dict
    Statistics dictionary

Definition at line 395 of file csfootprint.py.

References cscripts.csfootprint.csfootprint._get_global_information().

Referenced by cscripts.csfootprint.csfootprint.process().

def cscripts.csfootprint.csfootprint._load_statistics (   self)
private
Load statistics

Definition at line 115 of file csfootprint.py.

Referenced by cscripts.csfootprint.csfootprint.process().

def cscripts.csfootprint.csfootprint._plot_daily (   self,
  ax,
  statistics,
  quantity = 'gCO2e',
  title = 'Footprint',
  ylabel = r'g CO$_2$e',
  yscale = 1.0 
)
private
Plot daily figure

Parameters
----------
ax : pyplot
    Plotting frame
statistics : dict
    Statistics dictionary
quantity : str, optional
    Quantity to plot
title : str, optional
    Plot title
ylabel : str, optional
    Y axis label
yscale : float, optional
    Y axis scale

Definition at line 687 of file csfootprint.py.

Referenced by cscripts.csfootprint.csfootprint._create_figure().

def cscripts.csfootprint.csfootprint._plot_pie (   self,
  ax,
  statistics,
  quantity = 'gCO2e',
  title = 'Footprint',
  num = 5,
  args = None 
)
private
Plot pie figure

Parameters
----------
ax : pyplot
    Plotting frame
statistics : dict
    Statistics dictionary
quantity : str, optional
    Quantity to plot
title : str, optional
    Plot title
num : integer, optional
    Number of pies displayed explicitly
arg : list or str, optional
    List of pie method keyword arguments

Definition at line 722 of file csfootprint.py.

Referenced by cscripts.csfootprint.csfootprint._create_figure().

def cscripts.csfootprint.csfootprint._tools_statistics (   self,
  statistics 
)
private
Log tools statistics

Parameters
----------
statistics : dict
    Statistics dictionary

Definition at line 475 of file csfootprint.py.

References cscripts.csfootprint.csfootprint._format_footprint(), and cscripts.csfootprint.csfootprint._format_time().

Referenced by cscripts.csfootprint.csfootprint.process().

def cscripts.csfootprint.csfootprint.save (   self)

Member Data Documentation


The documentation for this class was generated from the following file: