Skip to content

Commit

Permalink
Merge pull request #116 from LCOGT/feature/filter-readout-mode-warning
Browse files Browse the repository at this point in the history
Add alert and check for sinistro filter/readout mode combinations
  • Loading branch information
mgdaily authored Dec 16, 2024
2 parents 5e66b32 + 6f8947b commit 0cb914e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ In this root directory:

If you are developing locally, you will probably need to set a few variables in your development Observation
Portal Django local settings file to handle cross site requests. For example, if your frontend is running at

`http://127.0.0.1:8080`, you would set the following:

```
Expand All @@ -48,7 +49,7 @@ CORS_ORIGIN_WHITELIST = [
'http://127.0.0.1:8080'
]
CSRF_TRUSTED_ORIGINS = [
'127.0.0.1:8080'
'http://127.0.0.1:8080'
]
```

Expand Down
28 changes: 27 additions & 1 deletion src/components/InstrumentConfigForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
@input="update"
/>
<!-- End of MUSCAT instrument specific fields -->
<b-alert variant="warning" :show="badFilterReadoutMode">
<strong>Warning:</strong> This filter/readout mode combination is not eligible for automatic reduction. <br><br>
Please contact <a href="mailto:[email protected]">science support</a> if this combination is required.
</b-alert>
<ocs-custom-select
v-model="instrumentConfig.mode"
field="readout_mode"
Expand Down Expand Up @@ -151,6 +155,7 @@
<script>
import { toRef } from '@vue/composition-api';
import { OCSComposable, OCSUtil } from 'ocs-component-lib';
import _ from 'lodash';
import { lampFlatDefaultExposureTime, arcDefaultExposureTime } from '@/utils';
Expand Down Expand Up @@ -249,7 +254,8 @@ export default {
{ value: 'SYNCHRONOUS', text: 'Synchronous' },
{ value: 'ASYNCHRONOUS', text: 'Asynchronous' }
]
}
},
badFilterReadoutMode: false
};
},
computed: {
Expand All @@ -273,6 +279,26 @@ export default {
}
},
watch: {
'instrumentConfig.optical_elements.filter': function(value) {
this.badFilterReadoutMode = false;
if (this.selectedInstrument === '1M0-SCICAM-SINISTRO') {
if (this.instrumentConfig.mode === 'central_2k_2x2') {
if (_.includes(['u', 'b', 'v', 'r', 'i'], value)) {
this.badFilterReadoutMode = true;
}
}
}
},
'instrumentConfig.mode': function(value) {
this.badFilterReadoutMode = false;
if (this.selectedInstrument === '1M0-SCICAM-SINISTRO') {
if (value === 'central_2k_2x2') {
if (_.includes(['u', 'b', 'v', 'r', 'i'], this.instrumentConfig.optical_elements.filter)) {
this.badFilterReadoutMode = true;
}
}
}
},
'instrumentConfig.exposure_time': function(value) {
if (this.selectedInstrument === 'SOAR_TRIPLESPEC') {
if (value < 7.0) {
Expand Down

0 comments on commit 0cb914e

Please sign in to comment.