Commit 2acbdefc authored by Hugo Buddelmeijer's avatar Hugo Buddelmeijer
Browse files

Add some initial support for CreateVarDqLayers_make

parent 2eb1aba0
Pipeline #8719 failed with stages
in 17 minutes and 9 seconds
......@@ -37,3 +37,15 @@ class DataExtensionImage(DataExtension):
self.NAXIS2 = 2 * int(numpy.round(detector.yhw / detector.pixsize))
if self.EXTNAME == '':
self.EXTNAME = detector.id
class DataExtensionVariance(DataExtensionImage):
"""
Variance layer of the image.
"""
class DataExtensionQuality(DataExtensionImage):
"""
Quality layer of the image.
"""
# -*- coding: utf-8 -*-
"""
CreateVarDqLayers
"""
import numpy
from micado.main.Img import Img
from micado.main.DataExtensionImage import (
DataExtensionImage, DataExtensionVariance, DataExtensionQuality
)
def make(raw):
"""
CreateVarDqLayers
"""
extensions = [
DataExtensionImage(
NAXIS=rawextension.NAXIS,
NAXIS1=rawextension.NAXIS1,
NAXIS2=rawextension.NAXIS2,
BITPIX=rawextension.BITPIX,
data=rawextension.data,
)
for rawextension in raw.extensions
]
variances = [
DataExtensionVariance(
NAXIS=rawextension.NAXIS,
NAXIS1=rawextension.NAXIS1,
NAXIS2=rawextension.NAXIS2,
BITPIX=rawextension.BITPIX,
data=rawextension.data,
)
for rawextension in raw.extensions
]
qualities = [
DataExtensionQuality(
NAXIS=rawextension.NAXIS,
NAXIS1=rawextension.NAXIS1,
NAXIS2=rawextension.NAXIS2,
BITPIX=rawextension.BITPIX,
data=numpy.zeros(
(rawextension.NAXIS1, rawextension.NAXIS2),
dtype="int32",
),
)
for rawextension in raw.extensions
]
img = Img()
img.extensionn = extensions
img.variances = variances
img.qualities = qualities
return img
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment