Multisimil
This is a Python package to calculate similarity between two classified images at multiple scales.
The main objective of this package is to enable comparision of actual and predicted land use maps at multiple scales so a more relaxed assesment of accuracy can be done which is not possible with pixel to pixel comarision. It allows for the simulated map to miss the exact location of particular land use by a few pixels (specified by the user), and still will be considered a good prediction.
The module can be installed by:
! pip install multisimil
It is important to understand that in case of pixel to pixel comarision, even if when the entire map is shifted by 1 pixel, it will drastically reduce the accuracy. However, with comparing the frequecy of occurance of different land use classes in a neighborhood, a better comparision can be made.
import multisimil
from osgeo import gdal
image1 = "path/to/image1.tif"
image2 = "path/to/image2.tif"
rband1 = gdal.Open(image1).GetRasterBand(1)
rband2 = gdal.Open(image2).GetRasterBand(1)
array1 = rband1.ReadAsArray()
array2 = rbdand2.ReadAsArray()
nodata1 = rband1.GetNoDataValue()
nodata2 = rband2.GetNoDataValue()
array1[array1 == nodata1] = 0
array2[array2 == nodata2] = 0
# TO use 9*9 neighborhood, set f = 9
similarity = multisimil.calculate_similarity(array1, array2, f = 9)
Similarly, we can calculate similarity for multiple neighborhood filter sizes.
# This will calculate similarity for neighborhood sizes from 1*1 to 91*91
find_multiresolution_similarity(array1, array2, min_size = 1, max_size = 100, steps = 10)
More features to come soon.
Metadata
Release files for multisimil 0.0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| multisimil-0.0.1.1.tar.gz | 4.5 kB | Without provenance | Details for multisimil-0.0.1.1.tar.gz |
Release files / multisimil-0.0.1.1.tar.gz
| Download URL | multisimil-0.0.1.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
768c4af4406dbb57dea2d6266e11da1ddf34edbe97bcda81da76efb572cf720a
|
|
BLAKE2b-256 checksum How to use checksums |
206122b55ce5df493e0bda20739d2fbfa487f2b4b4596fab737b3eafefeb8726
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for multisimil 0.0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.