Skip to main content

Utilities for iorodeo's open colorimeter

Project description

Utilities for IO Rodeo's Open Colorimeter

Installing

Install using pip

$ pip install open-colorimeter-utils

Installing from source

This package uses the poetry dependency manager. The installation instructions for poetry can be found here

Once poetry is installed the open-colorimeter-utils package can be installed using

$ poetry install

Additional documentation on using poetry can be found here

Using the Open Colorimeter calibration tool

The Open Colorimeter calibration tool "oc-cal" is a command line program which can fit calibratin data and generate the calibration.json used by the Open Colorimeter.

Usage: oc-cal [OPTIONS] [INPUT_FILES]...

  Generates an Open Colorimeter calibration .json file from the .toml input
  files

  .toml file format 
  -----------------
  name = "TestName"          # Name of the test
  led = 630                  # Led wavelength
  units = "ppm"              # Measurement units
  fit_type = "polynomial"    # Fit type, polynomial or linear
  fit_order = 2              # Order of the fit
  values = [                 # Array of measurements
      [c0, c1, .... , cn],   # Measurements in units
      [a1, a1, .... , an]    # Corresponding absorbances
      ]

Options:
  -o, --output-file FILENAME  output file
  --help                      Show this message and exit.

The input calibration data is provided in the from of one of more .toml files with the following format

name = "Nitrite API"
led = 520 
units = "ppm" 
fit_type = "polynomial"
fit_order = 2
values = [ 
    [0.00, 0.40, 0.80, 1.20, 1.60, 2.00], # concentration
    [0.00, 0.30, 0.59, 0.88, 1.14, 1.39], # absorbance
    ]

In order to generate the calibrations simple run

$ oc-cal nitrite.toml

The oc-cal program will generate the calibrations.json file used by the open colorimeter. An alternative name can be given to this file using the -o of --output options.

An example of the calibrations.json file generated using the data from the .toml file above is shown below

{
  "Nitrite API": {
    "units": "ppm",
    "led": "520",
    "fit_type": "polynomial",
    "fit_coef": [
      0.11543984594053638,
      1.2747960322708907,
      0.0
    ],
    "range": {
      "min": 0.0,
      "max": 1.39
    }
  }
}

In addtion the oc-cal program will fit the data and plots the results as shown below.

example plot

An example of calibrations.json file made using multiple .toml input files is shown below

{
  "Ammonia API": {
    "units": "ppm",
    "led": "630",
    "fit_type": "polynomial",
    "fit_coef": [
      1.0128521350438369,
      1.890930808804952,
      0.0
    ],
    "range": {
      "min": 0.0,
      "max": 2.0
    }
  },
  "Nitrate API": {
    "units": "ppm",
    "led": "520",
    "fit_type": "polynomial",
    "fit_coef": [
      0.32039213453320625,
      34.032597696304,
      0.0
    ],
    "range": {
      "min": 0.0,
      "max": 1.47
    }
  },
  "Nitrite API": {
    "units": "ppm",
    "led": "520",
    "fit_type": "polynomial",
    "fit_coef": [
      0.13111937060865314,
      1.2591439203550079,
      0.0
    ],
    "range": {
      "min": 0.0,
      "max": 1.4
    }
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_colorimeter_utils-0.1.0.post2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

open_colorimeter_utils-0.1.0.post2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file open_colorimeter_utils-0.1.0.post2.tar.gz.

File metadata

  • Download URL: open_colorimeter_utils-0.1.0.post2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.5 Linux/4.15.0-196-generic

File hashes

Hashes for open_colorimeter_utils-0.1.0.post2.tar.gz
Algorithm Hash digest
SHA256 695ee6657299aa934828f26183a5a9c8d767e2d3f21ec4c676f181a3f4878b40
MD5 9a6d3c6ccce15db0787d97b572a6d8d2
BLAKE2b-256 4a80ab0d25f850d09d667091fa1fc69eda735c0f0540e7ca1aea03ec2201612a

See more details on using hashes here.

File details

Details for the file open_colorimeter_utils-0.1.0.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for open_colorimeter_utils-0.1.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e782fb159f649d0520c4e1e3be883b71b86e3dd67e544e880a555e6ef8099e8
MD5 e0305d3872368b53ff481a84b1521c17
BLAKE2b-256 8fd1961f1a634c99708a9627dec4f4e401b810a53ede77ccd36082474a9ad636

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page