@@ -106,6 +106,14 @@ def coordinates_sensor(self) -> na.AbstractSpectralPositionalVectorArray:
106106 A grid of wavelength and position coordinates on the detector plane.
107107 """
108108
109+ @property
110+ @abc .abstractmethod
111+ def axis_channel (self ) -> str | tuple [str , ...]:
112+ """
113+ The logical axis or axes of this instrument corresponding to
114+ the different dispersion magnitudes and angles.
115+ """
116+
109117 @property
110118 @abc .abstractmethod
111119 def axis_wavelength (self ) -> str :
@@ -130,6 +138,14 @@ def axis_sensor_xy(self) -> tuple[str, str]:
130138 changing position coordinate.
131139 """
132140
141+ @property
142+ @abc .abstractmethod
143+ def num_channel (self ) -> int :
144+ """
145+ The total number of dispersion magnitudes/angles observed by this
146+ instrument.
147+ """
148+
133149
134150@dataclasses .dataclass
135151class AbstractLinearInstrument (
@@ -160,6 +176,21 @@ def weights_transpose(
160176 skyplane.
161177 """
162178
179+ @property
180+ def num_channel (self ) -> int :
181+
182+ shape = self .weights [0 ].shape
183+
184+ axis_channel = self .axis_channel
185+ if isinstance (axis_channel , str ):
186+ axis_channel = (axis_channel ,)
187+
188+ num_channels = 1
189+ for ax in axis_channel :
190+ num_channels = num_channels * shape [ax ]
191+
192+ return num_channels
193+
163194 @property
164195 def _volume_scene (self ) -> na .AbstractScalar :
165196 """
@@ -338,6 +369,12 @@ class IdealInstrument(
338369 A grid of wavelength and position coordinates on the sensor plane.
339370 """
340371
372+ axis_channel : str | tuple [str , ...] = dataclasses .MISSING
373+ """
374+ The logical axis or axes of this instrument corresponding to
375+ the different dispersion magnitudes and angles.
376+ """
377+
341378 axis_wavelength : str = dataclasses .MISSING
342379 """
343380 The logical axis of :attr:`coordinates_scene` and :attr:`coordinates_sensor`
0 commit comments