Exemplo n.º 1
0
 def descriptor(self, doc):
     super(Calibration, self).descriptor(doc)
     self.cache["det_name"] = fd.find_one_image(doc)
     self.cache["dk_img"] = fs.query_dk_img(
         self.cache["start"],
         db=self.db,
         dk_id_key=self.config.dk_id_key,
         det_name=self.cache["det_name"]
     )
Exemplo n.º 2
0
def test_query_dk_img(db_with_dark_and_light, dk_id_key, shape):
    db = db_with_dark_and_light
    start = db[-1].metadata["start"]
    dk_img = mod.query_dk_img(start,
                              det_name="pe1_image",
                              db=db.v1,
                              dk_id_key=dk_id_key)
    if shape:
        assert isinstance(dk_img, np.ndarray)
        assert dk_img.shape == shape
Exemplo n.º 3
0
def test_query_dk_img(db_with_dark_and_light, dk_id_key, shape):
    db = db_with_dark_and_light
    start = mod.get_start_of_run(db[-1])
    dk_img = mod.query_dk_img(start,
                              det_name="pe1_image",
                              db=db,
                              dk_id_key=dk_id_key)
    if shape:
        assert isinstance(dk_img, np.ndarray)
        assert dk_img.shape == shape
    else:
        assert dk_img is None
Exemplo n.º 4
0
 def descriptor(self, doc):
     io.server_message("Read the stream {}".format(doc["name"]))
     self.image_key = from_desc.find_one_image(doc)
     try:
         self.dark_image = from_start.query_dk_img(
             self.start_doc,
             db=self.db,
             dk_id_key=self.config.dk_id_key,
             det_name=self.image_key)
     except ValueNotFoundError as error:
         self.dark_image = None
         io.server_message("Failed to find the dark: " + str(error))
     return super(AnalysisStream, self).descriptor(doc)
Exemplo n.º 5
0
 def descriptor(self, doc):
     super(Calibration, self).descriptor(doc)
     self.cache["det_name"] = fd.find_one_image(doc)
     try:
         self.cache["dk_img"] = fs.query_dk_img(
             self.cache["start"],
             db=self.db,
             dk_id_key=self.config.dk_id_key,
             det_name=self.cache["det_name"]
         )
     except ValueNotFoundError as error:
         self.cache["dk_img"] = None
         io.server_message("Failed to find dark: " + str(error))
Exemplo n.º 6
0
 def descriptor(self, doc):
     self.cache["det_name"] = from_desc.find_one_image(doc)
     self.cache["dk_img"] = from_start.query_dk_img(
         self.cache["start"],
         db=self.db,
         dk_id_key=self.config.dk_id_key,
         det_name=self.cache["det_name"])
     self.cache["dk_sub_bg_img"] = from_start.query_bg_img(
         self.cache["start"],
         bkgd_sample_name_key=self.config.bkgd_sample_name_key,
         sample_name_key=self.config.sample_name_key,
         det_name=self.cache["det_name"],
         dk_id_key=self.config.dk_id_key,
         db=self.db)
     super(AnalysisStream, self).descriptor(doc)