|
3 | 3 | from pySNOM.images import type_from_channelname |
4 | 4 | from pySNOM.defaults import Defaults |
5 | 5 |
|
6 | | -MeasurementModes = Enum("MeasurementModes", ["None", "nanoFTIR", "PsHet", "PTE"]) |
| 6 | +MeasurementModes = Enum( |
| 7 | + "MeasurementModes", ["None", "nanoFTIR", "PsHet", "PTE", "nanoRaman"] |
| 8 | +) |
7 | 9 | DataTypes = Enum("DataTypes", ["Amplitude", "Phase", "Complex", "Topography"]) |
8 | 10 | ChannelTypes = Enum("ChannelTypes", ["None", "Optical", "Mechanical"]) |
9 | 11 | ScanTypes = Enum("ScanTypes", ["Point", "LineScan", "HyperScan"]) |
@@ -219,19 +221,29 @@ def reshape_spectrum_data(data, params): |
219 | 221 | if params["Scan"] == "Fourier Scan": |
220 | 222 | n = 2 |
221 | 223 |
|
222 | | - for channel in list(data.keys()): |
| 224 | + allchannels = list(data.keys()) |
| 225 | + if "Depth" in allchannels: |
| 226 | + spectral_depth = len(np.unique(data["Depth"])) |
| 227 | + elif "Index" in allchannels: |
| 228 | + spectral_depth = len(np.unique(data["Index"])) |
| 229 | + elif "Omega" in allchannels: |
| 230 | + spectral_depth = len(np.unique(data["Omega"])) |
| 231 | + else: |
| 232 | + spectral_depth = params["PixelArea"][2] * n |
| 233 | + |
| 234 | + for channel in allchannels: |
223 | 235 | # Point spectrum |
224 | 236 | if params["PixelArea"][1] == 1 and params["PixelArea"][0] == 1: |
225 | | - data[channel] = np.reshape(data[channel], (params["PixelArea"][2] * n)) |
| 237 | + data[channel] = np.reshape(data[channel], (spectral_depth)) |
226 | 238 |
|
227 | 239 | # Linescan and HyperScan |
228 | 240 | else: |
229 | | - data[data[channel]] = np.reshape( |
| 241 | + data[channel] = np.reshape( |
230 | 242 | data[channel], |
231 | 243 | ( |
232 | 244 | params["PixelArea"][0], |
233 | 245 | params["PixelArea"][1], |
234 | | - params["PixelArea"][2] * n, |
| 246 | + spectral_depth, |
235 | 247 | ), |
236 | 248 | ) |
237 | 249 |
|
|
0 commit comments