def event(self, doc): doc = super().event(doc) for filename in self.filenames: doc["data"]["calibration"].save( clean_template(pfmt.format(filename, ext=".poni")) )
def event(self, doc): # fill the document doc = super().event(doc) for two_d_var in [ k for k, v in self.dep_shapes.items() if len(v) == 2 ]: for filename in self.filenames: fit2d_save( np.flipud(doc["data"][two_d_var]), clean_template(pfmt.format(filename, ext="")), ) np.save( clean_template(pfmt.format(filename, ext="_mask.npy")), doc["data"][two_d_var], )
def event(self, doc): # fill the document doc = super().event(doc) for two_d_var in [ k for k, v in self.dep_shapes.items() if len(v) == 2 ]: for filename in self.filenames: imsave( clean_template( pfmt.format(filename, ext=f"_{two_d_var}.tiff")), doc["data"][two_d_var], )
def start(self, doc): doc = dict(doc) doc["analysis_stage"] = "meta" super().start(doc) self.filenames = [ pfmt.format(self.start_template, base_folder=bf).replace(".", ",") for bf in self.base_folders ] for filename in self.filenames: fn = clean_template(pfmt.format(filename, ext=".yaml")) print(f"Saving file to {fn}") os.makedirs(os.path.dirname(fn), exist_ok=True) dump_yml(fn, doc)
def event(self, doc): # fill the document doc = super().event(doc) for two_d_var in [ k for k, v in self.dep_shapes.items() if len(v) == 2 ]: for filename in self.filenames: imsave( clean_template( pfmt.format(filename, ext=f"_{two_d_var}.tiff") ), doc["data"][two_d_var], )
def event(self, doc): # fill the document doc = super().event(doc) for one_d_ind_var in [ k for k, v in self.in_dep_shapes.items() if len(v) == 1 ]: for one_d_dep_var in [ k for k, v in self.dep_shapes.items() if len(v) == 1 ]: for filename in self.filenames: pdf_saver( doc["data"][one_d_ind_var], doc["data"][one_d_dep_var], doc["data"]["config"], clean_template( pfmt.format(filename, ext=f".{one_d_dep_var}")), )
def event(self, doc): # fill the document doc = super().event(doc) for one_d_ind_var in [ k for k, v in self.in_dep_shapes.items() if len(v) == 1 ]: for one_d_dep_var in [ k for k, v in self.dep_shapes.items() if len(v) == 1 ]: for filename in self.filenames: pdf_saver( doc["data"][one_d_ind_var], doc["data"][one_d_dep_var], doc["data"]["config"], clean_template( pfmt.format(filename, ext=f".{one_d_dep_var}") ), )
def event(self, doc): # fill the document doc = super().event(doc) for one_d_ind_var in [ k for k, v in self.in_dep_shapes.items() if len(v) == 1 ]: for one_d_dep_var in [ k for k, v in self.dep_shapes.items() if len(v) == 1 ]: for filename in self.filenames: save_output( doc["data"][one_d_ind_var], doc["data"][one_d_dep_var], clean_template( pfmt.format( filename, ext=f"_{one_d_dep_var}_{one_d_ind_var}", ) ), {"tth": "2theta", "q": "Q"}.get(one_d_ind_var), )
def event(self, doc): # fill the document doc = super().event(doc) for one_d_ind_var in [ k for k, v in self.in_dep_shapes.items() if len(v) == 1 ]: for one_d_dep_var in [ k for k, v in self.dep_shapes.items() if len(v) == 1 ]: for filename in self.filenames: save_output( doc["data"][one_d_ind_var], doc["data"][one_d_dep_var], clean_template( pfmt.format( filename, ext=f"_{one_d_dep_var}_{one_d_ind_var}", )), { "tth": "2theta", "q": "Q" }.get(one_d_ind_var), )
def event(self, doc): doc = super().event(doc) for filename in self.filenames: doc["data"]["calibration"].save( clean_template(pfmt.format(filename, ext=".poni")))