Metadata-Version: 2.1
Name: pywoc
Version: 0.4.2
Summary: 2-D 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/plain
Provides-Extra: plot
Provides-Extra: examples

WOC - Weighted Overlap Coefficient

Python code to calculate the weighted overlap coefficient between
2 fields 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 ``numpy.ndarray`` representing the reference map. The
  array shape defines the pixel grid and all values should be finite and
  non‑negative.

- **map2** -- second map 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 and ``0`` masks them.
    - ``pixelsize`` -- conversion factor from pixel units to physical units.
    - ``rbins`` -- number of radial bins for the radial profile.
    - ``maxr`` -- maximum radius of the profile in **pixel units**.
    - ``centre`` -- profile centre. ``None`` uses the brightest pixel of
      ``map1``; ``"mid"`` uses the geometric centre; ``[x, y]`` specifies explicit
      coordinates.
    - ``plot`` -- if ``True`` show diagnostic plots.
    - ``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
