-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
471 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,305 @@ | ||
{ | ||
"site": "mrc", | ||
"enclosure": "enc1", | ||
"telescope": "0m35", | ||
"observation_type": "NORMAL", | ||
"state": "PENDING", | ||
"id": 583116837, | ||
"request_group_id": 1885213, | ||
"created": "2024-11-01T14:04:10.425775Z", | ||
"modified": "2024-11-01T14:04:10.425770Z", | ||
"start": "2024-11-02T07:22:14Z", | ||
"end": "2024-11-02T07:26:56Z", | ||
"name": "Full Detailed Observation", | ||
"submitter": "tbeccue", | ||
"proposal": "LCOSchedulerTest", | ||
"ipp_value": 1.05, | ||
"priority": 10, | ||
"request": { | ||
"id": 3445199, | ||
"modified": "2024-10-29T14:57:32.128148Z", | ||
"state": "PENDING", | ||
"duration": 282, | ||
"acceptability_threshold": 90.0, | ||
"optimization_type": "TIME", | ||
"observation_note": "", | ||
"extra_params": {}, | ||
"configuration_repeats": 2, | ||
"configurations": [ | ||
{ | ||
"id": 10840779, | ||
"configuration_status": 750648588, | ||
"instrument_name": "q461", | ||
"instrument_type": "0M35-QHY461", | ||
"priority": 1, | ||
"repeat_duration": null, | ||
"state": "PENDING", | ||
"summary": {}, | ||
"type": "EXPOSE", | ||
"target": { | ||
"dec": -7.6528696608383, | ||
"epoch": 2000.0, | ||
"extra_params": {}, | ||
"hour_angle": null, | ||
"name": "40 Eridani", | ||
"parallax": 199.608, | ||
"proper_motion_dec": -3421.809, | ||
"proper_motion_ra": -2240.085, | ||
"ra": 63.8179984124771, | ||
"type": "ICRS" | ||
}, | ||
"instrument_configs": [ | ||
{ | ||
"exposure_count": 1, | ||
"exposure_time": 15.0, | ||
"extra_params": { | ||
"offset_dec": 1, | ||
"offset_ra": 2, | ||
"rotator_angle": 5 | ||
}, | ||
"mode": "Full", | ||
"optical_elements": { | ||
"filter": "mrc-L" | ||
}, | ||
"rois": [], | ||
"rotator_mode": "RPA" | ||
}, | ||
{ | ||
"exposure_count": 2, | ||
"exposure_time": 10.0, | ||
"extra_params": { | ||
"offset_dec": 0, | ||
"offset_ra": 0, | ||
"rotator_angle": 0 | ||
}, | ||
"mode": "Full", | ||
"optical_elements": { | ||
"filter": "mrc-R" | ||
}, | ||
"rois": [], | ||
"rotator_mode": "RPA" | ||
} | ||
], | ||
"acquisition_config": { | ||
"extra_params": {}, | ||
"mode": "OFF" | ||
}, | ||
"constraints": { | ||
"extra_params": {}, | ||
"max_airmass": 1.6, | ||
"max_lunar_phase": 1.0, | ||
"min_lunar_distance": 30.0 | ||
}, | ||
"extra_params": { | ||
"dither_pattern": "custom" | ||
}, | ||
"guide_camera_name": "mrc-qhy461", | ||
"guiding_config": { | ||
"exposure_time": null, | ||
"extra_params": {}, | ||
"mode": "ON", | ||
"optical_elements": {}, | ||
"optional": true | ||
} | ||
}, | ||
{ | ||
"acquisition_config": { | ||
"extra_params": {}, | ||
"mode": "OFF" | ||
}, | ||
"configuration_status": 750648589, | ||
"constraints": { | ||
"extra_params": {}, | ||
"max_airmass": 1.6, | ||
"max_lunar_phase": 1.0, | ||
"min_lunar_distance": 30.0 | ||
}, | ||
"extra_params": { | ||
"dither_pattern": "custom" | ||
}, | ||
"guide_camera_name": "mrc-qhy461", | ||
"guiding_config": { | ||
"exposure_time": null, | ||
"extra_params": {}, | ||
"mode": "ON", | ||
"optical_elements": {}, | ||
"optional": true | ||
}, | ||
"id": 10840780, | ||
"instrument_configs": [ | ||
{ | ||
"exposure_count": 1, | ||
"exposure_time": 15.0, | ||
"extra_params": { | ||
"offset_dec": 1, | ||
"offset_ra": 2, | ||
"rotator_angle": 5 | ||
}, | ||
"mode": "Full", | ||
"optical_elements": { | ||
"filter": "mrc-L" | ||
}, | ||
"rois": [], | ||
"rotator_mode": "RPA" | ||
} | ||
], | ||
"instrument_name": "q461", | ||
"instrument_type": "0M35-QHY461", | ||
"priority": 2, | ||
"repeat_duration": null, | ||
"state": "PENDING", | ||
"summary": {}, | ||
"target": { | ||
"dec": 41.26875, | ||
"epoch": 2000.0, | ||
"extra_params": {}, | ||
"hour_angle": null, | ||
"name": "m31", | ||
"parallax": 0.0, | ||
"proper_motion_dec": 0.0, | ||
"proper_motion_ra": 0.0, | ||
"ra": 10.684708, | ||
"type": "ICRS" | ||
}, | ||
"type": "EXPOSE" | ||
}, | ||
{ | ||
"acquisition_config": { | ||
"extra_params": {}, | ||
"mode": "OFF" | ||
}, | ||
"configuration_status": 750648590, | ||
"constraints": { | ||
"extra_params": {}, | ||
"max_airmass": 1.6, | ||
"max_lunar_phase": 1.0, | ||
"min_lunar_distance": 30.0 | ||
}, | ||
"extra_params": { | ||
"dither_pattern": "custom" | ||
}, | ||
"guide_camera_name": "mrc-qhy461", | ||
"guiding_config": { | ||
"exposure_time": null, | ||
"extra_params": {}, | ||
"mode": "ON", | ||
"optical_elements": {}, | ||
"optional": true | ||
}, | ||
"id": 10840779, | ||
"instrument_configs": [ | ||
{ | ||
"exposure_count": 1, | ||
"exposure_time": 15.0, | ||
"extra_params": { | ||
"offset_dec": 1, | ||
"offset_ra": 2, | ||
"rotator_angle": 5 | ||
}, | ||
"mode": "Full", | ||
"optical_elements": { | ||
"filter": "mrc-L" | ||
}, | ||
"rois": [], | ||
"rotator_mode": "RPA" | ||
}, | ||
{ | ||
"exposure_count": 2, | ||
"exposure_time": 10.0, | ||
"extra_params": { | ||
"offset_dec": 0, | ||
"offset_ra": 0, | ||
"rotator_angle": 0 | ||
}, | ||
"mode": "Full", | ||
"optical_elements": { | ||
"filter": "mrc-R" | ||
}, | ||
"rois": [], | ||
"rotator_mode": "RPA" | ||
} | ||
], | ||
"instrument_name": "q461", | ||
"instrument_type": "0M35-QHY461", | ||
"priority": 3, | ||
"repeat_duration": null, | ||
"state": "PENDING", | ||
"summary": {}, | ||
"target": { | ||
"dec": -7.6528696608383, | ||
"epoch": 2000.0, | ||
"extra_params": {}, | ||
"hour_angle": null, | ||
"name": "40 Eridani", | ||
"parallax": 199.608, | ||
"proper_motion_dec": -3421.809, | ||
"proper_motion_ra": -2240.085, | ||
"ra": 63.8179984124771, | ||
"type": "ICRS" | ||
}, | ||
"type": "EXPOSE" | ||
}, | ||
{ | ||
"acquisition_config": { | ||
"extra_params": {}, | ||
"mode": "OFF" | ||
}, | ||
"configuration_status": 750648591, | ||
"constraints": { | ||
"extra_params": {}, | ||
"max_airmass": 1.6, | ||
"max_lunar_phase": 1.0, | ||
"min_lunar_distance": 30.0 | ||
}, | ||
"extra_params": { | ||
"dither_pattern": "custom" | ||
}, | ||
"guide_camera_name": "mrc-qhy461", | ||
"guiding_config": { | ||
"exposure_time": null, | ||
"extra_params": {}, | ||
"mode": "ON", | ||
"optical_elements": {}, | ||
"optional": true | ||
}, | ||
"id": 10840780, | ||
"instrument_configs": [ | ||
{ | ||
"exposure_count": 1, | ||
"exposure_time": 15.0, | ||
"extra_params": { | ||
"offset_dec": 1, | ||
"offset_ra": 2, | ||
"rotator_angle": 5 | ||
}, | ||
"mode": "Full", | ||
"optical_elements": { | ||
"filter": "mrc-L" | ||
}, | ||
"rois": [], | ||
"rotator_mode": "RPA" | ||
} | ||
], | ||
"instrument_name": "q461", | ||
"instrument_type": "0M35-QHY461", | ||
"priority": 4, | ||
"repeat_duration": null, | ||
"state": "PENDING", | ||
"summary": {}, | ||
"target": { | ||
"dec": 41.26875, | ||
"epoch": 2000.0, | ||
"extra_params": {}, | ||
"hour_angle": null, | ||
"name": "m31", | ||
"parallax": 0.0, | ||
"proper_motion_dec": 0.0, | ||
"proper_motion_ra": 0.0, | ||
"ra": 10.684708, | ||
"type": "ICRS" | ||
}, | ||
"type": "EXPOSE" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import json | ||
from import_schedules import Observation | ||
|
||
with open('./test_data/sample_observation.json', 'r') as file: | ||
sample_observation = json.load(file) | ||
|
||
def test_observation_validation(): | ||
o = Observation(sample_observation) | ||
assert Observation.validate_observation_format(sample_observation) | ||
assert Observation.validate_observation_format(o.observation) | ||
|
||
def test_observation_create_calendar(): | ||
o = Observation(sample_observation) | ||
assert not hasattr(o, "calendar_event") | ||
o._translate_to_calendar() | ||
assert hasattr(o, "calendar_event") | ||
|
||
def test_observation_create_project(): | ||
o = Observation(sample_observation) | ||
assert not hasattr(o, "project") | ||
o._translate_to_project() | ||
assert hasattr(o, "project") | ||
|
||
|
Oops, something went wrong.