Skip to content

Commit

Permalink
Normalize each channel for flat
Browse files Browse the repository at this point in the history
  • Loading branch information
vladtcvs committed Dec 17, 2024
1 parent 395e23f commit 20891e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vstarstack/library/calibration/flat.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def prepare_flat_sky(images : vstarstack.library.common.IImageSource,
if not flat.get_channel_option(channel, "signal"):
continue
layer = cv2.GaussianBlur(layer, (15, 15), 0)
flat.add_channel(layer, channel, **opts)
layer = layer / np.amax(layer)
flat.replace_channel(layer, channel, **opts)
for channel in list(flat.get_channels()):
if not flat.get_channel_option(channel, "weight"):
continue
Expand Down Expand Up @@ -201,5 +202,6 @@ def approximate_flat_image(flat : vstarstack.library.data.DataFrame) -> vstarsta
ky = ky * k**2
layer_approximated = generate_flat(layer.shape[1], layer.shape[0], x0, y0, val0, kx, ky)
layer_approximated = detect_spots(layer, layer_approximated)
layer_approximated = layer_approximated / np.amax(layer_approximated)
flat.replace_channel(layer_approximated, channel, **opts)
return flat

0 comments on commit 20891e3

Please sign in to comment.