Weighted overlap coefficient for 2D and 3D data comparison
Project description
WOC - Weighted Overlap Coefficient
Python code to calculate the weighted overlap coefficient between 2 fields (2D or 3D) while considering masking.
Please cite J. Yoo et.al., (ApJS, Vol 261, Issue 2, 2022) arXiv:2205.08161
Install
Base (runtime only):
pip install pywoc
Optional extras:
- Plotting support:
pip install pywoc[plot] - Examples/tutorial deps (Astropy/Scipy/Matplotlib):
pip install pywoc[examples]
From source:
python -m pip install git+https://github.com/csabiu/WOC.git
Running
from pywoc import woc
woc(map1, map2, radii, mask=None, centre=None, pixelsize=1, plot=False, savefig=None, rbins=20, maxr=None):
-
map1 -- 2‑D or 3-D
numpy.ndarrayrepresenting the reference map/volume. The array shape defines the pixel/voxel grid and all values should be finite and non‑negative. -
map2 -- second map/volume with the same shape as
map1. Its units should match those ofmap1. AnyNaNentries are ignored when the coefficient is calculated. -
radii -- sequence of radius values used to define contours in
map1. The values are interpreted in units ofpixelsize(pixels ifpixelsizeis1). For example[100, 200, 300]means 100, 200 and 300 pixels or, whenpixelsizegives the physical pixel size, distances in those physical units. -
optional parameters
mask-- boolean array with the same shape as the maps.1marks valid pixels/voxels and0masks them.pixelsize-- conversion factor from pixel/voxel units to physical units.rbins-- number of radial bins for the radial profile.maxr-- maximum radius of the profile in pixel/voxel units.centre-- profile centre.Noneuses the brightest pixel ofmap1;"mid"uses the geometric centre;[x, y]for 2D or[x, y, z]for 3D specifies explicit coordinates.plot-- ifTrueshow diagnostic plots (only supported for 2D data).savefig-- filename for plots whenplotisTrue.
The call returns a single floating point value containing the weighted
overlap coefficient between map1 and map2.
revision history
0.0.1 initial code release
0.1.0 added python notebook tutorial under /nb improved documentation
0.2.0 added a dynamic calculation of radial profile fixed some installation problems
0.3.0 added extra parameters to control the radial profile calculation
0.4.0 added some numba support
0.4.1 added radial profile vectorization and regression tests
0.4.2 bug fixes and performance improvements
0.5.0 extended to support 3D analysis
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pywoc-0.5.0.tar.gz.
File metadata
- Download URL: pywoc-0.5.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbccb5694325c3e8a52d24155cbf5722ead1d7c711b514a2a125ef18a5b304da
|
|
| MD5 |
a37bc747981ec161fc2c23be05fad1b2
|
|
| BLAKE2b-256 |
1c71b697e45ffcde33fc117e9d300fbf9507181c683ffcdab48060b7ebe37a43
|
File details
Details for the file pywoc-0.5.0-py3-none-any.whl.
File metadata
- Download URL: pywoc-0.5.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fa3b6fb62ccf5d839ca85092f5d7b039efc60fedd2e1e33a0c9b4badef621cf
|
|
| MD5 |
3c62fec1eaa7b331c4a48e0249ccd7ec
|
|
| BLAKE2b-256 |
e40c067b592c6d44e9c4c10fb4656cbc1689d895bd37ace219c9b508852bbb20
|