def test_load_and_write_telescope_data(): tel1, cam1, opt1 = ID.load(filename1) tel2, cam2, opt2 = ID.load(filename2) tel3, cam3, opt3 = ID.load(filename3) tel4, cam4, opt4 = ID.load() assert (len(tel1) > 0) assert (len(tel2) > 0) assert (len(opt3) > 0) assert (len(tel4) > 0) ID.write_fits(instr_dict=tel4, filename='test.fits', overwrite=True) tel41, cam41, opt41 = ID.load('test.fits') assert (len(tel41) > 0) os.remove('test.fits')
def test_load_and_write_telescope_data(): tel1,cam1,opt1 = ID.load(filename1) tel2,cam2,opt2 = ID.load(filename2) tel3,cam3,opt3 = ID.load(filename3) tel4,cam4,opt4 = ID.load() assert(len(tel1)>0) assert(len(tel2)>0) assert(len(opt3)>0) assert(len(tel4)>0) ID.write_fits(instr_dict=tel4,filename='test.fits',overwrite=True) tel41,cam41,opt41 = ID.load('test.fits') assert(len(tel41)>0) os.remove('test.fits')
plt.xlabel('Time (%s)'% \ tel3['Tel_DiscriminatorPulseShape']['Time'].unit) plt.ylabel('Amplitude') plt.show() print('------------------------------------------------------------------') print('Plot the mirror reflectivity vs wavelength stored in a config file') print(opt3['Opt_MirrorRefelctivity']) title = 'Mirror reflectivity versus wavelength' plt.figure() plt.plot(opt3['Opt_MirrorRefelctivity']['Wavelength'], opt3['Opt_MirrorRefelctivity']['Reflectivity'], '+') plt.title(title) plt.xlabel('Wavelength (%s)' % \ opt3['Opt_MirrorRefelctivity']['Wavelength'].unit) plt.show() #writing to files ID.write_fits(instr_dict=tel1,overwrite=True) tel11,cam11,opt11 = ID.load('1.fits') print(tel11['1']) tel12,cam12,opt12 = ID.load('2.fits') print(tel12['1']) os.remove('1.fits') os.remove('2.fits')