H5DARKFRAMES (beta)
H5Darkframes is a python library for generating and using darkframes library. For now, it supports only asi zwo cameras (see https://github.com/MPI-IS/camera_zwo_asi).
This is beta, and need some more testing
Installation
from source:
git clone https://github.com/MPI-IS/h5darkframes.git
cd h5darkframes
pip install .
from pypi:
pip install h5darkframes
Usage
Assuming that camera-zwo-asi is installed and a camera is plugged:
creating a darkframe library
First, a configuration file must be created. In a terminal:
darkframes-zwoasi-config
This will create in the current directory a file darkframes.toml with a content similar to:
[darkframes]
average_over = 5
[camera.controllables]
AutoExpMaxExpMS = 30000
AutoExpMaxGain = 285
AutoExpTargetBrightness = 100
BandWidth = "auto"
CoolerOn = 0
Exposure = 300
Flip = 0
Gain = 400
HighSpeedMode = 0
MonoBin = 0
Offset = 8
TargetTemp = 26
WB_B = 95
WB_R = 52
[camera.roi]
start_x = 0
start_y = 0
width = 4144
height = 2822
bins = 1
type = "raw8"
[darkframes.controllables.TargetTemp]
min = -15
max = 15
step = 3
threshold = 1
timeout = 600
[darkframes.controllables.Exposure]
min = 1000000
max = 30000000
step = 5000000
threshold = 1
timeout = 0.1
[darkframes.controllables.Gain]
min = 200
max = 400
step = 100
threshold = 1
timeout = 0.1
You may edit this file to setup:
-
your desired camera configuration
-
the controllables over which darkframes will be created, and over which range
-
the number of pictures that will be averaged per darkframes
For example:
[darkframes.controllables.TargetTemp]
min = -15
max = 15
step = 3
threshold = 1
timeout = 600
implies that darkframes will be taken for values of temperature -15, -12, -9, ... up to +15.
creating the darkframes library
Call in a terminal:
# change "mylibraryname" to a name of your choice
darkframes-zwoasi-library --name mylibraryname
You may get stats regarding the library (requires a file 'darkframes.hdf5' in the current directory):
darkframes-info
using the library
import h5darkframes as dark
import camera_zwo_asi as zwo
from pathlib import Path
# path to the library
path = Path("/path/to/darkframes.hdf5")
# handle over the library
library = dark.ImageLibrary(path)
# handle over the camera
camera = zwo.Camera(0)
# taking a picture. Image is an instance of zwo.Image
image = camera.capture()
# getting the current camera configuration
controls = camera.get_controls()
# "Temperature", "Exposure" and "Gain" must be the
# controllables that have been iterated over
# during the creation of the library
darkframe_target = {
"Temperature": controls["Temperature"].value,
"Exposure": controls["Exposure"].value,
"Gain": controls["Gain"].value
}
# getting the darkframe that is the closest to the target
# darkframe: a numpy array
# darkframe_config: the config of the camera when the darkframe was taken
darkframe, darkframe_config= library.get(darkframe_target)
# optional sanity checks
assert image.get_data().shape == darkframe.shape
assert image.get_data().dtype = darkframe.dtype
# substracting the darkframe
substracted_image = image.get_data()-darkframe
Metadata
Release files for h5darkframes 0.1.7
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 |
|---|---|---|---|---|
| h5darkframes-0.1.7.tar.gz | 20.7 kB | Without provenance | Details for h5darkframes-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| h5darkframes-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for h5darkframes-0.1.7-py3-none-any.whl |
Total release size: 51.0 kB
Release files / h5darkframes-0.1.7.tar.gz
| Download URL | h5darkframes-0.1.7.tar.gz |
|---|---|
| Size | 20.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1176177c8cfc18ae9518b2f81bbe1b269e3a9da3a5dc8cf37b7229a9baf23f82
|
|
BLAKE2b-256 checksum How to use checksums |
0c1596cbdb3a1359976cc4a2c5253444368c7c43c15fee249ca486cd5c333716
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.3 Linux/6.14.0-33-generic
|
Release files / h5darkframes-0.1.7-py3-none-any.whl
| Download URL | h5darkframes-0.1.7-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
411478f99409d736ded62304b91f2d434c96dd387a42ee8ad0a0dd1096b1d590
|
|
BLAKE2b-256 checksum How to use checksums |
c4eda202e2f484fcb6c62f2607b6831ae257fcca9858fbb6d55d0a8cf5d32d54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.3 Linux/6.14.0-33-generic
|
Security for h5darkframes 0.1.7
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.