|
16 | 16 | from importlib import import_module |
17 | 17 |
|
18 | 18 | import matplotlib |
19 | | -import numpy |
20 | 19 | import numpy as np |
21 | 20 | from astropy import units as u |
22 | 21 | from astropy.io.ascii.core import InconsistentTableError |
@@ -4014,63 +4013,6 @@ def maskBeyondSlit(self, adinputs=None, **params): |
4014 | 4013 |
|
4015 | 4014 | return adinputs |
4016 | 4015 |
|
4017 | | - def monitorWavelengthSolution(self, adinputs=None, **params): |
4018 | | - """ |
4019 | | - This captures some info from the wavelength solution for the GOA |
4020 | | - instrument monitoring system into various MWS_ headers for the instrument |
4021 | | - monitoring system to pick up. |
4022 | | -
|
4023 | | - Values Captured include the polynomial coefficients and RMS from the |
4024 | | - .WAVECAL table, the central wavelength from both the WCS and central_wavlength() |
4025 | | - descriptor and the difference between them. |
4026 | | - :return: |
4027 | | - """ |
4028 | | - log = self.log |
4029 | | - log.debug(gt.log_message("primitive", self.myself(), "starting")) |
4030 | | - |
4031 | | - tocapture = ('c0', 'c1', 'c2', 'c3', 'rms', 'inv_rms', 'fwidth') |
4032 | | - |
4033 | | - for ad in adinputs: |
4034 | | - for ext in ad: |
4035 | | - wavecal = getattr(ext, 'WAVECAL', None) |
4036 | | - if wavecal is None: |
4037 | | - continue |
4038 | | - |
4039 | | - for row in wavecal: |
4040 | | - # Capture values from WAVEVAL table into monitoring headers |
4041 | | - if row['name'] in tocapture: |
4042 | | - keyword = 'MWS_' + row['name'].upper()[:4] |
4043 | | - if row['name'] == 'inv_rms': |
4044 | | - keyword = 'MWS_IRMS' |
4045 | | - ext.hdr[keyword] = (row['coefficients'], |
4046 | | - f'WAVECAL {row['name']} coefficient') |
4047 | | - |
4048 | | - # Get the model and evaluate it at the mean of its domain |
4049 | | - model = am.get_named_submodel(ext.wcs.forward_transform, "WAVE") |
4050 | | - if model: |
4051 | | - # Central Wavelength check |
4052 | | - center = np.mean(model.domain) |
4053 | | - model_central_wlen = model(center) |
4054 | | - # We want actual_central_wavelength rather than central_wavelength |
4055 | | - header_central_wlen = ext.actual_central_wavelength(asNanometers=True) |
4056 | | - |
4057 | | - ext.hdr['MWS_DCWL'] = (model_central_wlen - header_central_wlen, |
4058 | | - 'Delta between model and header central_wavelength') |
4059 | | - |
4060 | | - # Dispersion check |
4061 | | - model_dispersion = model(center+0.5) - model(center-0.5) |
4062 | | - header_dispersion = ext.dispersion(asNanometers=True) |
4063 | | - ext.hdr['MWS_DDIS'] = (model_dispersion - header_dispersion, |
4064 | | - 'Delta between model and header dispersion') |
4065 | | - |
4066 | | - |
4067 | | - # Count the number of arc lines in the wavecal table |
4068 | | - ext.hdr['MWS_NUML'] = (numpy.count_nonzero(wavecal['peaks']), |
4069 | | - 'Number of non-zero peaks in the WAVECAL table') |
4070 | | - |
4071 | | - ad.update_filename(suffix=params["suffix"], strip=True) |
4072 | | - |
4073 | | - return adinputs |
4074 | 4016 |
|
4075 | 4017 | def normalizeFlat(self, adinputs=None, **params): |
4076 | 4018 | """ |
|
0 commit comments