def test_filter_calibration_blocks_for_type_ignore_empty_observations():
    fake_inst = FakeInstrument(site='cpt',
                               camera='fa06',
                               enclosure='domc',
                               telescope='2m0a',
                               type='1m0-SciCam-Sinistro')
    filtered_blocks = observation_utils.filter_calibration_blocks_for_type(
        fake_inst, 'SKYFLAT', fake_response_json['results'])
    assert len(filtered_blocks) == 0
def test_filter_calibration_blocks_for_type():
    fake_inst = FakeInstrument(site='cpt',
                               camera='fa06',
                               enclosure='domc',
                               telescope='2m0a',
                               type='1m0-SciCam-Sinistro')
    expected_response = [copy.deepcopy(fake_response_json['results'][2])]
    expected_response[0]['request']['configurations'].pop()
    filtered_blocks = observation_utils.filter_calibration_blocks_for_type(
        fake_inst, 'BIAS', fake_response_json['results'])
    assert filtered_blocks == expected_response
Exemple #3
0
 def setup(self):
     self.site = 'coj'
     self.min_date = '2019-02-19T20:27:49'
     self.max_date = '2019-02-20T09:55:09'
     self.context = Context({
         'db_address': 'db_address',
         'CALIBRATION_IMAGE_TYPES': ['BIAS'],
         'CALIBRATION_STACK_DELAYS': {
             'BIAS': 300
         }
     })
     self.frame_type = 'BIAS'
     self.fake_blocks_response_json = fake_blocks_response_json
     self.fake_inst = FakeInstrument(site='coj',
                                     camera='2m0-SciCam-Spectral',
                                     enclosure='clma',
                                     telescope='2m0a')
Exemple #4
0
                    "max_airmass": 20,
                    "extra_params": {},
                    "min_lunar_distance": 0
                }
            }]
        },
        "site": "coj",
        "start": "2019-02-20T08:27:49",
        "state": "PENDING",
        "proposal": "calibrate",
        "enclosure": "clma",
        "name": ""
    }],
}

fake_instruments_response = FakeInstrument()


class TestMain():
    @pytest.fixture(scope='function')
    def setup(self):
        self.site = 'coj'
        self.min_date = '2019-02-19T20:27:49'
        self.max_date = '2019-02-20T09:55:09'
        self.context = Context({
            'db_address': 'db_address',
            'CALIBRATION_IMAGE_TYPES': ['BIAS'],
            'CALIBRATION_STACK_DELAYS': {
                'BIAS': 300
            }
        })