FragStatsPy


NameFragStatsPy JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryA Python wrapper for Fragstats.
upload_time2023-06-19 19:41:40
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT License Copyright (c) 2023 Scott Lawson - UVM Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords landsacape metrics spatial statistics fragstats
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="images/main.JPG" alt= “FragStatsPy”>


## Python Wrapper for Fragstats

FragStatsPy a wrapper to [Fragstats](https://fragstats.org/) that allows for automated model setup and execution.  While Fragstats currently provides a command-line tool for model execution, it does not provide command-line tools for model setup.  FragStatsPy begins to fill that gap by providing functions to generate and manipulate Fragstats models from within Python.

Current functionality includes
* Model database generation
* Loading landscape layers
* Setting the output base path
* Defining a sampling strategy
* Linking user-defined tiles
* A general purpose SQL editor to allow for complete model manipulation (for savvy users)
* Access to the Fragstats native run commands (command-line)

## Example Code

The code below will setup and run a Fragstats model to calculate the mean and standard deviation of patch sizes per user-defined region.
```python
import src.frag_model as fspy

model = fspy.FragModel('model_py.fca')
model.set_output_base_path('model_outputs')
model.load_landscape_layer("geomorphic_patches.tif")
model.set_user_provided_tiles("regions.tif")
model.set_sampling_strategy(strategy='user_tiles', landscape=True)
model.toggle_metric(level='l', metric='AREA', stat='MN', on=True)
model.toggle_metric(level='l', metric='AREA', stat='SD', on=True)
model.run_model()
results = model.get_results()
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "FragStatsPy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "Landsacape metrics,spatial statistics,fragstats",
    "author": "",
    "author_email": "Scott Lawson <scott.lawson@uvm.edu>",
    "download_url": "https://files.pythonhosted.org/packages/a8/09/7ab2d9eee0fdc1691757fbe6c07c12135e73774d4b18947590de8c045bac/FragStatsPy-0.0.2.tar.gz",
    "platform": null,
    "description": "<img src=\"images/main.JPG\" alt= \u201cFragStatsPy\u201d>\r\n\r\n\r\n## Python Wrapper for Fragstats\r\n\r\nFragStatsPy a wrapper to [Fragstats](https://fragstats.org/) that allows for automated model setup and execution.  While Fragstats currently provides a command-line tool for model execution, it does not provide command-line tools for model setup.  FragStatsPy begins to fill that gap by providing functions to generate and manipulate Fragstats models from within Python.\r\n\r\nCurrent functionality includes\r\n* Model database generation\r\n* Loading landscape layers\r\n* Setting the output base path\r\n* Defining a sampling strategy\r\n* Linking user-defined tiles\r\n* A general purpose SQL editor to allow for complete model manipulation (for savvy users)\r\n* Access to the Fragstats native run commands (command-line)\r\n\r\n## Example Code\r\n\r\nThe code below will setup and run a Fragstats model to calculate the mean and standard deviation of patch sizes per user-defined region.\r\n```python\r\nimport src.frag_model as fspy\r\n\r\nmodel = fspy.FragModel('model_py.fca')\r\nmodel.set_output_base_path('model_outputs')\r\nmodel.load_landscape_layer(\"geomorphic_patches.tif\")\r\nmodel.set_user_provided_tiles(\"regions.tif\")\r\nmodel.set_sampling_strategy(strategy='user_tiles', landscape=True)\r\nmodel.toggle_metric(level='l', metric='AREA', stat='MN', on=True)\r\nmodel.toggle_metric(level='l', metric='AREA', stat='SD', on=True)\r\nmodel.run_model()\r\nresults = model.get_results()\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Scott Lawson - UVM  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Python wrapper for Fragstats.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/sclaw/FragStatsPy"
    },
    "split_keywords": [
        "landsacape metrics",
        "spatial statistics",
        "fragstats"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8622ffcf0bd2caed420e450ff25875a7e9a1164528888ea751fba80c3dc6436b",
                "md5": "35da660542e63cdb0abd0d4e84a72daf",
                "sha256": "6bb053e78d0cf0c2e8cfbf9312246f05f6c0409132de055a1e3338adb2737574"
            },
            "downloads": -1,
            "filename": "FragStatsPy-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "35da660542e63cdb0abd0d4e84a72daf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6180,
            "upload_time": "2023-06-19T19:41:39",
            "upload_time_iso_8601": "2023-06-19T19:41:39.238366Z",
            "url": "https://files.pythonhosted.org/packages/86/22/ffcf0bd2caed420e450ff25875a7e9a1164528888ea751fba80c3dc6436b/FragStatsPy-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a8097ab2d9eee0fdc1691757fbe6c07c12135e73774d4b18947590de8c045bac",
                "md5": "dcee517114cc78f2aecfb417ac50f5ad",
                "sha256": "ff3f36c66a81202e671427396a6d048908ce7c86ed96c5f025ae9fb02108abed"
            },
            "downloads": -1,
            "filename": "FragStatsPy-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "dcee517114cc78f2aecfb417ac50f5ad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5142,
            "upload_time": "2023-06-19T19:41:40",
            "upload_time_iso_8601": "2023-06-19T19:41:40.710244Z",
            "url": "https://files.pythonhosted.org/packages/a8/09/7ab2d9eee0fdc1691757fbe6c07c12135e73774d4b18947590de8c045bac/FragStatsPy-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-19 19:41:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sclaw",
    "github_project": "FragStatsPy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fragstatspy"
}
        
Elapsed time: 0.19391s