How to use PyCORN

PyCORN may be used either via the pycorn-bin.py-script or imported as a module in your scripts (see USAGE_pycorn_module.txt).

pycorn-bin.py:
--------------
The default installation places pycorn-bin.py in the python/scripts-folder and therefor ready-to-use on most platforms. This script re-implements most of the features of the original pycorn.py-script. Usage is very similar, as only a few paramters have changed. 


usage: pycorn-bin.py [-h] [-c] [-n] [-i #] [-r #] [-t] [-e] [-p]
                     [--no_fractions] [--xmin #] [--xmax #] [--par1 PAR1]
                     [--par2 PAR2]
                     [-f {svg,svgz,tif,tiff,jpg,jpeg,png,ps,eps,raw,rgba,pdf,pgf
}]
                     [-d DPI] [-u] [--version]
                     <file>.res [<file>.res ...]

Extract data from UNICORN .res files to .csv/.txt and plot them (matplotlib
required)

positional arguments:
  <file>.res            Input .res file(s)

optional arguments:
  -h, --help            show this help message and exit
  -c, --check           Perform simple check if file is supported
  -n, --info            Display entries in header
  -i #, --inject #      Set injection number # as zero retention, use -t to
                        find injection points
  -r #, --reduce #      Write/Plot only every n sample
  -t, --points          Display injection points
  -u, --user            Show stored user name
  --version             show program's version number and exit

Extracting:
  Options for writing csv/txt files

  -e {csv,xlsx}, --extract {csv,xlsx}
                        Write data to csv or xlsx file for supported data
                        blocks

Plotting:
  Options for plotting

  -p, --plot            Plot curves
  --no_fractions        Disable plotting of fractions
  --xmin #              Lower bound on the x-axis
  --xmax #              Upper bound on the x-axis
  --par1 PAR1           Data for 2nd y-axis (Default=Cond)
  --par2 PAR2           Data for 3rd y-axis (Default=None)
  -f {svg,svgz,tif,tiff,jpg,jpeg,png,ps,eps,raw,rgba,pdf,pgf}, --format {svg,svg
z,tif,tiff,jpg,jpeg,png,ps,eps,raw,rgba,pdf,pgf}
                        File format of plot files (default: pdf)
  -d DPI, --dpi DPI     DPI (dots per inch) for raster images (png, jpg,
                        etc.). Default is 300.

Notes:
By default pycorn-bin.py will plot from first to last fraction, as that is usually the interesting part. If no fractions are present in the run then from beginning to end. To override this behaviour you can use the (both) optional --xmin/--xmax switches to specify beginning and end of the plot.
                        
Examples:
Show user who ran method:
pycorn-bin.py -u input.res

Show injection points:
pycorn-bin.py -t input.res

Extract data to csv files:
pycorn-bin.py -e csv input.res


Extract data to xlsx-file:
pycorn-bin.py -e xlsx input.res

Plot all data:
pycorn-bin.py -p input.res

Extract/plot data and adjust retention volume to injection point 1 (counting starts at 0!):
pycorn-bin.py -p -e -i 1 input.res

Plot every third value:
pycorn-bin.py -p -r 3 input.res

Plot from 100 to 200ml:
pycorn-bin.py -p --xmin 100 --xmax 200 input.res