GONGHAlphaAnomalyzer
(Part of the MLEcoFi Project)
GONGHAlphaAnomalyzer is a software for detecting anomalies in GONG H-Alpha full-disk solar observations. Leveraging a grid-based approach and advanced statistical analysis, it computes optimal pixel average range values for each grid cell to identify anomalies effectively.
Try the demo online
Table of Contents
- Installation
- Importing Required Library
- Initializing Anomalyzer
- Computing Best Ranges
- Finding Corrupt Images
- Plotting Image Likelihoods with Corrupt Cells
- Example Outputs
User Manual
Installation
To install the required library, run:
pip install GONGHAlphaAnomalyzer
Importing Required Class
Import the Anomalyzer class from the library's anomalyzer module into your Python script with:
from GONGHAlphaAnomalyzer.anomalyzer import Anomalyzer
Initializing Anomalyzer Object
Create an instance of Anomalyzer with a specified grid size:
anomalyzer = Anomalyzer(grid_size=8)
Computing Best Ranges
Calculate optimal range values for each grid cell using your image paths.
anomalyzer.compute_best_ranges(
non_anomalous_paths=['path/to/non-anomalous/image1.png', 'path/to/non-anomalous/image2.png'],
anomalous_paths=['path/to/anomalous/image1.png', 'path/to/anomalous/image2.png']
)
Parameters:
non_anomalous_paths: List of paths to non-anomalous image files.anomalous_paths: List of paths to anomalous image files.lower_range_end: End of candidate lower ranges, default is 20.upper_range_start: Start of candidate upper ranges, default is 80.step_size: Step size for candidate ranges, default is 2.
Finding Corrupt Images
Detect corrupt images based on computed best ranges, with options to set likelihood thresholds and minimum corrupt cells:
corrupt_images_labels = anomalyzer.find_corrupt_images(
image_paths=['path/to/image1.png', 'path/to/image2.png'],
likelihood_threshold=0.6,
min_corrupt_cells=1,
verbose=True
)
Parameters:
image_paths: List of paths to image files.likelihood_threshold: Threshold for considering a cell as corrupt, default is 0.5.min_corrupt_cells: Minimum number of corrupt cells required to classify an image as corrupt, default is 0.verbose: If True, prints the number of detected corrupt images, default is False.
Plotting Image Likelihoods with Corrupt Cells
Visualize the anomaly likelihoods with an option to highlight corrupt cells:
anomalyzer.plot_image_likelihoods(
image_path='path/to/image.png',
likelihood_threshold=0.6
)
Parameters:
image_path: Path to the image file.likelihood_threshold: Optional threshold for identifying corrupt cells. If provided, corrupt cells will be outlined.
Example Outputs
Metadata
Release files for GONGHAlphaAnomalyzer 1.0.0
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 |
|---|---|---|---|---|
| GONGHAlphaAnomalyzer-1.0.0.tar.gz | 11.5 kB | Without provenance | Details for GONGHAlphaAnomalyzer-1.0.0.tar.gz |
Release files / GONGHAlphaAnomalyzer-1.0.0.tar.gz
| Download URL | GONGHAlphaAnomalyzer-1.0.0.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
856d60d38562c1a7997fabb535fbb71719baa24ccbbfc16c71bdd66d6643f46b
|
|
BLAKE2b-256 checksum How to use checksums |
a5c97e3bd406ac75333359dc59a0e1dd4291329ade447b16875eb75d25372127
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9
|
Security for GONGHAlphaAnomalyzer 1.0.0
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.