@almaobservatory/model 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2128 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import { v4 } from 'uuid';
5
+ import { RxStomp } from '@stomp/rx-stomp';
6
+
7
+ const buildCalibrationTargetParameter = (intendedUse, longitude, latitude, system = 'ICRS') => ({
8
+ sourceName: '',
9
+ sourceCoordinates: {
10
+ longitude: {
11
+ value: longitude,
12
+ unit: 'deg'
13
+ },
14
+ latitude: {
15
+ value: latitude,
16
+ unit: 'deg'
17
+ },
18
+ fieldName: 'None',
19
+ system: system,
20
+ type: 'ABSOLUTE'
21
+ },
22
+ sourceVelocity: {
23
+ centerVelocity: {
24
+ value: 0,
25
+ unit: 'km/s'
26
+ },
27
+ referenceSystem: 'lsrk',
28
+ dopplerCalcType: 'RADIO'
29
+ },
30
+ index: 0,
31
+ nonSiderealMotion: true,
32
+ calibrationTargetProperties: [],
33
+ intendedUse,
34
+ solarSystemObject: 'Uranus'
35
+ });
36
+
37
+ const buildField = (system = 'ICRS') => ({
38
+ '@type': 'SinglePointT',
39
+ name: '',
40
+ centre: {
41
+ longitude: {
42
+ value: 0,
43
+ unit: 'arcsec'
44
+ },
45
+ latitude: {
46
+ value: 0,
47
+ unit: 'arcsec'
48
+ },
49
+ fieldName: 'None',
50
+ system: system,
51
+ type: 'RELATIVE'
52
+ }
53
+ });
54
+
55
+ // possibly you want to use astro.buildRectangleWithNyquistParameters() instead, which populates the rectangle with Nyquist spacing?
56
+ const buildRectangle = (referenceFrequency = undefined, system = 'ICRS') => ({
57
+ '@type': 'RectangleT',
58
+ centre: {
59
+ fieldName: 'None',
60
+ latitude: { value: 0, unit: 'arcsec' },
61
+ longitude: { value: 0, unit: 'arcsec' },
62
+ system: system,
63
+ type: 'RELATIVE'
64
+ },
65
+ long: { value: 0.0, unit: 'arcsec' },
66
+ name: '',
67
+ palong: { value: 0, unit: 'deg' },
68
+ referenceFrequency: referenceFrequency ?? { value: 0, unit: 'GHz' },
69
+ short: { value: 0.0, unit: 'arcsec' },
70
+ spacing: { value: 0.0, unit: 'deg', userUnit: 'fraction of main beam' }
71
+ });
72
+
73
+ const buildTargetParameters = (circlesAndEllipsesAndPolygons = [buildField()], index = 0) => ({
74
+ expectedProperties: {
75
+ expectedPeakFluxDensity: {
76
+ value: 0,
77
+ unit: 'Jy'
78
+ },
79
+ desiredPolarizationPercentage: 0,
80
+ expectedLineWidth: {
81
+ value: 0,
82
+ unit: 'GHz',
83
+ userUnit: 'km/s'
84
+ },
85
+ referenceFrequency: {
86
+ value: 0,
87
+ unit: 'GHz'
88
+ },
89
+ expectedPeakLineFluxDensity: {
90
+ value: 0,
91
+ unit: 'Jy'
92
+ },
93
+ expectedSpectralDynamicRange: 0,
94
+ expectedImageDynamicRange: 0,
95
+ desiredLinePolarizationPercentage: 0,
96
+ desiredCircularPolarizationPercentage: 0,
97
+ desiredLineCircularPolarizationPercentage: 0,
98
+ isPassivePhasing: false,
99
+ solarActivityLevel: 'ActiveSun'
100
+ },
101
+ circlesAndEllipsesAndPolygons,
102
+ index,
103
+ isMosaic: circlesAndEllipsesAndPolygons?.length > 1,
104
+ // in current implementation it never becomes true (circlesAndEllipsesAndPolygons never has multiple elements) but we should be consistent here
105
+ // TODO unify isMosaic logic (for example to move calculateIsMosaic method)
106
+ nonSiderealMotion: false,
107
+ parallax: {
108
+ value: 0,
109
+ unit: 'mas'
110
+ },
111
+ pmDec: {
112
+ value: 0,
113
+ unit: 'mas/yr'
114
+ },
115
+ pmRA: {
116
+ value: 0,
117
+ unit: 'mas/yr'
118
+ },
119
+ sdReferencePositions: [],
120
+ solarMappingDiameter: {
121
+ value: 0,
122
+ unit: 'deg'
123
+ },
124
+ solarSystemObject: 'Unspecified',
125
+ solarMapping: 'FullSolarDisc',
126
+ solarMappingPattern: 'DoubleCircle',
127
+ sourceCoordinates: {
128
+ longitude: {
129
+ value: 0,
130
+ unit: 'deg'
131
+ },
132
+ latitude: {
133
+ value: 0,
134
+ unit: 'deg'
135
+ },
136
+ fieldName: 'None',
137
+ system: 'ICRS',
138
+ type: 'ABSOLUTE'
139
+ },
140
+ sourceEphemeris: '',
141
+ sourceName: '',
142
+ sourceVelocity: {
143
+ referenceSystem: 'lsrk',
144
+ dopplerCalcType: 'RADIO',
145
+ centerVelocity: {
146
+ unit: 'km/s',
147
+ value: 0
148
+ }
149
+ },
150
+ type: 'F_MultiplePoints',
151
+ '@type': 'TargetParametersT'
152
+ });
153
+
154
+ const buildTechnicalJustifications = () => [
155
+ {
156
+ justificationKey: 'ED_SENSITIVITY',
157
+ justificationText: ''
158
+ },
159
+ {
160
+ justificationKey: 'ED_ANGULAR_RESOLUTION',
161
+ justificationText: ''
162
+ },
163
+ {
164
+ justificationKey: 'ED_CORRELATOR',
165
+ justificationText: ''
166
+ },
167
+ {
168
+ justificationKey: 'ED_ADDITIONAL_TIME',
169
+ justificationText: ''
170
+ }
171
+ ];
172
+
173
+ const buildScienceGoal = () => ({
174
+ calibrationSetupParameters: {
175
+ selection: 'system',
176
+ positionalAccuracy: 'Standard',
177
+ isDGCOverride: false,
178
+ querySources: [],
179
+ forcedDGCStrategy: 'NONE',
180
+ calibrationTargetParameters: []
181
+ },
182
+ estimated12MTime: {
183
+ value: 0,
184
+ unit: 's'
185
+ },
186
+ estimated7MTime: {
187
+ value: 0,
188
+ unit: 's'
189
+ },
190
+ estimatedACATime: {
191
+ value: 0,
192
+ unit: 's'
193
+ },
194
+ estimatedTPTime: {
195
+ value: 0,
196
+ unit: 's'
197
+ },
198
+ estimatedTotalTime: {
199
+ value: 0,
200
+ unit: 's'
201
+ },
202
+ isDescoped: false,
203
+ isResubmission: false,
204
+ mode: 'Standard',
205
+ name: 'Science Goal',
206
+ note: '',
207
+ performanceParameters: {
208
+ monitoringConstraints: [],
209
+ temporalParameters: [],
210
+ visitConstraints: [],
211
+ acceptableAngularResolution: {
212
+ value: 0,
213
+ unit: 'arcsec',
214
+ userUnit: 'arcsec'
215
+ },
216
+ desiredACASensitivity: {
217
+ value: 0,
218
+ unit: 'Jy',
219
+ userUnit: 'Jy'
220
+ },
221
+ desiredAngularResolution: {
222
+ value: 0,
223
+ unit: 'arcsec',
224
+ userUnit: 'arcsec'
225
+ },
226
+ desiredDynamicRange: 1.0,
227
+ desiredLargestScale: {
228
+ value: -1.0,
229
+ unit: 'arcsec'
230
+ },
231
+ desiredSDSensitivity: {
232
+ value: 0,
233
+ unit: 'Jy',
234
+ userUnit: 'Jy'
235
+ },
236
+ desiredSensitivity: {
237
+ value: 0,
238
+ unit: 'Jy',
239
+ userUnit: 'Jy'
240
+ },
241
+ desiredSensitivityFrequencyMeasure: 'RepresentativeWindowResolution',
242
+ desiredSensitivityReferenceFrequencyWidth: {
243
+ value: 0,
244
+ unit: 'GHz',
245
+ userUnit: 'MHz'
246
+ },
247
+ desiredTPSensitivity: {
248
+ value: 0,
249
+ unit: 'Jy',
250
+ userUnit: 'Jy'
251
+ },
252
+ desiredTime: {
253
+ value: 0,
254
+ unit: 'min'
255
+ },
256
+ isPointSource: false,
257
+ isScheduleConstrained: false,
258
+ isSimultaneous12And7: false,
259
+ isTimeConstrained: false,
260
+ needsMoreTime: false,
261
+ representativeFrequency: {
262
+ value: 0,
263
+ unit: 'GHz'
264
+ },
265
+ resolutionOption: 'Range',
266
+ timingConstraintsType: 'None',
267
+ useACA: false,
268
+ useTP: false
269
+ },
270
+ requiredReceiverBands: [],
271
+ expertParameters: [],
272
+ targetParameters: [buildTargetParameters([buildField()], -1)],
273
+ spectralSetupParameters: {
274
+ type: 'full',
275
+ representativeFrequency: {
276
+ value: 0,
277
+ unit: 'GHz'
278
+ },
279
+ userRepresentativeFrequency: false,
280
+ singleContinuumFrequency: {
281
+ value: 0,
282
+ unit: 'GHz'
283
+ },
284
+ advancedSpectralSetup: {
285
+ fastMode: false,
286
+ sideBandSeparation: false
287
+ },
288
+ polarisation: 'DOUBLE',
289
+ overlaidSpectralLines: [],
290
+ scienceSpectralWindowsAndSpectralScen: [],
291
+ singleContinuumCorrelatorMode: 'lowRes'
292
+ },
293
+ technicalJustifications: buildTechnicalJustifications(),
294
+ '@type': 'ScienceGoalT',
295
+ userPriority: 0
296
+ });
297
+
298
+ // TODO: define return type for buildScienceSpectralWindow
299
+ const buildScienceSpectralWindow = () => ({
300
+ groupIndex: 0,
301
+ isSkyFrequency: false,
302
+ splatalogId: 0,
303
+ representativeWindow: false,
304
+ groupResourceUse: 'FULL',
305
+ index: 0,
306
+ expectedSpectralLines: [],
307
+ advancedWindowSetup: {
308
+ smoothingFactor: 2,
309
+ imageCentreFrequency: {
310
+ value: 0,
311
+ unit: 'GHz'
312
+ },
313
+ oversampling: false,
314
+ addedSensitivity: false,
315
+ useImage: false,
316
+ useThis: true,
317
+ smoothingFunction: 'HANNING'
318
+ },
319
+ centerFrequency: {
320
+ value: 0,
321
+ unit: 'GHz'
322
+ },
323
+ bandWidth: {
324
+ value: 0,
325
+ unit: 'MHz',
326
+ userUnit: 'MHz'
327
+ },
328
+ effectiveBandWidth: {
329
+ value: 0,
330
+ unit: 'MHz',
331
+ userUnit: 'MHz'
332
+ },
333
+ spectralResolution: {
334
+ value: 0,
335
+ unit: 'MHz',
336
+ userUnit: 'GHz'
337
+ },
338
+ '@type': 'ScienceSpectralWindowT'
339
+ });
340
+ const buildScienceSpectralWindowForSolar = () => ({
341
+ representativeFrequency: {
342
+ value: 107,
343
+ unit: 'GHz'
344
+ },
345
+ userRepresentativeFrequency: false,
346
+ singleContinuumFrequency: {
347
+ value: 100,
348
+ unit: 'GHz'
349
+ },
350
+ scienceSpectralWindowsAndSpectralScen: [
351
+ {
352
+ groupIndex: 0,
353
+ isSkyFrequency: true,
354
+ splatalogId: 0,
355
+ representativeWindow: false,
356
+ groupResourceUse: 'FULL',
357
+ index: 0,
358
+ expectedSpectralLines: [],
359
+ advancedWindowSetup: {
360
+ useImage: false,
361
+ displayImage: false,
362
+ useThis: true,
363
+ smoothingFactor: 1,
364
+ smoothingFunction: 'HANNING',
365
+ addedSensitivity: false,
366
+ oversampling: false
367
+ },
368
+ centerFrequency: {
369
+ value: 93,
370
+ unit: 'GHz'
371
+ },
372
+ bandWidth: {
373
+ value: 2000,
374
+ unit: 'MHz',
375
+ userUnit: 'MHz'
376
+ },
377
+ effectiveBandWidth: {
378
+ value: 1.875,
379
+ unit: 'GHz',
380
+ userUnit: 'GHz'
381
+ },
382
+ spectralResolution: {
383
+ value: 15.625,
384
+ unit: 'MHz',
385
+ userUnit: 'MHz'
386
+ },
387
+ '@type': 'ScienceSpectralWindowT',
388
+ transitionName: 'Single Continuum',
389
+ windowDescription: '1875.000 MHz( 6044 km/s), 31.250 MHz(100.737 km/s) (2-bit)'
390
+ },
391
+ {
392
+ groupIndex: 1,
393
+ isSkyFrequency: true,
394
+ splatalogId: 0,
395
+ representativeWindow: false,
396
+ groupResourceUse: 'FULL',
397
+ index: 0,
398
+ expectedSpectralLines: [],
399
+ advancedWindowSetup: {
400
+ useImage: false,
401
+ displayImage: false,
402
+ useThis: true,
403
+ smoothingFactor: 1,
404
+ smoothingFunction: 'HANNING',
405
+ addedSensitivity: false,
406
+ oversampling: false
407
+ },
408
+ centerFrequency: {
409
+ value: 95,
410
+ unit: 'GHz'
411
+ },
412
+ bandWidth: {
413
+ value: 2000,
414
+ unit: 'MHz',
415
+ userUnit: 'MHz'
416
+ },
417
+ effectiveBandWidth: {
418
+ value: 1.875,
419
+ unit: 'GHz',
420
+ userUnit: 'GHz'
421
+ },
422
+ spectralResolution: {
423
+ value: 15.625,
424
+ unit: 'MHz',
425
+ userUnit: 'MHz'
426
+ },
427
+ '@type': 'ScienceSpectralWindowT',
428
+ transitionName: 'Single Continuum',
429
+ windowDescription: '1875.000 MHz( 5917 km/s), 31.250 MHz(98.616 km/s) (2-bit)'
430
+ },
431
+ {
432
+ groupIndex: 2,
433
+ isSkyFrequency: true,
434
+ splatalogId: 0,
435
+ representativeWindow: false,
436
+ groupResourceUse: 'FULL',
437
+ index: 0,
438
+ expectedSpectralLines: [],
439
+ advancedWindowSetup: {
440
+ useImage: false,
441
+ displayImage: false,
442
+ useThis: true,
443
+ smoothingFactor: 1,
444
+ smoothingFunction: 'HANNING',
445
+ addedSensitivity: false,
446
+ oversampling: false
447
+ },
448
+ centerFrequency: {
449
+ value: 105,
450
+ unit: 'GHz'
451
+ },
452
+ bandWidth: {
453
+ value: 2000,
454
+ unit: 'MHz',
455
+ userUnit: 'MHz'
456
+ },
457
+ effectiveBandWidth: {
458
+ value: 1.875,
459
+ unit: 'GHz',
460
+ userUnit: 'GHz'
461
+ },
462
+ spectralResolution: {
463
+ value: 15.625,
464
+ unit: 'MHz',
465
+ userUnit: 'MHz'
466
+ },
467
+ '@type': 'ScienceSpectralWindowT',
468
+ transitionName: 'Single Continuum',
469
+ windowDescription: '1875.000 MHz( 5353 km/s), 31.250 MHz(89.224 km/s) (2-bit)'
470
+ },
471
+ {
472
+ groupIndex: 3,
473
+ isSkyFrequency: true,
474
+ splatalogId: 0,
475
+ representativeWindow: true,
476
+ groupResourceUse: 'FULL',
477
+ index: 0,
478
+ expectedSpectralLines: [],
479
+ advancedWindowSetup: {
480
+ useImage: false,
481
+ displayImage: false,
482
+ useThis: true,
483
+ smoothingFactor: 1,
484
+ smoothingFunction: 'HANNING',
485
+ addedSensitivity: false,
486
+ oversampling: false
487
+ },
488
+ centerFrequency: {
489
+ value: 107,
490
+ unit: 'GHz'
491
+ },
492
+ bandWidth: {
493
+ value: 2000,
494
+ unit: 'MHz',
495
+ userUnit: 'MHz'
496
+ },
497
+ effectiveBandWidth: {
498
+ value: 1.875,
499
+ unit: 'GHz',
500
+ userUnit: 'GHz'
501
+ },
502
+ spectralResolution: {
503
+ value: 15.625,
504
+ unit: 'MHz',
505
+ userUnit: 'MHz'
506
+ },
507
+ '@type': 'ScienceSpectralWindowT',
508
+ transitionName: 'Single Continuum',
509
+ windowDescription: '1875.000 MHz( 5253 km/s), 31.250 MHz(87.556 km/s) (2-bit)'
510
+ }
511
+ ],
512
+ advancedSpectralSetup: {
513
+ sideBandSeparation: false,
514
+ fastMode: false
515
+ },
516
+ overlaidSpectralLines: [],
517
+ polarisation: 'DOUBLE',
518
+ type: 'continuum',
519
+ singleContinuumCorrelatorMode: 'lowRes'
520
+ });
521
+ const buildScienceSpectralWindowForVLBIOrPhasedArray = () => ({
522
+ representativeFrequency: {
523
+ value: 47.124,
524
+ unit: 'GHz'
525
+ },
526
+ userRepresentativeFrequency: false,
527
+ singleContinuumFrequency: {
528
+ value: 43.168,
529
+ unit: 'GHz'
530
+ },
531
+ scienceSpectralWindowsAndSpectralScen: [
532
+ {
533
+ groupIndex: 0,
534
+ isSkyFrequency: true,
535
+ splatalogId: 0,
536
+ representativeWindow: false,
537
+ groupResourceUse: 'FULL',
538
+ index: 0,
539
+ expectedSpectralLines: [],
540
+ advancedWindowSetup: {
541
+ useImage: false,
542
+ displayImage: false,
543
+ useThis: true,
544
+ smoothingFactor: 8,
545
+ smoothingFunction: 'HANNING',
546
+ addedSensitivity: false,
547
+ oversampling: false
548
+ },
549
+ centerFrequency: {
550
+ value: 43.168,
551
+ unit: 'GHz'
552
+ },
553
+ bandWidth: {
554
+ value: 2000,
555
+ unit: 'MHz',
556
+ userUnit: 'GHz'
557
+ },
558
+ effectiveBandWidth: {
559
+ value: 2.0,
560
+ unit: 'GHz',
561
+ userUnit: 'GHz'
562
+ },
563
+ spectralResolution: {
564
+ value: 0.9765625,
565
+ unit: 'MHz',
566
+ userUnit: 'GHz'
567
+ },
568
+ '@type': 'ScienceSpectralWindowT',
569
+ transitionName: 'Single Continuum',
570
+ windowDescription: ''
571
+ },
572
+ {
573
+ groupIndex: 1,
574
+ isSkyFrequency: true,
575
+ splatalogId: 0,
576
+ representativeWindow: false,
577
+ groupResourceUse: 'FULL',
578
+ index: 0,
579
+ expectedSpectralLines: [],
580
+ advancedWindowSetup: {
581
+ useImage: false,
582
+ displayImage: false,
583
+ useThis: true,
584
+ smoothingFactor: 8,
585
+ smoothingFunction: 'HANNING',
586
+ addedSensitivity: false,
587
+ oversampling: false
588
+ },
589
+ centerFrequency: {
590
+ value: 41.168,
591
+ unit: 'GHz'
592
+ },
593
+ bandWidth: {
594
+ value: 2000,
595
+ unit: 'MHz',
596
+ userUnit: 'GHz'
597
+ },
598
+ effectiveBandWidth: {
599
+ value: 2.0,
600
+ unit: 'GHz',
601
+ userUnit: 'GHz'
602
+ },
603
+ spectralResolution: {
604
+ value: 0.9765625,
605
+ unit: 'MHz',
606
+ userUnit: 'GHz'
607
+ },
608
+ '@type': 'ScienceSpectralWindowT',
609
+ transitionName: 'Single Continuum',
610
+ windowDescription: ''
611
+ },
612
+ {
613
+ groupIndex: 2,
614
+ isSkyFrequency: true,
615
+ splatalogId: 0,
616
+ representativeWindow: false,
617
+ groupResourceUse: 'FULL',
618
+ index: 0,
619
+ expectedSpectralLines: [],
620
+ advancedWindowSetup: {
621
+ useImage: false,
622
+ displayImage: false,
623
+ useThis: true,
624
+ smoothingFactor: 8,
625
+ smoothingFunction: 'HANNING',
626
+ addedSensitivity: false,
627
+ oversampling: false
628
+ },
629
+ centerFrequency: {
630
+ value: 45.168,
631
+ unit: 'GHz'
632
+ },
633
+ bandWidth: {
634
+ value: 2000,
635
+ unit: 'MHz',
636
+ userUnit: 'GHz'
637
+ },
638
+ effectiveBandWidth: {
639
+ value: 2.0,
640
+ unit: 'GHz',
641
+ userUnit: 'GHz'
642
+ },
643
+ spectralResolution: {
644
+ value: 0.9765625,
645
+ unit: 'MHz',
646
+ userUnit: 'GHz'
647
+ },
648
+ '@type': 'ScienceSpectralWindowT',
649
+ transitionName: 'Single Continuum',
650
+ windowDescription: ''
651
+ },
652
+ {
653
+ groupIndex: 3,
654
+ isSkyFrequency: true,
655
+ splatalogId: 0,
656
+ representativeWindow: true,
657
+ groupResourceUse: 'FULL',
658
+ index: 0,
659
+ expectedSpectralLines: [],
660
+ advancedWindowSetup: {
661
+ useImage: false,
662
+ displayImage: false,
663
+ useThis: true,
664
+ smoothingFactor: 8,
665
+ smoothingFunction: 'HANNING',
666
+ addedSensitivity: false,
667
+ oversampling: false
668
+ },
669
+ centerFrequency: {
670
+ value: 47.124,
671
+ unit: 'GHz'
672
+ },
673
+ bandWidth: {
674
+ value: 2000,
675
+ unit: 'MHz',
676
+ userUnit: 'GHz'
677
+ },
678
+ effectiveBandWidth: {
679
+ value: 2.0,
680
+ unit: 'GHz',
681
+ userUnit: 'GHz'
682
+ },
683
+ spectralResolution: {
684
+ value: 0.9765625,
685
+ unit: 'MHz',
686
+ userUnit: 'GHz'
687
+ },
688
+ '@type': 'ScienceSpectralWindowT',
689
+ transitionName: 'Single Continuum',
690
+ windowDescription: ''
691
+ }
692
+ ],
693
+ advancedSpectralSetup: {
694
+ sideBandSeparation: false,
695
+ fastMode: false
696
+ },
697
+ overlaidSpectralLines: [],
698
+ polarisation: 'FULL',
699
+ type: 'continuum',
700
+ singleContinuumCorrelatorMode: 'highRes'
701
+ });
702
+ const buildScienceSpectralWindowForDefaultVLBIBand = (band) => bandMapToBand[Number(band)];
703
+ const band7 = {
704
+ representativeFrequency: {
705
+ value: 335.6,
706
+ unit: 'GHz'
707
+ },
708
+ userRepresentativeFrequency: false,
709
+ singleContinuumFrequency: {
710
+ value: 93.268,
711
+ unit: 'GHz'
712
+ },
713
+ scienceSpectralWindowsAndSpectralScen: [
714
+ {
715
+ groupIndex: 0,
716
+ isSkyFrequency: true,
717
+ splatalogId: 0,
718
+ representativeWindow: true,
719
+ groupResourceUse: 'FULL',
720
+ index: 0,
721
+ expectedSpectralLines: [],
722
+ advancedWindowSetup: {
723
+ useImage: false,
724
+ displayImage: false,
725
+ useThis: true,
726
+ smoothingFactor: 1,
727
+ smoothingFunction: 'HANNING',
728
+ addedSensitivity: false,
729
+ oversampling: false
730
+ },
731
+ centerFrequency: {
732
+ value: 335.6,
733
+ unit: 'GHz'
734
+ },
735
+ bandWidth: {
736
+ value: 2000.0,
737
+ unit: 'MHz',
738
+ userUnit: 'GHz'
739
+ },
740
+ effectiveBandWidth: {
741
+ value: 2.0,
742
+ unit: 'GHz',
743
+ userUnit: 'GHz'
744
+ },
745
+ spectralResolution: {
746
+ value: 0.9765625,
747
+ unit: 'MHz',
748
+ userUnit: 'GHz'
749
+ },
750
+ '@type': 'ScienceSpectralWindowT',
751
+ transitionName: 'Continuum',
752
+ windowDescription: ''
753
+ },
754
+ {
755
+ groupIndex: 1,
756
+ isSkyFrequency: true,
757
+ splatalogId: 0,
758
+ representativeWindow: false,
759
+ groupResourceUse: 'FULL',
760
+ index: 0,
761
+ expectedSpectralLines: [],
762
+ advancedWindowSetup: {
763
+ useImage: false,
764
+ displayImage: false,
765
+ useThis: true,
766
+ smoothingFactor: 1,
767
+ smoothingFunction: 'HANNING',
768
+ addedSensitivity: false,
769
+ oversampling: false
770
+ },
771
+ centerFrequency: {
772
+ value: 337.6,
773
+ unit: 'GHz'
774
+ },
775
+ bandWidth: {
776
+ value: 2000.0,
777
+ unit: 'MHz',
778
+ userUnit: 'GHz'
779
+ },
780
+ effectiveBandWidth: {
781
+ value: 2.0,
782
+ unit: 'GHz',
783
+ userUnit: 'GHz'
784
+ },
785
+ spectralResolution: {
786
+ value: 0.9765625,
787
+ unit: 'MHz',
788
+ userUnit: 'GHz'
789
+ },
790
+ '@type': 'ScienceSpectralWindowT',
791
+ transitionName: 'Continuum',
792
+ windowDescription: ''
793
+ },
794
+ {
795
+ groupIndex: 2,
796
+ isSkyFrequency: true,
797
+ splatalogId: 0,
798
+ representativeWindow: false,
799
+ groupResourceUse: 'FULL',
800
+ index: 0,
801
+ expectedSpectralLines: [],
802
+ advancedWindowSetup: {
803
+ useImage: false,
804
+ displayImage: false,
805
+ useThis: true,
806
+ smoothingFactor: 1,
807
+ smoothingFunction: 'HANNING',
808
+ addedSensitivity: false,
809
+ oversampling: false
810
+ },
811
+ centerFrequency: {
812
+ value: 347.6,
813
+ unit: 'GHz'
814
+ },
815
+ bandWidth: {
816
+ value: 2000.0,
817
+ unit: 'MHz',
818
+ userUnit: 'GHz'
819
+ },
820
+ effectiveBandWidth: {
821
+ value: 2.0,
822
+ unit: 'GHz',
823
+ userUnit: 'GHz'
824
+ },
825
+ spectralResolution: {
826
+ value: 0.9765625,
827
+ unit: 'MHz',
828
+ userUnit: 'GHz'
829
+ },
830
+ '@type': 'ScienceSpectralWindowT',
831
+ transitionName: 'Continuum',
832
+ windowDescription: ''
833
+ },
834
+ {
835
+ groupIndex: 3,
836
+ isSkyFrequency: true,
837
+ splatalogId: 0,
838
+ representativeWindow: false,
839
+ groupResourceUse: 'FULL',
840
+ index: 0,
841
+ expectedSpectralLines: [],
842
+ advancedWindowSetup: {
843
+ useImage: false,
844
+ displayImage: false,
845
+ useThis: true,
846
+ smoothingFactor: 1,
847
+ smoothingFunction: 'HANNING',
848
+ addedSensitivity: false,
849
+ oversampling: false
850
+ },
851
+ centerFrequency: {
852
+ value: 349.6,
853
+ unit: 'GHz'
854
+ },
855
+ bandWidth: {
856
+ value: 2000.0,
857
+ unit: 'MHz',
858
+ userUnit: 'GHz'
859
+ },
860
+ effectiveBandWidth: {
861
+ value: 2.0,
862
+ unit: 'GHz',
863
+ userUnit: 'GHz'
864
+ },
865
+ spectralResolution: {
866
+ value: 0.9765625,
867
+ unit: 'MHz',
868
+ userUnit: 'GHz'
869
+ },
870
+ '@type': 'ScienceSpectralWindowT',
871
+ transitionName: 'Continuum',
872
+ windowDescription: ''
873
+ }
874
+ ],
875
+ advancedSpectralSetup: {
876
+ sideBandSeparation: false,
877
+ fastMode: false
878
+ },
879
+ overlaidSpectralLines: [],
880
+ polarisation: 'FULL',
881
+ type: 'full',
882
+ singleContinuumCorrelatorMode: 'highRes'
883
+ };
884
+ const band6 = {
885
+ representativeFrequency: {
886
+ value: 213.1,
887
+ unit: 'GHz'
888
+ },
889
+ userRepresentativeFrequency: false,
890
+ singleContinuumFrequency: {
891
+ value: 93.268,
892
+ unit: 'GHz'
893
+ },
894
+ scienceSpectralWindowsAndSpectralScen: [
895
+ {
896
+ groupIndex: 0,
897
+ isSkyFrequency: true,
898
+ splatalogId: 0,
899
+ representativeWindow: true,
900
+ groupResourceUse: 'FULL',
901
+ index: 0,
902
+ expectedSpectralLines: [],
903
+ advancedWindowSetup: {
904
+ useImage: false,
905
+ displayImage: false,
906
+ useThis: true,
907
+ smoothingFactor: 1,
908
+ smoothingFunction: 'HANNING',
909
+ addedSensitivity: false,
910
+ oversampling: false
911
+ },
912
+ centerFrequency: {
913
+ value: 213.1,
914
+ unit: 'GHz'
915
+ },
916
+ bandWidth: {
917
+ value: 2000.0,
918
+ unit: 'MHz',
919
+ userUnit: 'GHz'
920
+ },
921
+ effectiveBandWidth: {
922
+ value: 2.0,
923
+ unit: 'GHz',
924
+ userUnit: 'GHz'
925
+ },
926
+ spectralResolution: {
927
+ value: 0.9765625,
928
+ unit: 'MHz',
929
+ userUnit: 'GHz'
930
+ },
931
+ '@type': 'ScienceSpectralWindowT',
932
+ transitionName: 'Continuum',
933
+ windowDescription: ''
934
+ },
935
+ {
936
+ groupIndex: 1,
937
+ isSkyFrequency: true,
938
+ splatalogId: 0,
939
+ representativeWindow: false,
940
+ groupResourceUse: 'FULL',
941
+ index: 0,
942
+ expectedSpectralLines: [],
943
+ advancedWindowSetup: {
944
+ useImage: false,
945
+ displayImage: false,
946
+ useThis: true,
947
+ smoothingFactor: 1,
948
+ smoothingFunction: 'HANNING',
949
+ addedSensitivity: false,
950
+ oversampling: false
951
+ },
952
+ centerFrequency: {
953
+ value: 215.1,
954
+ unit: 'GHz'
955
+ },
956
+ bandWidth: {
957
+ value: 2000.0,
958
+ unit: 'MHz',
959
+ userUnit: 'GHz'
960
+ },
961
+ effectiveBandWidth: {
962
+ value: 2.0,
963
+ unit: 'GHz',
964
+ userUnit: 'GHz'
965
+ },
966
+ spectralResolution: {
967
+ value: 0.9765625,
968
+ unit: 'MHz',
969
+ userUnit: 'GHz'
970
+ },
971
+ '@type': 'ScienceSpectralWindowT',
972
+ transitionName: 'Continuum',
973
+ windowDescription: ''
974
+ },
975
+ {
976
+ groupIndex: 2,
977
+ isSkyFrequency: true,
978
+ splatalogId: 0,
979
+ representativeWindow: false,
980
+ groupResourceUse: 'FULL',
981
+ index: 0,
982
+ expectedSpectralLines: [],
983
+ advancedWindowSetup: {
984
+ useImage: false,
985
+ displayImage: false,
986
+ useThis: true,
987
+ smoothingFactor: 1,
988
+ smoothingFunction: 'HANNING',
989
+ addedSensitivity: false,
990
+ oversampling: false
991
+ },
992
+ centerFrequency: {
993
+ value: 227.1,
994
+ unit: 'GHz'
995
+ },
996
+ bandWidth: {
997
+ value: 2000.0,
998
+ unit: 'MHz',
999
+ userUnit: 'GHz'
1000
+ },
1001
+ effectiveBandWidth: {
1002
+ value: 2.0,
1003
+ unit: 'GHz',
1004
+ userUnit: 'GHz'
1005
+ },
1006
+ spectralResolution: {
1007
+ value: 0.9765625,
1008
+ unit: 'MHz',
1009
+ userUnit: 'GHz'
1010
+ },
1011
+ '@type': 'ScienceSpectralWindowT',
1012
+ transitionName: 'Continuum',
1013
+ windowDescription: ''
1014
+ },
1015
+ {
1016
+ groupIndex: 3,
1017
+ isSkyFrequency: true,
1018
+ splatalogId: 0,
1019
+ representativeWindow: false,
1020
+ groupResourceUse: 'FULL',
1021
+ index: 0,
1022
+ expectedSpectralLines: [],
1023
+ advancedWindowSetup: {
1024
+ useImage: false,
1025
+ displayImage: false,
1026
+ useThis: true,
1027
+ smoothingFactor: 1,
1028
+ smoothingFunction: 'HANNING',
1029
+ addedSensitivity: false,
1030
+ oversampling: false
1031
+ },
1032
+ centerFrequency: {
1033
+ value: 229.1,
1034
+ unit: 'GHz'
1035
+ },
1036
+ bandWidth: {
1037
+ value: 2000.0,
1038
+ unit: 'MHz',
1039
+ userUnit: 'GHz'
1040
+ },
1041
+ effectiveBandWidth: {
1042
+ value: 2.0,
1043
+ unit: 'GHz',
1044
+ userUnit: 'GHz'
1045
+ },
1046
+ spectralResolution: {
1047
+ value: 0.9765625,
1048
+ unit: 'MHz',
1049
+ userUnit: 'GHz'
1050
+ },
1051
+ '@type': 'ScienceSpectralWindowT',
1052
+ transitionName: 'Continuum',
1053
+ windowDescription: ''
1054
+ }
1055
+ ],
1056
+ advancedSpectralSetup: {
1057
+ sideBandSeparation: false,
1058
+ fastMode: false
1059
+ },
1060
+ overlaidSpectralLines: [],
1061
+ polarisation: 'FULL',
1062
+ type: 'full',
1063
+ singleContinuumCorrelatorMode: 'highRes'
1064
+ };
1065
+ const band3 = {
1066
+ representativeFrequency: {
1067
+ value: 86.268,
1068
+ unit: 'GHz'
1069
+ },
1070
+ userRepresentativeFrequency: false,
1071
+ singleContinuumFrequency: {
1072
+ value: 93.268,
1073
+ unit: 'GHz'
1074
+ },
1075
+ scienceSpectralWindowsAndSpectralScen: [
1076
+ {
1077
+ groupIndex: 0,
1078
+ isSkyFrequency: true,
1079
+ splatalogId: 0,
1080
+ representativeWindow: true,
1081
+ groupResourceUse: 'FULL',
1082
+ index: 0,
1083
+ expectedSpectralLines: [],
1084
+ advancedWindowSetup: {
1085
+ useImage: false,
1086
+ displayImage: false,
1087
+ useThis: true,
1088
+ smoothingFactor: 1,
1089
+ smoothingFunction: 'HANNING',
1090
+ addedSensitivity: false,
1091
+ oversampling: false
1092
+ },
1093
+ centerFrequency: {
1094
+ value: 86.268,
1095
+ unit: 'GHz'
1096
+ },
1097
+ bandWidth: {
1098
+ value: 2000.0,
1099
+ unit: 'MHz',
1100
+ userUnit: 'GHz'
1101
+ },
1102
+ effectiveBandWidth: {
1103
+ value: 2.0,
1104
+ unit: 'GHz',
1105
+ userUnit: 'GHz'
1106
+ },
1107
+ spectralResolution: {
1108
+ value: 0.9765625,
1109
+ unit: 'MHz',
1110
+ userUnit: 'GHz'
1111
+ },
1112
+ '@type': 'ScienceSpectralWindowT',
1113
+ transitionName: 'Continuum',
1114
+ windowDescription: ''
1115
+ },
1116
+ {
1117
+ groupIndex: 1,
1118
+ isSkyFrequency: true,
1119
+ splatalogId: 0,
1120
+ representativeWindow: false,
1121
+ groupResourceUse: 'FULL',
1122
+ index: 0,
1123
+ expectedSpectralLines: [],
1124
+ advancedWindowSetup: {
1125
+ useImage: false,
1126
+ displayImage: false,
1127
+ useThis: true,
1128
+ smoothingFactor: 1,
1129
+ smoothingFunction: 'HANNING',
1130
+ addedSensitivity: false,
1131
+ oversampling: false
1132
+ },
1133
+ centerFrequency: {
1134
+ value: 88.268,
1135
+ unit: 'GHz'
1136
+ },
1137
+ bandWidth: {
1138
+ value: 2000.0,
1139
+ unit: 'MHz',
1140
+ userUnit: 'GHz'
1141
+ },
1142
+ effectiveBandWidth: {
1143
+ value: 2.0,
1144
+ unit: 'GHz',
1145
+ userUnit: 'GHz'
1146
+ },
1147
+ spectralResolution: {
1148
+ value: 0.9765625,
1149
+ unit: 'MHz',
1150
+ userUnit: 'GHz'
1151
+ },
1152
+ '@type': 'ScienceSpectralWindowT',
1153
+ transitionName: 'Continuum',
1154
+ windowDescription: ''
1155
+ },
1156
+ {
1157
+ groupIndex: 2,
1158
+ isSkyFrequency: true,
1159
+ splatalogId: 0,
1160
+ representativeWindow: false,
1161
+ groupResourceUse: 'FULL',
1162
+ index: 0,
1163
+ expectedSpectralLines: [],
1164
+ advancedWindowSetup: {
1165
+ useImage: false,
1166
+ displayImage: false,
1167
+ useThis: true,
1168
+ smoothingFactor: 1,
1169
+ smoothingFunction: 'HANNING',
1170
+ addedSensitivity: false,
1171
+ oversampling: false
1172
+ },
1173
+ centerFrequency: {
1174
+ value: 98.268,
1175
+ unit: 'GHz'
1176
+ },
1177
+ bandWidth: {
1178
+ value: 2000.0,
1179
+ unit: 'MHz',
1180
+ userUnit: 'GHz'
1181
+ },
1182
+ effectiveBandWidth: {
1183
+ value: 2.0,
1184
+ unit: 'GHz',
1185
+ userUnit: 'GHz'
1186
+ },
1187
+ spectralResolution: {
1188
+ value: 0.9765625,
1189
+ unit: 'MHz',
1190
+ userUnit: 'GHz'
1191
+ },
1192
+ '@type': 'ScienceSpectralWindowT',
1193
+ transitionName: 'Continuum',
1194
+ windowDescription: ''
1195
+ },
1196
+ {
1197
+ groupIndex: 3,
1198
+ isSkyFrequency: true,
1199
+ splatalogId: 0,
1200
+ representativeWindow: false,
1201
+ groupResourceUse: 'FULL',
1202
+ index: 0,
1203
+ expectedSpectralLines: [],
1204
+ advancedWindowSetup: {
1205
+ useImage: false,
1206
+ displayImage: false,
1207
+ useThis: true,
1208
+ smoothingFactor: 1,
1209
+ smoothingFunction: 'HANNING',
1210
+ addedSensitivity: false,
1211
+ oversampling: false
1212
+ },
1213
+ centerFrequency: {
1214
+ value: 100.268,
1215
+ unit: 'GHz'
1216
+ },
1217
+ bandWidth: {
1218
+ value: 2000.0,
1219
+ unit: 'MHz',
1220
+ userUnit: 'GHz'
1221
+ },
1222
+ effectiveBandWidth: {
1223
+ value: 2.0,
1224
+ unit: 'GHz',
1225
+ userUnit: 'GHz'
1226
+ },
1227
+ spectralResolution: {
1228
+ value: 0.9765625,
1229
+ unit: 'MHz',
1230
+ userUnit: 'GHz'
1231
+ },
1232
+ '@type': 'ScienceSpectralWindowT',
1233
+ transitionName: 'Continuum',
1234
+ windowDescription: ''
1235
+ }
1236
+ ],
1237
+ advancedSpectralSetup: {
1238
+ sideBandSeparation: false,
1239
+ fastMode: false
1240
+ },
1241
+ overlaidSpectralLines: [],
1242
+ polarisation: 'FULL',
1243
+ type: 'full',
1244
+ singleContinuumCorrelatorMode: 'highRes'
1245
+ };
1246
+ const band1 = {
1247
+ representativeFrequency: {
1248
+ value: 43.168,
1249
+ unit: 'GHz'
1250
+ },
1251
+ userRepresentativeFrequency: false,
1252
+ singleContinuumFrequency: {
1253
+ value: 93.268,
1254
+ unit: 'GHz'
1255
+ },
1256
+ scienceSpectralWindowsAndSpectralScen: [
1257
+ {
1258
+ groupIndex: 0,
1259
+ isSkyFrequency: true,
1260
+ splatalogId: 0,
1261
+ representativeWindow: true,
1262
+ groupResourceUse: 'FULL',
1263
+ index: 0,
1264
+ expectedSpectralLines: [],
1265
+ advancedWindowSetup: {
1266
+ useImage: false,
1267
+ displayImage: false,
1268
+ useThis: true,
1269
+ smoothingFactor: 1,
1270
+ smoothingFunction: 'HANNING',
1271
+ addedSensitivity: false,
1272
+ oversampling: false
1273
+ },
1274
+ centerFrequency: {
1275
+ value: 43.168,
1276
+ unit: 'GHz'
1277
+ },
1278
+ bandWidth: {
1279
+ value: 2000.0,
1280
+ unit: 'MHz',
1281
+ userUnit: 'GHz'
1282
+ },
1283
+ effectiveBandWidth: {
1284
+ value: 2.0,
1285
+ unit: 'GHz',
1286
+ userUnit: 'GHz'
1287
+ },
1288
+ spectralResolution: {
1289
+ value: 0.9765625,
1290
+ unit: 'MHz',
1291
+ userUnit: 'GHz'
1292
+ },
1293
+ '@type': 'ScienceSpectralWindowT',
1294
+ transitionName: 'Continuum',
1295
+ windowDescription: ''
1296
+ },
1297
+ {
1298
+ groupIndex: 1,
1299
+ isSkyFrequency: true,
1300
+ splatalogId: 0,
1301
+ representativeWindow: false,
1302
+ groupResourceUse: 'FULL',
1303
+ index: 0,
1304
+ expectedSpectralLines: [],
1305
+ advancedWindowSetup: {
1306
+ useImage: false,
1307
+ displayImage: false,
1308
+ useThis: true,
1309
+ smoothingFactor: 1,
1310
+ smoothingFunction: 'HANNING',
1311
+ addedSensitivity: false,
1312
+ oversampling: false
1313
+ },
1314
+ centerFrequency: {
1315
+ value: 41.168,
1316
+ unit: 'GHz'
1317
+ },
1318
+ bandWidth: {
1319
+ value: 2000.0,
1320
+ unit: 'MHz',
1321
+ userUnit: 'GHz'
1322
+ },
1323
+ effectiveBandWidth: {
1324
+ value: 2.0,
1325
+ unit: 'GHz',
1326
+ userUnit: 'GHz'
1327
+ },
1328
+ spectralResolution: {
1329
+ value: 0.9765625,
1330
+ unit: 'MHz',
1331
+ userUnit: 'GHz'
1332
+ },
1333
+ '@type': 'ScienceSpectralWindowT',
1334
+ transitionName: 'Continuum',
1335
+ windowDescription: ''
1336
+ },
1337
+ {
1338
+ groupIndex: 2,
1339
+ isSkyFrequency: true,
1340
+ splatalogId: 0,
1341
+ representativeWindow: false,
1342
+ groupResourceUse: 'FULL',
1343
+ index: 0,
1344
+ expectedSpectralLines: [],
1345
+ advancedWindowSetup: {
1346
+ useImage: false,
1347
+ displayImage: false,
1348
+ useThis: true,
1349
+ smoothingFactor: 1,
1350
+ smoothingFunction: 'HANNING',
1351
+ addedSensitivity: false,
1352
+ oversampling: false
1353
+ },
1354
+ centerFrequency: {
1355
+ value: 45.168,
1356
+ unit: 'GHz'
1357
+ },
1358
+ bandWidth: {
1359
+ value: 2000.0,
1360
+ unit: 'MHz',
1361
+ userUnit: 'GHz'
1362
+ },
1363
+ effectiveBandWidth: {
1364
+ value: 2.0,
1365
+ unit: 'GHz',
1366
+ userUnit: 'GHz'
1367
+ },
1368
+ spectralResolution: {
1369
+ value: 0.9765625,
1370
+ unit: 'MHz',
1371
+ userUnit: 'GHz'
1372
+ },
1373
+ '@type': 'ScienceSpectralWindowT',
1374
+ transitionName: 'Continuum',
1375
+ windowDescription: ''
1376
+ },
1377
+ {
1378
+ groupIndex: 3,
1379
+ isSkyFrequency: true,
1380
+ splatalogId: 0,
1381
+ representativeWindow: false,
1382
+ groupResourceUse: 'FULL',
1383
+ index: 0,
1384
+ expectedSpectralLines: [],
1385
+ advancedWindowSetup: {
1386
+ useImage: false,
1387
+ displayImage: false,
1388
+ useThis: true,
1389
+ smoothingFactor: 1,
1390
+ smoothingFunction: 'HANNING',
1391
+ addedSensitivity: false,
1392
+ oversampling: false
1393
+ },
1394
+ centerFrequency: {
1395
+ value: 47.124,
1396
+ unit: 'GHz'
1397
+ },
1398
+ bandWidth: {
1399
+ value: 2000.0,
1400
+ unit: 'MHz',
1401
+ userUnit: 'GHz'
1402
+ },
1403
+ effectiveBandWidth: {
1404
+ value: 2.0,
1405
+ unit: 'GHz',
1406
+ userUnit: 'GHz'
1407
+ },
1408
+ spectralResolution: {
1409
+ value: 0.9765625,
1410
+ unit: 'MHz',
1411
+ userUnit: 'GHz'
1412
+ },
1413
+ '@type': 'ScienceSpectralWindowT',
1414
+ transitionName: 'Continuum',
1415
+ windowDescription: ''
1416
+ }
1417
+ ],
1418
+ advancedSpectralSetup: {
1419
+ sideBandSeparation: false,
1420
+ fastMode: false
1421
+ },
1422
+ overlaidSpectralLines: [],
1423
+ polarisation: 'FULL',
1424
+ type: 'full',
1425
+ singleContinuumCorrelatorMode: 'highRes'
1426
+ };
1427
+ const bandMapToBand = {
1428
+ 1: band1,
1429
+ 3: band3,
1430
+ 6: band6,
1431
+ 7: band7
1432
+ };
1433
+
1434
+ // TODO: define return type for buildSpectralScanScienceSpectralWindow
1435
+ const buildSpectralScanScienceSpectralWindow = () => ({
1436
+ startFrequency: {
1437
+ value: 0,
1438
+ unit: 'GHz'
1439
+ },
1440
+ endFrequency: {
1441
+ value: 0,
1442
+ unit: 'GHz'
1443
+ },
1444
+ bandWidth: {
1445
+ value: 2,
1446
+ unit: 'GHz',
1447
+ userUnit: 'GHz'
1448
+ },
1449
+ effectiveBandwidth: {
1450
+ value: 1.875,
1451
+ unit: 'GHz',
1452
+ userUnit: 'GHz'
1453
+ },
1454
+ spectralResolution: {
1455
+ value: 0.015625,
1456
+ unit: 'GHz'
1457
+ },
1458
+ isSkyFrequency: false,
1459
+ '@type': 'SpectralScanT',
1460
+ index: 0,
1461
+ advancedWindowSetup: {
1462
+ smoothingFactor: 1,
1463
+ oversampling: false,
1464
+ addedSensitivity: false,
1465
+ useImage: false,
1466
+ useThis: true,
1467
+ smoothingFunction: 'HANNING'
1468
+ },
1469
+ expectedSpectralLines: []
1470
+ });
1471
+
1472
+ const buildSpectralSetupParameters = () => ({
1473
+ representativeFrequency: { value: 0.0, unit: 'GHz' },
1474
+ userRepresentativeFrequency: false,
1475
+ singleContinuumFrequency: { value: 0.0, unit: 'GHz' },
1476
+ scienceSpectralWindowsAndSpectralScen: [],
1477
+ advancedSpectralSetup: {
1478
+ sideBandSeparation: false,
1479
+ fastMode: false
1480
+ },
1481
+ overlaidSpectralLines: [],
1482
+ polarisation: 'DOUBLE',
1483
+ type: 'full',
1484
+ singleContinuumCorrelatorMode: 'lowRes'
1485
+ });
1486
+
1487
+ const buildTemporalParameters = () => {
1488
+ const { startTime, endTime } = generateDates();
1489
+ return {
1490
+ startTime,
1491
+ endTime,
1492
+ allowedMargin: { value: 7.0, unit: 'd' },
1493
+ repeats: 0,
1494
+ note: '',
1495
+ isAvoidConstraint: false,
1496
+ priority: 0,
1497
+ isFixedStart: false,
1498
+ lstmin: '',
1499
+ lstmax: ''
1500
+ };
1501
+ };
1502
+ const generateDates = (startDate = new Date()) => {
1503
+ const toISO = (date) => date.toISOString();
1504
+ const start = new Date(startDate);
1505
+ start.setDate(start.getDate() + 1); // tomorrow
1506
+ const end = new Date(startDate);
1507
+ end.setDate(end.getDate() + 15); // 15 days from today
1508
+ return {
1509
+ startTime: toISO(start),
1510
+ endTime: toISO(end)
1511
+ };
1512
+ };
1513
+
1514
+ const buildVisitConstraint = (visitId) => {
1515
+ const requiredDelayValue = 14 * visitId - 14;
1516
+ const allowMarginValue = visitId === 1 ? 0 : 7;
1517
+ const previousVisitId = visitId === 1 ? 0 : 1;
1518
+ return {
1519
+ allowedMargin: { value: allowMarginValue, unit: 'd' },
1520
+ isAvoidConstraint: false,
1521
+ priority: 0,
1522
+ isFixedStart: false,
1523
+ visitId,
1524
+ previousVisitId,
1525
+ requiredDelay: { value: requiredDelayValue, unit: 'd' }
1526
+ };
1527
+ };
1528
+
1529
+ var ApplicationStatus;
1530
+ (function (ApplicationStatus) {
1531
+ ApplicationStatus["CREATE_PROJECT"] = "createProject";
1532
+ ApplicationStatus["CREATE_PROJECT_SUCCESS"] = "createProjectSuccess";
1533
+ ApplicationStatus["CREATE_PROJECT_FAILURE"] = "createProjectFailure";
1534
+ ApplicationStatus["CREATE_DDT_PROJECT"] = "createDDTProject";
1535
+ ApplicationStatus["CREATE_DDT_PROJECT_SUCCESS"] = "createDDTProjectSuccess";
1536
+ ApplicationStatus["CREATE_DDT_PROJECT_FAILURE"] = "createDDTProjectFailure";
1537
+ ApplicationStatus["CLONE_PROJECT"] = "cloneProject";
1538
+ ApplicationStatus["CLONE_PROJECT_SUCCESS"] = "cloneProjectSuccess";
1539
+ ApplicationStatus["CLONE_PROJECT_FAILURE"] = "cloneProjectFailure";
1540
+ ApplicationStatus["LOAD_PROJECT"] = "loadProject";
1541
+ ApplicationStatus["LOAD_PROJECT_SUCCESS"] = "loadProjectSuccess";
1542
+ ApplicationStatus["LOAD_PROJECT_FAILURE"] = "loadProjectFailure";
1543
+ ApplicationStatus["LOAD_PROJECT_FILE"] = "loadProjectFile";
1544
+ ApplicationStatus["LOAD_PROJECT_FILE_SUCCESS"] = "loadProjectFileSuccess";
1545
+ ApplicationStatus["LOAD_PROJECT_FILE_FAILURE"] = "loadProjectFileFailure";
1546
+ ApplicationStatus["SAVE_PROJECT_TO_DISK"] = "saveProjectToDisk";
1547
+ ApplicationStatus["SAVE_PROJECT_TO_DISK_SUCCESS"] = "saveProjectToDiskSuccess";
1548
+ ApplicationStatus["SAVE_PROJECT_TO_DISK_FAILURE"] = "saveProjectToDiskFailure";
1549
+ ApplicationStatus["REVERT_TO_LAST_SUBMITTED"] = "revertToLastSubmitted";
1550
+ ApplicationStatus["REVERT_TO_LAST_SUBMITTED_SUCCESS"] = "revertToLastSubmittedSuccess";
1551
+ ApplicationStatus["REVERT_TO_LAST_SUBMITTED_FAILURE"] = "revertToLastSubmittedFailure";
1552
+ ApplicationStatus["RELOAD_PROJECT_FAILURE"] = "reloadProjectFailure";
1553
+ })(ApplicationStatus || (ApplicationStatus = {}));
1554
+
1555
+ var AuthenticationStatus;
1556
+ (function (AuthenticationStatus) {
1557
+ AuthenticationStatus["LOGIN_SUCCESS"] = "loginSuccess";
1558
+ AuthenticationStatus["LOGIN_FAILURE"] = "loginFailure";
1559
+ })(AuthenticationStatus || (AuthenticationStatus = {}));
1560
+
1561
+ var ListItemStatus;
1562
+ (function (ListItemStatus) {
1563
+ ListItemStatus["LOAD_LIST_ITEM"] = "loadListItem";
1564
+ ListItemStatus["LOAD_LIST_ITEM_SUCCESS"] = "loadListItemSuccess";
1565
+ ListItemStatus["LOAD_LIST_ITEM_FAILURE"] = "loadListItemFailure";
1566
+ })(ListItemStatus || (ListItemStatus = {}));
1567
+
1568
+ var ProjectStatus;
1569
+ (function (ProjectStatus) {
1570
+ ProjectStatus["LOAD_PROJECT"] = "loadProject";
1571
+ ProjectStatus["LOAD_PROJECT_SUCCESS"] = "loadProjectSuccess";
1572
+ ProjectStatus["LOAD_PROJECT_FAILURE"] = "loadProjectFailure";
1573
+ ProjectStatus["SAVE_PROJECT"] = "saveProject";
1574
+ ProjectStatus["SAVE_PROJECT_SUCCESS"] = "saveProjectSuccess";
1575
+ ProjectStatus["SAVE_PROJECT_FAILURE"] = "saveProjectFailure";
1576
+ })(ProjectStatus || (ProjectStatus = {}));
1577
+
1578
+ var ProjectTypeCode;
1579
+ (function (ProjectTypeCode) {
1580
+ ProjectTypeCode["REGULAR"] = "S";
1581
+ ProjectTypeCode["TARGET_OF_OPPORTUNITY"] = "T";
1582
+ ProjectTypeCode["VLBI"] = "V";
1583
+ ProjectTypeCode["LARGE_PROGRAM"] = "L";
1584
+ ProjectTypeCode["PHASED_ARRAY_MODE"] = "P";
1585
+ })(ProjectTypeCode || (ProjectTypeCode = {}));
1586
+
1587
+ var ProposalStatus;
1588
+ (function (ProposalStatus) {
1589
+ ProposalStatus["LOAD_PROPOSAL"] = "loadProposal";
1590
+ ProposalStatus["LOAD_PROPOSAL_SUCCESS"] = "loadProposalSuccess";
1591
+ ProposalStatus["LOAD_PROPOSAL_FAILURE"] = "loadProposalFailure";
1592
+ ProposalStatus["SAVE_PROPOSAL"] = "saveProposal";
1593
+ ProposalStatus["SAVE_PROPOSAL_SUCCESS"] = "saveProposalSuccess";
1594
+ ProposalStatus["SAVE_PROPOSAL_FAILURE"] = "saveProposalFailure";
1595
+ ProposalStatus["IMPORT_INVESTIGATORS"] = "importInvestigators";
1596
+ ProposalStatus["IMPORT_INVESTIGATORS_SUCCESS"] = "importInvestigatorsSuccess";
1597
+ ProposalStatus["IMPORT_INVESTIGATORS_FAILURE"] = "importInvestigatorsFailure";
1598
+ ProposalStatus["GENERATE_PROPOSAL_SUMMARY"] = "generateProposalSummary";
1599
+ ProposalStatus["GENERATE_PROPOSAL_SUMMARY_SUCCESS"] = "generateProposalSummarySuccess";
1600
+ ProposalStatus["GENERATE_PROPOSAL_SUMMARY_FAILURE"] = "generateProposalSummaryFailure";
1601
+ })(ProposalStatus || (ProposalStatus = {}));
1602
+
1603
+ var AttachmentStatus;
1604
+ (function (AttachmentStatus) {
1605
+ AttachmentStatus["LOAD_SCIENCE_CASE"] = "loadScienceCase";
1606
+ AttachmentStatus["LOAD_SCIENCE_CASE_SUCCESS"] = "loadScienceCaseSuccess";
1607
+ AttachmentStatus["LOAD_SCIENCE_CASE_FAILURE"] = "loadScienceCaseFailure";
1608
+ AttachmentStatus["VALIDATE_SCIENCE_CASE"] = "validateScienceCase";
1609
+ AttachmentStatus["VALIDATE_SCIENCE_CASE_SUCCESS"] = "validateScienceCaseSuccess";
1610
+ AttachmentStatus["VALIDATE_SCIENCE_CASE_FAILURE"] = "validateScienceCaseFailure";
1611
+ AttachmentStatus["REMOVE_SCIENCE_CASE"] = "removeScienceCase";
1612
+ AttachmentStatus["REMOVE_SCIENCE_CASE_SUCCESS"] = "removeScienceCaseSuccess";
1613
+ AttachmentStatus["REMOVE_SCIENCE_CASE_FAILURE"] = "removeScienceCaseFailure";
1614
+ AttachmentStatus["LOAD_TEAM_EXPERTISE"] = "loadTeamExpertise";
1615
+ AttachmentStatus["LOAD_TEAM_EXPERTISE_SUCCESS"] = "loadTeamExpertiseSuccess";
1616
+ AttachmentStatus["LOAD_TEAM_EXPERTISE_FAILURE"] = "loadTeamExpertiseFailure";
1617
+ AttachmentStatus["VALIDATE_TEAM_EXPERTISE"] = "validateTeamExpertise";
1618
+ AttachmentStatus["VALIDATE_TEAM_EXPERTISE_SUCCESS"] = "validateTeamExpertiseSuccess";
1619
+ AttachmentStatus["VALIDATE_TEAM_EXPERTISE_FAILURE"] = "validateTeamExpertiseFailure";
1620
+ AttachmentStatus["REMOVE_TEAM_EXPERTISE"] = "removeTeamExpertise";
1621
+ AttachmentStatus["REMOVE_TEAM_EXPERTISE_SUCCESS"] = "removeTeamExpertiseSuccess";
1622
+ AttachmentStatus["REMOVE_TEAM_EXPERTISE_FAILURE"] = "removeTeamExpertiseFailure";
1623
+ })(AttachmentStatus || (AttachmentStatus = {}));
1624
+
1625
+ var ScienceGoalsStatus;
1626
+ (function (ScienceGoalsStatus) {
1627
+ ScienceGoalsStatus["LOAD_SCIENCE_GOALS"] = "loadScienceGoals";
1628
+ ScienceGoalsStatus["LOAD_SCIENCE_GOALS_SUCCESS"] = "loadScienceGoalsSuccess";
1629
+ ScienceGoalsStatus["LOAD_SCIENCE_GOALS_FAILURE"] = "loadScienceGoalsFailure";
1630
+ ScienceGoalsStatus["SAVE_SCIENCE_GOALS"] = "saveScienceGoals";
1631
+ ScienceGoalsStatus["SAVE_SCIENCE_GOALS_SUCCESS"] = "saveScienceGoalsSuccess";
1632
+ ScienceGoalsStatus["SAVE_SCIENCE_GOALS_FAILURE"] = "saveScienceGoalsFailure";
1633
+ ScienceGoalsStatus["IMPORT_SOURCES"] = "importSources";
1634
+ ScienceGoalsStatus["IMPORT_SOURCES_SUCCESS"] = "importSourcesSuccess";
1635
+ ScienceGoalsStatus["IMPORT_SOURCES_FAILURE"] = "importSourcesFailure";
1636
+ ScienceGoalsStatus["EXPORT_SOURCES"] = "exportSources";
1637
+ ScienceGoalsStatus["EXPORT_SOURCES_SUCCESS"] = "exportSourcesSuccess";
1638
+ ScienceGoalsStatus["EXPORT_SOURCES_FAILURE"] = "exportSourcesFailure";
1639
+ ScienceGoalsStatus["EXPORT_SOURCES_COORDINATES_NOT_SUPPORTED"] = "exportSourcesCoordinatesNotSupported";
1640
+ ScienceGoalsStatus["UPDATE_REST_FREQUENCIES"] = "updateRestFrequencies";
1641
+ ScienceGoalsStatus["UPDATE_REST_FREQUENCIES_SUCCESS"] = "updateRestFrequenciesSuccess";
1642
+ ScienceGoalsStatus["UPDATE_REST_FREQUENCIES_FAILURE"] = "updateRestFrequenciesFailure";
1643
+ ScienceGoalsStatus["IMPORT_SINGLE_VISITS"] = "importSingleVisits";
1644
+ ScienceGoalsStatus["IMPORT_SINGLE_VISITS_SUCCESS"] = "importSingleVisitsSuccess";
1645
+ ScienceGoalsStatus["IMPORT_SINGLE_VISITS_FAILURE"] = "importSingleVisitsFailure";
1646
+ ScienceGoalsStatus["IMPORT_EPHEMERIS_FILE"] = "importEphemerisFile";
1647
+ ScienceGoalsStatus["IMPORT_EPHEMERIS_FILE_SUCCESS"] = "importEphemerisFileSuccess";
1648
+ ScienceGoalsStatus["IMPORT_EPHEMERIS_FILE_FAILURE"] = "importEphemerisFileFailure";
1649
+ })(ScienceGoalsStatus || (ScienceGoalsStatus = {}));
1650
+
1651
+ var SubmissionStatus;
1652
+ (function (SubmissionStatus) {
1653
+ SubmissionStatus["SUBMIT_PROJECT"] = "submitProject";
1654
+ SubmissionStatus["SUBMIT_PROJECT_SUCCESS"] = "submitProjectSuccess";
1655
+ SubmissionStatus["SUBMIT_PROJECT_FAILURE"] = "submitProjectFailure";
1656
+ })(SubmissionStatus || (SubmissionStatus = {}));
1657
+
1658
+ var ValidationStatus;
1659
+ (function (ValidationStatus) {
1660
+ ValidationStatus["VALIDATE"] = "validate";
1661
+ ValidationStatus["VALIDATE_SUCCESS"] = "validateSuccess";
1662
+ ValidationStatus["VALIDATE_FAILURE"] = "validateFailure";
1663
+ })(ValidationStatus || (ValidationStatus = {}));
1664
+
1665
+ const ReceiverBands = [
1666
+ {
1667
+ polarisationFrequency: 40.188,
1668
+ continuumFrequency: 40.188,
1669
+ continuumVlbiFrequency: 43.168,
1670
+ name: 'ALMA_RB_01',
1671
+ type: 'SSB',
1672
+ number: 1,
1673
+ rangeDescription: '[35.0-52.0 GHz]',
1674
+ rfmin: 35.0,
1675
+ rfmax: 50.0,
1676
+ ifmin: 4.0,
1677
+ ifmax: 12.0,
1678
+ sidebandGainRatio: 0.0
1679
+ },
1680
+ {
1681
+ polarisationFrequency: 89.7,
1682
+ continuumFrequency: 89.7,
1683
+ name: 'ALMA_RB_02',
1684
+ type: 'TSB',
1685
+ number: 2,
1686
+ rangeDescription: '[67.0-116.0 GHz]',
1687
+ rfmin: 67.0,
1688
+ rfmax: 116.0,
1689
+ ifmin: 4.0,
1690
+ ifmax: 12.0,
1691
+ sidebandGainRatio: 0.0
1692
+ },
1693
+ {
1694
+ polarisationFrequency: 97.5,
1695
+ continuumFrequency: 97.5,
1696
+ continuumSolarFrequency: 100,
1697
+ continuumVlbiFrequency: 93.268,
1698
+ name: 'ALMA_RB_03',
1699
+ type: 'TSB',
1700
+ number: 3,
1701
+ rangeDescription: '[84.0-116.0 GHz]',
1702
+ rfmin: 84.0,
1703
+ rfmax: 116.0,
1704
+ ifmin: 4.0,
1705
+ ifmax: 8.0,
1706
+ sidebandGainRatio: 0.0
1707
+ },
1708
+ {
1709
+ polarisationFrequency: 145.0,
1710
+ continuumFrequency: 145.0,
1711
+ name: 'ALMA_RB_04',
1712
+ type: 'TSB',
1713
+ number: 4,
1714
+ rangeDescription: '[125.0-163.0 GHz]',
1715
+ rfmin: 125.0,
1716
+ rfmax: 163.0,
1717
+ ifmin: 4.0,
1718
+ ifmax: 8.0,
1719
+ sidebandGainRatio: 0.0
1720
+ },
1721
+ {
1722
+ polarisationFrequency: 203.0,
1723
+ continuumFrequency: 203.0,
1724
+ continuumSolarFrequency: 198,
1725
+ name: 'ALMA_RB_05',
1726
+ type: 'TSB',
1727
+ number: 5,
1728
+ rangeDescription: '[158.0-211.0 GHz]',
1729
+ rfmin: 158.0,
1730
+ rfmax: 211.0,
1731
+ ifmin: 4.0,
1732
+ ifmax: 8.0,
1733
+ sidebandGainRatio: 0.0
1734
+ },
1735
+ {
1736
+ polarisationFrequency: 233.0,
1737
+ continuumFrequency: 233.0,
1738
+ continuumSolarFrequency: 239,
1739
+ continuumVlbiFrequency: 221.07,
1740
+ name: 'ALMA_RB_06',
1741
+ type: 'TSB',
1742
+ number: 6,
1743
+ rangeDescription: '[211.0-275.0 GHz]',
1744
+ rfmin: 211.0,
1745
+ rfmax: 275.0,
1746
+ ifmin: 4.5,
1747
+ ifmax: 10.0,
1748
+ sidebandGainRatio: 0.0
1749
+ },
1750
+ {
1751
+ polarisationFrequency: 343.5,
1752
+ continuumFrequency: 343.5,
1753
+ continuumSolarFrequency: 346.6,
1754
+ continuumVlbiFrequency: 342.6,
1755
+ name: 'ALMA_RB_07',
1756
+ type: 'TSB',
1757
+ number: 7,
1758
+ rangeDescription: '[275.0-373.0 GHz]',
1759
+ rfmin: 275.0,
1760
+ rfmax: 373.0,
1761
+ ifmin: 4.0,
1762
+ ifmax: 8.0,
1763
+ sidebandGainRatio: 0.0
1764
+ },
1765
+ {
1766
+ polarisationFrequency: -1.0,
1767
+ continuumFrequency: 405.0,
1768
+ name: 'ALMA_RB_08',
1769
+ type: 'TSB',
1770
+ number: 8,
1771
+ rangeDescription: '[385.0-500.0 GHz]',
1772
+ rfmin: 385.0,
1773
+ rfmax: 500.0,
1774
+ ifmin: 4.0,
1775
+ ifmax: 8.0,
1776
+ sidebandGainRatio: 0.0
1777
+ },
1778
+ {
1779
+ polarisationFrequency: -1.0,
1780
+ continuumFrequency: 679.0,
1781
+ name: 'ALMA_RB_09',
1782
+ type: 'DSB',
1783
+ number: 9,
1784
+ rangeDescription: '[602.0-720.0 GHz]',
1785
+ rfmin: 602.0,
1786
+ rfmax: 720.0,
1787
+ ifmin: 4.0,
1788
+ ifmax: 12.0,
1789
+ sidebandGainRatio: 1.0
1790
+ },
1791
+ {
1792
+ polarisationFrequency: -1.0,
1793
+ continuumFrequency: 869.25,
1794
+ name: 'ALMA_RB_10',
1795
+ type: 'DSB',
1796
+ number: 10,
1797
+ rangeDescription: '[787.0-950.0 GHz]',
1798
+ rfmin: 787.0,
1799
+ rfmax: 950.0,
1800
+ ifmin: 4.0,
1801
+ ifmax: 12.0,
1802
+ sidebandGainRatio: 1.0
1803
+ }
1804
+ ];
1805
+
1806
+ var TimeEstimatesStatus;
1807
+ (function (TimeEstimatesStatus) {
1808
+ TimeEstimatesStatus["FETCH_TIME_ESTIMATES"] = "fetchTimeEstimates";
1809
+ TimeEstimatesStatus["FETCH_TIME_ESTIMATES_SUCCESS"] = "fetchTimeEstimatesSuccess";
1810
+ TimeEstimatesStatus["FETCH_TIME_ESTIMATES_FAILURE"] = "fetchTimeEstimatesFailure";
1811
+ })(TimeEstimatesStatus || (TimeEstimatesStatus = {}));
1812
+
1813
+ var ControlAndPerformanceDataStatus;
1814
+ (function (ControlAndPerformanceDataStatus) {
1815
+ ControlAndPerformanceDataStatus["FETCH_CONTROL_AND_PERFORMANCE"] = "fetchControlAndPerformance";
1816
+ ControlAndPerformanceDataStatus["FETCH_CONTROL_AND_PERFORMANCE_SUCCESS"] = "fetchControlAndPerformanceSuccess";
1817
+ ControlAndPerformanceDataStatus["FETCH_CONTROL_AND_PERFORMANCE_FAILURE"] = "fetchControlAndPerformanceFailure";
1818
+ })(ControlAndPerformanceDataStatus || (ControlAndPerformanceDataStatus = {}));
1819
+
1820
+ var CalibrationDataStatus;
1821
+ (function (CalibrationDataStatus) {
1822
+ CalibrationDataStatus["FETCH_CALIBRATION"] = "fetchCalibration";
1823
+ CalibrationDataStatus["FETCH_CALIBRATION_SUCCESS"] = "fetchCalibrationSuccess";
1824
+ CalibrationDataStatus["FETCH_CALIBRATION_FAILURE"] = "fetchCalibrationFailure";
1825
+ })(CalibrationDataStatus || (CalibrationDataStatus = {}));
1826
+
1827
+ var SensitivityEquivalenceValuesStatus;
1828
+ (function (SensitivityEquivalenceValuesStatus) {
1829
+ SensitivityEquivalenceValuesStatus["FETCH_SENSITIVITY_EQUIVALENCE_VALUES"] = "fetchSensitivityEquivalenceValues";
1830
+ SensitivityEquivalenceValuesStatus["FETCH_SENSITIVITY_EQUIVALENCE_VALUES_SUCCESS"] = "fetchSensitivityEquivalenceValuesSuccess";
1831
+ SensitivityEquivalenceValuesStatus["FETCH_SENSITIVITY_EQUIVALENCE_VALUES_FAILURE"] = "fetchSensitivityEquivalenceValuesFailure";
1832
+ })(SensitivityEquivalenceValuesStatus || (SensitivityEquivalenceValuesStatus = {}));
1833
+
1834
+ var SensitivityFrequencyMeasuresStatus;
1835
+ (function (SensitivityFrequencyMeasuresStatus) {
1836
+ SensitivityFrequencyMeasuresStatus["FETCH_SENSITIVITY_FREQUENCY_MEASURES"] = "fetchSensitivityFrequencyMeasures";
1837
+ SensitivityFrequencyMeasuresStatus["FETCH_SENSITIVITY_FREQUENCY_MEASURES_SUCCESS"] = "fetchSensitivityFrequencyMeasuresSuccess";
1838
+ SensitivityFrequencyMeasuresStatus["FETCH_SENSITIVITY_FREQUENCY_MEASURES_FAILURE"] = "fetchSensitivityFrequencyMeasuresFailure";
1839
+ })(SensitivityFrequencyMeasuresStatus || (SensitivityFrequencyMeasuresStatus = {}));
1840
+
1841
+ var SpectralScanTuningsStatus;
1842
+ (function (SpectralScanTuningsStatus) {
1843
+ SpectralScanTuningsStatus["FETCH_SPECTRAL_SCAN_TUNINGS"] = "fetchSpectralScanTunings";
1844
+ SpectralScanTuningsStatus["FETCH_SPECTRAL_SCAN_TUNINGS_SUCCESS"] = "fetchSpectralScanTuningsSuccess";
1845
+ SpectralScanTuningsStatus["FETCH_SPECTRAL_SCAN_TUNINGS_FAILURE"] = "fetchSpectralScanTuningsFailure";
1846
+ })(SpectralScanTuningsStatus || (SpectralScanTuningsStatus = {}));
1847
+
1848
+ var UserPreferencesStatus;
1849
+ (function (UserPreferencesStatus) {
1850
+ UserPreferencesStatus["LOAD_USER_PREFERENCES"] = "loadUserPreferences";
1851
+ UserPreferencesStatus["LOAD_USER_PREFERENCES_SUCCESS"] = "loadUserPreferencesSuccess";
1852
+ UserPreferencesStatus["LOAD_USER_PREFERENCES_FAILURE"] = "loadUserPreferencesFailure";
1853
+ UserPreferencesStatus["SAVE_USER_PREFERENCES"] = "saveUserPreferences";
1854
+ UserPreferencesStatus["SAVE_USER_PREFERENCES_SUCCESS"] = "saveUserPreferencesSuccess";
1855
+ UserPreferencesStatus["SAVE_USER_PREFERENCES_FAILURE"] = "saveUserPreferencesFailure";
1856
+ })(UserPreferencesStatus || (UserPreferencesStatus = {}));
1857
+
1858
+ var PointingsStatus;
1859
+ (function (PointingsStatus) {
1860
+ PointingsStatus["FETCH_POINTINGS"] = "fetchPointings";
1861
+ PointingsStatus["FETCH_POINTINGS_SUCCESS"] = "fetchPointingsSuccess";
1862
+ PointingsStatus["FETCH_POINTINGS_FAILURE"] = "fetchPointingsFailure";
1863
+ PointingsStatus["EXPORT_POINTINGS_TO_CSV"] = "exportPointingsToCsv";
1864
+ PointingsStatus["EXPORT_POINTINGS_TO_CSV_SUCCESS"] = "exportPointingsToCsvSuccess";
1865
+ PointingsStatus["EXPORT_POINTINGS_TO_CSV_FAILURE"] = "exportPointingsToCsvFailure";
1866
+ PointingsStatus["IMPORT_POINTINGS_FROM_CSV"] = "importPointingsFromCsv";
1867
+ PointingsStatus["IMPORT_POINTINGS_FROM_CSV_SUCCESS"] = "importPointingsFromCsvSuccess";
1868
+ PointingsStatus["IMPORT_POINTINGS_FROM_CSV_SUCCESS_WITH_WARNINGS"] = "importPointingsFromCsvSuccessWithWarnings";
1869
+ PointingsStatus["IMPORT_POINTINGS_FROM_CSV_FAILURE"] = "importPointingsFromCsvFailure";
1870
+ })(PointingsStatus || (PointingsStatus = {}));
1871
+
1872
+ var SpectralViewerStatus;
1873
+ (function (SpectralViewerStatus) {
1874
+ SpectralViewerStatus["FETCH_OCTILE"] = "fetchOctile";
1875
+ SpectralViewerStatus["FETCH_OCTILE_SUCCESS"] = "fetchOctileSuccess";
1876
+ SpectralViewerStatus["FETCH_OCTILE_FAILURE"] = "fetchOctileFailure";
1877
+ })(SpectralViewerStatus || (SpectralViewerStatus = {}));
1878
+
1879
+ var CycleInfoStatus;
1880
+ (function (CycleInfoStatus) {
1881
+ CycleInfoStatus["LOAD_CYCLE_INFO"] = "cycleInfo";
1882
+ CycleInfoStatus["LOAD_CYCLE_INFO_SUCCESS"] = "cycleInfoSuccess";
1883
+ CycleInfoStatus["LOAD_CYCLE_INFO_FAILURE"] = "cycleInfoFailure";
1884
+ })(CycleInfoStatus || (CycleInfoStatus = {}));
1885
+
1886
+ var ConfigurationTablesStatus;
1887
+ (function (ConfigurationTablesStatus) {
1888
+ ConfigurationTablesStatus["LOAD_CONFIGURATION_TABLES"] = "loadConfigurationTables";
1889
+ ConfigurationTablesStatus["LOAD_CONFIGURATION_TABLES_SUCCESS"] = "loadConfigurationTablesSuccess";
1890
+ ConfigurationTablesStatus["LOAD_CONFIGURATION_TABLES_FAILURE"] = "loadConfigurationTablesFailure";
1891
+ })(ConfigurationTablesStatus || (ConfigurationTablesStatus = {}));
1892
+
1893
+ // used for typing in the code
1894
+ var ProposalTypeString;
1895
+ (function (ProposalTypeString) {
1896
+ ProposalTypeString["Regular"] = "Regular";
1897
+ ProposalTypeString["TargetOfOpportunity"] = "Target Of Opportunity";
1898
+ ProposalTypeString["VLBI"] = "VLBI";
1899
+ ProposalTypeString["LargeProgram"] = "Large Program";
1900
+ ProposalTypeString["PhasedArray"] = "Phased Array";
1901
+ })(ProposalTypeString || (ProposalTypeString = {}));
1902
+ // use for dropdowns etc
1903
+ const ProposalTypes = Object.values(ProposalTypeString);
1904
+ // mapping to the codes used in the backend
1905
+ const ProposalTypesMap = {
1906
+ Regular: 'S',
1907
+ 'Target Of Opportunity': 'T',
1908
+ VLBI: 'V',
1909
+ 'Large Program': 'L',
1910
+ 'Phased Array': 'P'
1911
+ };
1912
+
1913
+ var TechnicalJustificationStatus;
1914
+ (function (TechnicalJustificationStatus) {
1915
+ TechnicalJustificationStatus["FETCH_TECHNICAL_JUSTIFICATION"] = "fetchTechnicalJustification";
1916
+ TechnicalJustificationStatus["FETCH_TECHNICAL_JUSTIFICATION_SUCCESS"] = "fetchTechnicalJustificationSuccess";
1917
+ TechnicalJustificationStatus["FETCH_TECHNICAL_JUSTIFICATION_FAILURE"] = "fetchTechnicalJustificationFailure";
1918
+ })(TechnicalJustificationStatus || (TechnicalJustificationStatus = {}));
1919
+
1920
+ // NgOT should use just 2 roles for now:
1921
+ // ALMA_USER_ROLE = "MASTER/USER";
1922
+ // SUPER_USER_ROLE = "OBSPREP/SOFTWARE_SUPPORT"; (NGOT-1437)
1923
+ const includesPrivilegedRoles = (roles) => includesSoftwareSupportRole(roles);
1924
+ const includesSoftwareSupportRole = (roles) => includesRole(roles, 'OBSPREP/SOFTWARE_SUPPORT');
1925
+ const includesProtrackRole = (roles) => includesRole(roles, ['OBOPS/AOD', 'OBOPS/DRM', 'OBOPS/PM', 'OBOPS/ARCA', 'OBOPS/QAA']);
1926
+ const includesRole = (roles, role) => {
1927
+ if (Array.isArray(role)) {
1928
+ return role.some((r) => roles?.includes(r));
1929
+ }
1930
+ return roles?.includes(role);
1931
+ };
1932
+
1933
+ function getProjectStatus(item) {
1934
+ const { projectSource, latestSubmissionTime, latestModificationTime } = item;
1935
+ const isArchive = projectSource === 'Archive';
1936
+ const isProjectStore = projectSource === 'ProjectStore';
1937
+ const isSubmitted = latestSubmissionTime?.length !== 0;
1938
+ const isNotModifiedAfterSubmission = isSubmitted && latestModificationTime?.length !== 0 && latestSubmissionTime >= latestModificationTime;
1939
+ let status;
1940
+ if (isArchive || (isProjectStore && isNotModifiedAfterSubmission)) {
1941
+ status = 'submitted';
1942
+ }
1943
+ else if (isSubmitted) {
1944
+ status = 'modified';
1945
+ }
1946
+ else {
1947
+ status = 'draft';
1948
+ }
1949
+ return status;
1950
+ }
1951
+ function getSourceFromToClone(item) {
1952
+ const { projectSource, latestSubmissionTime, latestModificationTime } = item;
1953
+ const isArchive = projectSource === 'Archive';
1954
+ const isProjectStore = projectSource === 'ProjectStore';
1955
+ const isSubmitted = latestSubmissionTime?.length !== 0;
1956
+ const isNotModifiedAfterSubmission = isSubmitted && latestModificationTime?.length !== 0 && latestSubmissionTime >= latestModificationTime;
1957
+ if (isArchive) {
1958
+ return 'Archive';
1959
+ }
1960
+ else if (isProjectStore && isNotModifiedAfterSubmission) {
1961
+ return 'ProjectStore';
1962
+ }
1963
+ else if (isSubmitted) {
1964
+ return 'Archive';
1965
+ }
1966
+ else {
1967
+ return 'ProjectStore';
1968
+ }
1969
+ }
1970
+
1971
+ const JointProposalsTypes = ['JWST', 'VLA', 'VLT'];
1972
+
1973
+ /**
1974
+ * Editor token and associated info -- for NGOT-907
1975
+ * @author amchavan, 11-Oct-2024
1976
+ */
1977
+ /**
1978
+ * Reasons why a token expired.
1979
+ *
1980
+ * NOTE -- We set the enum values to be strings, so we can use them in a switch/case statement
1981
+ * without casting them to numbers.
1982
+ * See https://stackoverflow.com/a/59217944
1983
+ */
1984
+ var ExpirationReason;
1985
+ (function (ExpirationReason) {
1986
+ /** Author was inactive (that is, did not edit the proposal) for some predefined time */
1987
+ ExpirationReason["INACTIVE"] = "INACTIVE";
1988
+ /** Author completed an editing session and released the token */
1989
+ ExpirationReason["RELEASED"] = "RELEASED";
1990
+ /** PI overrode current author and claimed the token for himself */
1991
+ ExpirationReason["GRAB"] = "GRAB";
1992
+ })(ExpirationReason || (ExpirationReason = {}));
1993
+
1994
+ /**
1995
+ * The client for alma.obsprep.ngot.backend.ngotprojectarchive.concedit.TokenController
1996
+ * in ngot-project-archive.
1997
+ *
1998
+ * All requests are fire-and-forget (no action on the response) because the front-end
1999
+ * takes its concurrent editing input from websocket subscriptions.
2000
+ *
2001
+ * @author amchavan, 11-Oct-2024
2002
+ */
2003
+ class TokenService {
2004
+ constructor(http) {
2005
+ this.http = http;
2006
+ this.baseUrl = `/ngotGateway/concurrent-editing/v1`;
2007
+ }
2008
+ claimToken(obsProjectUid, username, sessionId, grab = false) {
2009
+ return this.http.get(`${this.baseUrl}/editing-token?obsProjectUid=${obsProjectUid}&author=${username}&sessionId=${sessionId}&grab=${grab}`).subscribe();
2010
+ }
2011
+ releaseToken(obsProjectUid, username, sessionId) {
2012
+ return this.http.delete(`${this.baseUrl}/editing-token?obsProjectUid=${obsProjectUid}&author=${username}&sessionId=${sessionId}`).subscribe();
2013
+ }
2014
+ /** Ask the back-end to broadcast the current editing token for the given project, if any */
2015
+ broadcastToken(obsProjectUid) {
2016
+ this.http.get(`${this.baseUrl}/broadcast-editing-token?obsProjectUid=${obsProjectUid}`).subscribe();
2017
+ }
2018
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TokenService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
2019
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TokenService, providedIn: 'root' }); }
2020
+ }
2021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TokenService, decorators: [{
2022
+ type: Injectable,
2023
+ args: [{
2024
+ providedIn: 'root'
2025
+ }]
2026
+ }], ctorParameters: () => [{ type: i1.HttpClient }] });
2027
+
2028
+ /**
2029
+ * Simple-minded session management: a session is a user on browser, or browser tab
2030
+ * @author amchavan, 11-Oct-2024
2031
+ */
2032
+ class SessionService {
2033
+ constructor() {
2034
+ this.sessionID = this.randomString(6);
2035
+ }
2036
+ getSessionId() {
2037
+ return this.sessionID;
2038
+ }
2039
+ /** Compute a random string of the given length */
2040
+ randomString(length) {
2041
+ const temp = !!window.isSecureContext // Are we running on HTTPS?
2042
+ ? self.crypto.randomUUID() // YES, normal case
2043
+ : v4(); // NO, fall back on UUID v4
2044
+ return temp.replace(/-/g, '').substring(0, length);
2045
+ }
2046
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2047
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SessionService, providedIn: 'root' }); }
2048
+ }
2049
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SessionService, decorators: [{
2050
+ type: Injectable,
2051
+ args: [{
2052
+ providedIn: 'root'
2053
+ }]
2054
+ }], ctorParameters: () => [] });
2055
+
2056
+ /**
2057
+ * @author amchavan, 10-Oct-2024
2058
+ */
2059
+ class RxStompService extends RxStomp {
2060
+ constructor() {
2061
+ super();
2062
+ }
2063
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RxStompService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2064
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RxStompService, providedIn: 'root' }); }
2065
+ }
2066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RxStompService, decorators: [{
2067
+ type: Injectable,
2068
+ args: [{
2069
+ providedIn: 'root'
2070
+ }]
2071
+ }], ctorParameters: () => [] });
2072
+
2073
+ /**
2074
+ * Configuration options for RxStomp
2075
+ *
2076
+ * @author amchavan, 10-Oct-2024
2077
+ */
2078
+ const rxStompConfig = {
2079
+ // Which websocket server?
2080
+ // brokerURL: 'ws://127.0.0.1:15674/ws',
2081
+ // brokerURL: 'ws://localhost:10001/ngot-project-archive/websocket',
2082
+ // brokerURL: 'ws://localhost:8080/ngotGateway/websocket',
2083
+ brokerURL: '/ngotWebsocketGateway/websocket',
2084
+ // Headers
2085
+ // Typical keys: login, passcode, host
2086
+ // connectHeaders: {
2087
+ // login: 'guest',
2088
+ // passcode: 'guest',
2089
+ // },
2090
+ // How often to heartbeat?
2091
+ // Interval in milliseconds, set to 0 to disable
2092
+ heartbeatIncoming: 0, // Typical value 0 - disabled
2093
+ heartbeatOutgoing: 20000, // Typical value 20000 - every 20 seconds
2094
+ // Wait in milliseconds before attempting auto reconnect
2095
+ // Set to 0 to disable
2096
+ // Typical value 500 (500 milliseconds)
2097
+ reconnectDelay: 1000
2098
+ // Will log diagnostics on console
2099
+ // It can be quite verbose, not recommended in production
2100
+ // Skip this key to stop logging to console
2101
+ // debug: (msg: string): void => {
2102
+ // console.log(new Date(), msg);
2103
+ // },
2104
+ };
2105
+
2106
+ /**
2107
+ * See https://stomp-js.github.io/guide/rx-stomp/rx-stomp-with-angular.html
2108
+ *
2109
+ * @author amchavan, 10-Oct-2024
2110
+ */
2111
+ function rxStompServiceFactory() {
2112
+ const rxStomp = new RxStompService();
2113
+ rxStomp.configure(rxStompConfig);
2114
+ rxStomp.activate();
2115
+ console.info('RxStompService activated');
2116
+ return rxStomp;
2117
+ }
2118
+
2119
+ /*
2120
+ * Public API Surface of model
2121
+ */
2122
+
2123
+ /**
2124
+ * Generated bundle index. Do not edit.
2125
+ */
2126
+
2127
+ export { ApplicationStatus, AttachmentStatus, AuthenticationStatus, CalibrationDataStatus, ConfigurationTablesStatus, ControlAndPerformanceDataStatus, CycleInfoStatus, ExpirationReason, JointProposalsTypes, ListItemStatus, PointingsStatus, ProjectStatus, ProjectTypeCode, ProposalStatus, ProposalTypeString, ProposalTypes, ProposalTypesMap, ReceiverBands, RxStompService, ScienceGoalsStatus, SensitivityEquivalenceValuesStatus, SensitivityFrequencyMeasuresStatus, SessionService, SpectralScanTuningsStatus, SpectralViewerStatus, SubmissionStatus, TechnicalJustificationStatus, TimeEstimatesStatus, TokenService, UserPreferencesStatus, ValidationStatus, buildCalibrationTargetParameter, buildField, buildRectangle, buildScienceGoal, buildScienceSpectralWindow, buildScienceSpectralWindowForDefaultVLBIBand, buildScienceSpectralWindowForSolar, buildScienceSpectralWindowForVLBIOrPhasedArray, buildSpectralScanScienceSpectralWindow, buildSpectralSetupParameters, buildTargetParameters, buildTechnicalJustifications, buildTemporalParameters, buildVisitConstraint, getProjectStatus, getSourceFromToClone, includesPrivilegedRoles, includesProtrackRole, rxStompServiceFactory };
2128
+ //# sourceMappingURL=almaobservatory-model.mjs.map