weightmask 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-09-08
4
+
5
+ First tagged release of the classical weightmask pipeline (`pip install weightmask`).
6
+
7
+ - CLI: `weightmask` (MEF-capable) and `weightmask-reconstruct-sky`
8
+ - Products: weight or confidence, quality mask, inverse-variance, sky, optional per-contaminant masks
9
+ - Quality bits: BAD, SAT, CR, DETECTED, STREAK, INVALID_VARIANCE (`set_means_flagged`)
10
+ - Theoretical core plane is an Elixir-style F² sensitivity weight `g² F² / (S g + RN²)` (Poisson+RN at F=1). Canonical YAML also enables `flat_rel_noise` and `rescale_variance`.
11
+ - Sky mesh encode/decode uses the same clipped SEP node abscissae
12
+ - Config: canonical `weightmask.yml`; unknown top-level keys rejected; `WeightMapGenerator` fails closed
13
+
14
+ Known limitations: one gain/readnoise per HDU; real-data benchmark suites need external labels.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sébastien Fabbro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ include CHANGELOG.md
2
+ include weightmask.yml
3
+ prune tests
4
+ prune examples
5
+ prune benchmarks
6
+ prune sandbox
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: weightmask
3
+ Version: 0.1.0
4
+ Summary: Per-pixel weight, mask, inverse-variance, and sky maps for astronomical FITS images.
5
+ Author-email: Seb Fabbro <sebfabbro@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/astroai/weightmask
8
+ Project-URL: Issues, https://github.com/astroai/weightmask/issues
9
+ Project-URL: Changelog, https://github.com/astroai/weightmask/blob/main/CHANGELOG.md
10
+ Project-URL: Source, https://github.com/astroai/weightmask
11
+ Project-URL: PyPI, https://pypi.org/project/weightmask/
12
+ Keywords: astronomy,FITS,weight,mask,variance
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: numpy
24
+ Requires-Dist: astropy
25
+ Requires-Dist: fitsio
26
+ Requires-Dist: scipy
27
+ Requires-Dist: scikit-image
28
+ Requires-Dist: sep
29
+ Requires-Dist: PyYAML
30
+ Requires-Dist: astroscrappy
31
+ Dynamic: license-file
32
+
33
+ # weightmask
34
+
35
+ [![CI](https://github.com/astroai/weightmask/actions/workflows/ci.yml/badge.svg)](https://github.com/astroai/weightmask/actions/workflows/ci.yml)
36
+ [![PyPI](https://img.shields.io/pypi/v/weightmask.svg)](https://pypi.org/project/weightmask/)
37
+ [![Python](https://img.shields.io/pypi/pyversions/weightmask.svg)](https://pypi.org/project/weightmask/)
38
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
39
+
40
+ weightmask reads a detrended FITS or MEF science image and writes a per-pixel
41
+ weight, quality mask, inverse-variance map, and sky.
42
+
43
+ Those products are for any measurement that should ignore bad pixels and
44
+ down-weight the rest: coaddition, shape measurement, forced photometry,
45
+ profile fitting, and difference imaging.
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install weightmask
51
+ ```
52
+
53
+ Python 3.10+. Copy [`weightmask.yml`](weightmask.yml) into the working directory;
54
+ it is not bundled in the wheel.
55
+
56
+ Pixi (development):
57
+
58
+ ```bash
59
+ git clone https://github.com/astroai/weightmask.git
60
+ cd weightmask
61
+ pixi install
62
+ ```
63
+
64
+ Details: [docs/installation.md](docs/installation.md).
65
+
66
+ ## Run
67
+
68
+ ```bash
69
+ weightmask science.fits --config weightmask.yml --flat_image flat.fits \
70
+ -o weight.fits --output_mask mask.fits
71
+ ```
72
+
73
+ ## Docs
74
+
75
+ - [Installation](docs/installation.md)
76
+ - [Usage](docs/usage.md)
77
+ - [Algorithms](docs/algorithms.md)
78
+ - [API](docs/api.md)
79
+ - [CHANGELOG](CHANGELOG.md)
80
+
81
+ ## License
82
+
83
+ MIT
@@ -0,0 +1,51 @@
1
+ # weightmask
2
+
3
+ [![CI](https://github.com/astroai/weightmask/actions/workflows/ci.yml/badge.svg)](https://github.com/astroai/weightmask/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/weightmask.svg)](https://pypi.org/project/weightmask/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/weightmask.svg)](https://pypi.org/project/weightmask/)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+
8
+ weightmask reads a detrended FITS or MEF science image and writes a per-pixel
9
+ weight, quality mask, inverse-variance map, and sky.
10
+
11
+ Those products are for any measurement that should ignore bad pixels and
12
+ down-weight the rest: coaddition, shape measurement, forced photometry,
13
+ profile fitting, and difference imaging.
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ pip install weightmask
19
+ ```
20
+
21
+ Python 3.10+. Copy [`weightmask.yml`](weightmask.yml) into the working directory;
22
+ it is not bundled in the wheel.
23
+
24
+ Pixi (development):
25
+
26
+ ```bash
27
+ git clone https://github.com/astroai/weightmask.git
28
+ cd weightmask
29
+ pixi install
30
+ ```
31
+
32
+ Details: [docs/installation.md](docs/installation.md).
33
+
34
+ ## Run
35
+
36
+ ```bash
37
+ weightmask science.fits --config weightmask.yml --flat_image flat.fits \
38
+ -o weight.fits --output_mask mask.fits
39
+ ```
40
+
41
+ ## Docs
42
+
43
+ - [Installation](docs/installation.md)
44
+ - [Usage](docs/usage.md)
45
+ - [Algorithms](docs/algorithms.md)
46
+ - [API](docs/api.md)
47
+ - [CHANGELOG](CHANGELOG.md)
48
+
49
+ ## License
50
+
51
+ MIT
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "weightmask"
7
+ version = "0.1.0"
8
+ authors = [
9
+ { name="Seb Fabbro", email="sebfabbro@gmail.com" },
10
+ ]
11
+ description = "Per-pixel weight, mask, inverse-variance, and sky maps for astronomical FITS images."
12
+ readme = "README.md"
13
+ license = "MIT"
14
+ license-files = ["LICENSE"]
15
+ requires-python = ">=3.10"
16
+ keywords = ["astronomy", "FITS", "weight", "mask", "variance"]
17
+ classifiers = [
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Operating System :: OS Independent",
24
+ "Topic :: Scientific/Engineering :: Astronomy",
25
+ ]
26
+ dependencies = [
27
+ "numpy",
28
+ "astropy",
29
+ "fitsio",
30
+ "scipy",
31
+ "scikit-image",
32
+ "sep",
33
+ "PyYAML",
34
+ "astroscrappy",
35
+ ]
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/astroai/weightmask"
39
+ Issues = "https://github.com/astroai/weightmask/issues"
40
+ Changelog = "https://github.com/astroai/weightmask/blob/main/CHANGELOG.md"
41
+ Source = "https://github.com/astroai/weightmask"
42
+ PyPI = "https://pypi.org/project/weightmask/"
43
+
44
+ [tool.setuptools.packages.find]
45
+ include = ["weightmask"]
46
+ exclude = ["sandbox*", "tests*", "examples*", "benchmarks*"]
47
+
48
+ # --- This section creates the command-line script ---
49
+ [project.scripts]
50
+ weightmask = "weightmask.cli:run_pipeline"
51
+ weightmask-reconstruct-sky = "weightmask.reconstruct_sky:main"
52
+
53
+ [tool.ruff]
54
+ line-length = 120
55
+ extend-exclude = ["benchmarks"]
56
+
57
+ [tool.ruff.lint]
58
+ select = ["E", "F", "W", "I"]
59
+ ignore = ["E501"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,36 @@
1
+ """
2
+ WeightMask: A modular tool for generating mask, weight, and confidence maps for astronomical images.
3
+
4
+ This package includes modules for detecting various effects in astronomical images:
5
+ - Saturation
6
+ - Bad pixels
7
+ - Cosmic rays
8
+ - Streaks
9
+ - Object detection
10
+ - Background estimation
11
+ - Variance calculation
12
+ """
13
+
14
+ try:
15
+ from importlib.metadata import version as _distribution_version
16
+
17
+ __version__ = _distribution_version("weightmask")
18
+ except Exception:
19
+ __version__ = "0.1.0"
20
+
21
+ # Legacy public dictionary kept stable; the contract adds INVALID_VARIANCE.
22
+ from .contract import QUALITY_BITS
23
+
24
+ MASK_BITS = QUALITY_BITS
25
+
26
+ MASK_DTYPE = "uint32" # Data type for the bitmask
27
+
28
+ __all__ = ["MASK_BITS", "MASK_DTYPE", "QUALITY_BITS", "WeightMapGenerator", "__version__"]
29
+
30
+
31
+ def __getattr__(name: str):
32
+ if name == "WeightMapGenerator":
33
+ from .pipeline import WeightMapGenerator
34
+
35
+ return WeightMapGenerator
36
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")