def import_hdf_nist_special(pth, filename, dset, output_cls_instance): """ Import data from HDF File as specified by NIST-specific settings Returns ------- Success : bool Whether import was successful """ print('\n') import_success = _hdf_import_data(pth, filename, dset, output_cls_instance) if import_success is False: raise ValueError('hdf_import_data failed') return False _meta_process(_snb(), output_cls_instance) return True
def import_hdf_nist_special(pth, filename, dset, output_cls_instance): """ Import data from HDF File as specified by NIST-specific settings Returns ------- Success : bool Whether import was successful """ print('\n') try: import_success = _hdf_import_data(pth, filename, dset, output_cls_instance) if import_success is None or import_success is False: raise ValueError('hdf_import_data returned None') _meta_process(_snb(), output_cls_instance) except: print('Something failed in import_hdf_nist_special') return False else: print('\n') return True
# print(output_cls_instance.reps.data.shape) output_cls_instance.reps.update_calib_from_data() except: print('Something failed in meta_process: Spectra rep-calib') elif type(output_cls_instance) == _Spectrum: print('Type Spectrum') if __name__ == '__main__': from crikit.io.meta_configs import (special_nist_bcars2 as _snb) from crikit.io.hdf5 import hdf_import_data as _hdf_import_data rosetta = _snb() filename = _os.path.abspath('../../../mP2_w_small.h5') spect_dark = _Spectra() _hdf_import_data(filename, '/Spectra/Dark_3_5ms_2', spect_dark) meta_process(rosetta, spect_dark) print(spect_dark.reps) print('') img = _Hsi() _hdf_import_data(filename, '/BCARSImage/mP2_3_5ms_Pos_2_0/mP2_3_5ms_Pos_2_0_small', img) meta_process(rosetta, img) print(img.freq.__dict__)
# print(output_cls_instance.reps.data.shape) output_cls_instance.reps.update_calib_from_data() except: print('Something failed in meta_process: Spectra rep-calib') elif type(output_cls_instance) == _Spectrum: print('Type Spectrum') if __name__ == '__main__': from crikit.io.meta_configs import (special_nist_bcars2 as _snb) from crikit.io.hdf5 import hdf_import_data as _hdf_import_data rosetta = _snb() filename = _os.path.abspath('../../../mP2_w_small.h5') spect_dark = _Spectra() _hdf_import_data(filename,'/Spectra/Dark_3_5ms_2',spect_dark) meta_process(rosetta, spect_dark) print(spect_dark.reps) print('') img = _Hsi() _hdf_import_data(filename,'/BCARSImage/mP2_3_5ms_Pos_2_0/mP2_3_5ms_Pos_2_0_small',img) meta_process(rosetta, img) print(img.freq.__dict__)