maxRa = np.max(ra) minDec = np.min(dec) maxDec = np.max(dec) if (crval[0] < minRa) | (crval[0] > maxRa) | ( crval[1] < minDec) | (crval[1] > maxDec): print( 'WARNING: MAP CENTRE DOES NOT MATCH TELESCOPE POINTING CENTRE. CHECK COORDINATES' ) print('MEAN RA: {:.2f}, MEAN DEC: {:.2f}'.format( np.mean(ra), np.mean(dec))) wcs = Mapping.DefineWCS(naxis, cdelt, crval) maps, hits = Mapping.MakeMaps(tod, ra, dec, wcs) dataout['hits'] = hits dataout['maps'] = maps dataout['naxis'] = np.array(naxis) dataout['cdelt'] = np.array(cdelt) dataout['crval'] = np.array(crval) sbStr = ''.join(str(e) for e in sidebands) hoStr = ''.join(str(e) for e in pixels) FileTools.WriteH5Py( '{}/{}_{}_Horns{}_Sidebands{}.h5'.format( Parameters.get('Inputs', 'outputDir'), Parameters.get('Inputs', 'outputname'), prefix, hoStr, sbStr), dataout) dataout = {} # clear data dfile.close()
todjd0 = TimeString2JD(Config.get('Observation','todstart')) + float(Config.get('TimeCorrections', 'additiveFactor') ) nside = Config.getint('Inputs', 'nside') bl = Config.getint('Inputs', 'baseline') blong = Config.getint('Inputs', 'blong') npix = 12*nside**2 # Read in the TOD, integrate over all SB0 if os.path.isfile('{}/{}'.format(Config.get('Inputs', 'datadir'),Config.get('Inputs', 'compressedtod'))): tod = FileTools.ReadH5Py('{}/{}'.format(Config.get('Inputs', 'datadir'),Config.get('Inputs', 'compressedtod')))['auto_py'] todjd = np.arange(tod.size)/Config.getfloat('Observation', 'todsr') / 3600./ 24. * (1. - float(Config.get('TimeCorrections', 'multiFactor')) ) + todjd0 else: todfile = h5py.File('{}/{}'.format(Config.get('Inputs', 'datadir'), Config.get('Inputs', 'todfile'))) tod = np.mean(todfile['auto_py'][:,0,:],axis=1) todfile.close() FileTools.WriteH5Py('{}/{}'.format(Config.get('Inputs', 'datadir'),Config.get('Inputs', 'compressedtod')), {'auto_py': tod}) # Check for nans in TOD and normalise tod[np.isnan(tod)] = 0. tod = (tod - np.mean(tod))/np.std(tod) # Read in encoder data encfile = h5py.File('{}/{}'.format(Config.get('Inputs', 'datadir'), Config.get('Inputs', 'encfile'))) az = encfile['comap']['pointing']['azEncoder'][...] el = encfile['comap']['pointing']['elEncoder'][...] jd = encfile['comap']['pointing']['MJD'][...] + 2400000.5 encfile.close() # Power Spectrum of elevation