Metadata-Version: 2.4
Name: pywoc
Version: 0.5.0
Summary: Weighted overlap coefficient for 2D and 3D data comparison
Home-page: https://github.com/csabiu/woc
Author: Cristiano Sabiu
Author-email: csabiu@gmail.com
License: GNU GPL v3 License
Project-URL: Source, https://github.com/csabiu/WOC
Project-URL: Bug Tracker, https://github.com/csabiu/WOC/issues
Project-URL: Documentation, https://github.com/csabiu/WOC#readme
Keywords: woc,spatial statistics,statistics,python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: numba
Provides-Extra: plot
Requires-Dist: matplotlib>=3.3; extra == "plot"
Provides-Extra: examples
Requires-Dist: astropy>=5; extra == "examples"
Requires-Dist: scipy>=1.7; extra == "examples"
Requires-Dist: matplotlib>=3.3; extra == "examples"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

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.ndarray`` representing 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 of ``map1``. Any ``NaN`` entries are ignored when the
  coefficient is calculated.

- **radii** -- sequence of radius values used to define contours in ``map1``.
  The values are interpreted in units of ``pixelsize`` (pixels if
  ``pixelsize`` is ``1``). For example ``[100, 200, 300]`` means 100, 200 and
  300 pixels or, when ``pixelsize`` gives the physical pixel size, distances in
  those physical units.

- **optional parameters**
    - ``mask`` -- boolean array with the same shape as the maps. ``1`` marks
      valid pixels/voxels and ``0`` masks 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. ``None`` uses the brightest pixel of
      ``map1``; ``"mid"`` uses the geometric centre; ``[x, y]`` for 2D or
      ``[x, y, z]`` for 3D specifies explicit coordinates.
    - ``plot`` -- if ``True`` show diagnostic plots (only supported for 2D data).
    - ``savefig`` -- filename for plots when ``plot`` is ``True``.

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
