cyfi


Namecyfi JSON
Version 1.1.3 PyPI version JSON
download
home_page
SummaryEstimate cyanobacteria density in small, inland water bodies using Sentinel-2 satellite imagery.
upload_time2024-01-19 23:29:15
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords cyanobacteria harmful algal blooms habs sentinel-2 satellite imagery
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            CyFi: Cyanobacteria Finder
==============================

[![PyPI](https://img.shields.io/pypi/v/cyfi.svg)](https://pypi.org/project/cyfi/)
[![tests](https://github.com/drivendataorg/cyfi/workflows/tests/badge.svg?branch=main)](https://github.com/drivendataorg/cyfi/actions?query=workflow%3Atests+branch%3Amain)
[![codecov](https://codecov.io/gh/drivendataorg/cyfi/branch/main/graph/badge.svg)](https://codecov.io/gh/drivendataorg/cyfi)

CyFi is a command line tool that uses satellite imagery and machine learning to estimate cyanobacteria levels in small, inland water bodies. The goal of CyFi is to help water quality managers better allocate resources for in situ sampling, and make more informed decisions around public health warnings for critical resources like lakes and reservoirs.

Read more at [cyfi.drivendata.org](https://cyfi.drivendata.org)

## Quickstart

### Install

Install CyFi with pip:

```
pip install cyfi
```

For detailed instructions for those installing python for the first time, see the [Installation](https://cyfi.drivendata.org/installation/) page.

### Generate batch predictions

Generate batch predictions at the command line with `cyfi predict`.

First, specify your sample points in a csv with the following columns:

* latitude
* longitude
* date

For example,

```
# sample_points.csv
latitude,longitude,date
41.424144,-73.206937,2023-06-22
36.045,-79.0919415,2023-07-01
35.884524,-78.953997,2023-08-04
```

Then run:
```
cyfi predict sample_points.csv
```

This will output a `preds.csv` that contains a column for cyanobacteria density and a column for the associated severity level based on WHO thresholds.
```
# preds.csv
sample_id,date,latitude,longitude,density_cells_per_ml,severity
7ff4b4a56965d80f6aa501cc25aa1883,2023-06-22,41.424144,-73.206937,34173.0,moderate
882b9804a3e28d8805f98432a1a9d9af,2023-07-01,36.045,-79.0919415,7701.0,low
10468e709dcb6133d19a230419efbb24,2023-08-04,35.884524,-78.953997,4053.0,low
```

To see all of the available options, run `cyfi predict --help`.

### Generate prediction for a single point

Or, generate a cyanobacteria estimate for a single point on a single date using `cyfi predict-point`.

Just specify the latitude, longitude, and date as arguments at the command line.

```
cyfi predict-point --lat 41.2 --lon -73.2 --date 2023-09-14
```

This will print out the estimated cyanobacteria density and associated severity level based on WHO thresholds.

```
2023-10-04 16:25:40.581 | SUCCESS  | cyfi.cli:predict_point:154 - Estimate generated:
date                    2023-09-14
latitude                      41.2
longitude                    -73.2
density_cells_per_ml        32,820
severity                  moderate
```

To see all of the available options, run `cyfi predict-point --help`.

### A note on severity levels

Severity levels are based on World Health Organization (WHO) cyanobacteria density thresholds.

- Low: 0 - 20,000 cells/ml
- Moderate: 20,000 - 100,000 cells/ml
- High: > 100,000 cells/ml

However users should feel free to to use their own thresholds as makes sense for their needs.

### Visualizing predictions

Launch the [CyFi Explorer](https://cyfi.drivendata.org/explorer/) to view the Sentinel-2 imagery used to generate each cyanobacteria estimate!

![Screenshot of CyFi explorer showing the predictions table along with the Sentinel-2 imagery.](https://s3.amazonaws.com/drivendata-public-assets/cyfi_explorer_screenshot.jpg)


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cyfi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "cyanobacteria,harmful algal blooms,HABs,sentinel-2,satellite imagery",
    "author": "",
    "author_email": "DrivenData <info@drivendata.org>",
    "download_url": "https://files.pythonhosted.org/packages/10/56/913c82bf783dc5fc887bead040909420ed3469e05f1e0b7d2a26883cbeed/cyfi-1.1.3.tar.gz",
    "platform": null,
    "description": "CyFi: Cyanobacteria Finder\n==============================\n\n[![PyPI](https://img.shields.io/pypi/v/cyfi.svg)](https://pypi.org/project/cyfi/)\n[![tests](https://github.com/drivendataorg/cyfi/workflows/tests/badge.svg?branch=main)](https://github.com/drivendataorg/cyfi/actions?query=workflow%3Atests+branch%3Amain)\n[![codecov](https://codecov.io/gh/drivendataorg/cyfi/branch/main/graph/badge.svg)](https://codecov.io/gh/drivendataorg/cyfi)\n\nCyFi is a command line tool that uses satellite imagery and machine learning to estimate cyanobacteria levels in small, inland water bodies. The goal of CyFi is to help water quality managers better allocate resources for in situ sampling, and make more informed decisions around public health warnings for critical resources like lakes and reservoirs.\n\nRead more at [cyfi.drivendata.org](https://cyfi.drivendata.org)\n\n## Quickstart\n\n### Install\n\nInstall CyFi with pip:\n\n```\npip install cyfi\n```\n\nFor detailed instructions for those installing python for the first time, see the [Installation](https://cyfi.drivendata.org/installation/) page.\n\n### Generate batch predictions\n\nGenerate batch predictions at the command line with `cyfi predict`.\n\nFirst, specify your sample points in a csv with the following columns:\n\n* latitude\n* longitude\n* date\n\nFor example,\n\n```\n# sample_points.csv\nlatitude,longitude,date\n41.424144,-73.206937,2023-06-22\n36.045,-79.0919415,2023-07-01\n35.884524,-78.953997,2023-08-04\n```\n\nThen run:\n```\ncyfi predict sample_points.csv\n```\n\nThis will output a `preds.csv` that contains a column for cyanobacteria density and a column for the associated severity level based on WHO thresholds.\n```\n# preds.csv\nsample_id,date,latitude,longitude,density_cells_per_ml,severity\n7ff4b4a56965d80f6aa501cc25aa1883,2023-06-22,41.424144,-73.206937,34173.0,moderate\n882b9804a3e28d8805f98432a1a9d9af,2023-07-01,36.045,-79.0919415,7701.0,low\n10468e709dcb6133d19a230419efbb24,2023-08-04,35.884524,-78.953997,4053.0,low\n```\n\nTo see all of the available options, run `cyfi predict --help`.\n\n### Generate prediction for a single point\n\nOr, generate a cyanobacteria estimate for a single point on a single date using `cyfi predict-point`.\n\nJust specify the latitude, longitude, and date as arguments at the command line.\n\n```\ncyfi predict-point --lat 41.2 --lon -73.2 --date 2023-09-14\n```\n\nThis will print out the estimated cyanobacteria density and associated severity level based on WHO thresholds.\n\n```\n2023-10-04 16:25:40.581 | SUCCESS  | cyfi.cli:predict_point:154 - Estimate generated:\ndate                    2023-09-14\nlatitude                      41.2\nlongitude                    -73.2\ndensity_cells_per_ml        32,820\nseverity                  moderate\n```\n\nTo see all of the available options, run `cyfi predict-point --help`.\n\n### A note on severity levels\n\nSeverity levels are based on World Health Organization (WHO) cyanobacteria density thresholds.\n\n- Low: 0 - 20,000 cells/ml\n- Moderate: 20,000 - 100,000 cells/ml\n- High: > 100,000 cells/ml\n\nHowever users should feel free to to use their own thresholds as makes sense for their needs.\n\n### Visualizing predictions\n\nLaunch the [CyFi Explorer](https://cyfi.drivendata.org/explorer/) to view the Sentinel-2 imagery used to generate each cyanobacteria estimate!\n\n![Screenshot of CyFi explorer showing the predictions table along with the Sentinel-2 imagery.](https://s3.amazonaws.com/drivendata-public-assets/cyfi_explorer_screenshot.jpg)\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Estimate cyanobacteria density in small, inland water bodies using Sentinel-2 satellite imagery.",
    "version": "1.1.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/drivendataorg/cyfi/issues",
        "Changelog": "https://cyfi.drivendata.org/changelog/",
        "Documentation": "https://cyfi.drivendata.org/",
        "Repository": "https://github.com/drivendataorg/cyfi"
    },
    "split_keywords": [
        "cyanobacteria",
        "harmful algal blooms",
        "habs",
        "sentinel-2",
        "satellite imagery"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "010554f8879ea249b18ef0d1e7dcebec6ac45e7b52e78781428576978dfa8db0",
                "md5": "1c2324c7c165185d157a33e6fe463f11",
                "sha256": "c52d0730badee22c40bfc64ad0c6307c2ed34c23d4c26e3dfab536d98bc53048"
            },
            "downloads": -1,
            "filename": "cyfi-1.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1c2324c7c165185d157a33e6fe463f11",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 948278,
            "upload_time": "2024-01-19T23:29:13",
            "upload_time_iso_8601": "2024-01-19T23:29:13.049685Z",
            "url": "https://files.pythonhosted.org/packages/01/05/54f8879ea249b18ef0d1e7dcebec6ac45e7b52e78781428576978dfa8db0/cyfi-1.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1056913c82bf783dc5fc887bead040909420ed3469e05f1e0b7d2a26883cbeed",
                "md5": "106e2ae9fefab33e388ff94599bffe57",
                "sha256": "1fce34035883c8fbcaa12b0e76b5531f97a3815ec8836eadc6c977ca807ca552"
            },
            "downloads": -1,
            "filename": "cyfi-1.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "106e2ae9fefab33e388ff94599bffe57",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 941519,
            "upload_time": "2024-01-19T23:29:15",
            "upload_time_iso_8601": "2024-01-19T23:29:15.104576Z",
            "url": "https://files.pythonhosted.org/packages/10/56/913c82bf783dc5fc887bead040909420ed3469e05f1e0b7d2a26883cbeed/cyfi-1.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-19 23:29:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "drivendataorg",
    "github_project": "cyfi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cyfi"
}
        
Elapsed time: 3.51797s