From 2ec7f7ae0a2bdeb752b4c5d0b1bc47ecb5429b04 Mon Sep 17 00:00:00 2001 From: chenghymichael Date: Tue, 5 Mar 2024 23:48:18 -0500 Subject: [PATCH] Update sensors.py added def get_datacube_size(self): """Get the size of datacube in bit.""" --- architect/systems/optical/sensors.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/architect/systems/optical/sensors.py b/architect/systems/optical/sensors.py index c3aac5f..f6683ee 100644 --- a/architect/systems/optical/sensors.py +++ b/architect/systems/optical/sensors.py @@ -188,6 +188,15 @@ def get_waveband(self) -> Quantity[unit.m]: return self.waveband else: raise ValueError("Waveband is not set.") + + def get_datacube_size(self): + """Get the size of datacube in bit.""" + + npxx = self.n_px[0] # 640 px, pixels on the sensor in the across-track direction -> spatial information + npxy = self.n_px[1] # 512 px, pixels on the sensor in the along-track direction -> spectral information + nbit = self.n_bit # bit depth + D = npxx * npxx * npxy * nbit + return D class TauSWIR(Sensor):