parser.add_argument( "--usefit", action="store_true", dest="usefit", default=False, help="Use spherical harmonic fits instead of raw data", ) parser.add_argument("--plotname", dest="plotname", help="Output plot filename") parser.add_argument("--noshow", action="store_true", dest="noshow", default=False, help="Do not display plots") args = parser.parse_args() opts = vars(args).copy() alpha = 1 / 20.0 config = "IC" maps = getEnergyMaps(config) energy_bin_median = [4.12, 4.38, 4.58, 4.85, 5.12, 5.38, 5.77, 6.13, 6.73] energy_err_lower = [0.62, 0.65, 0.68, 0.73, 0.74, 0.75, 0.6, 0.52, 0.46] energy_err_upper = [0.5, 0.54, 0.55, 0.64, 0.72, 0.78, 0.83, 0.63, 0.58] # Right ascension projection of relative intensity map data, bg, local = hp.read_map(maps[0][0], range(3), verbose=False) nside = hp.get_nside(data) dec, ra = hp.pix2ang(nside, [i for i in range(hp.nside2npix(nside))]) rad2deg = 180.0 / np.pi deg2rad = np.pi / 180.0 dec = np.array([rad2deg * i for i in dec]) decmin = 115.0 decmax = 180.0 deccut = (dec >= decmin) * (dec <= decmax) ra = np.array([rad2deg * i for i in ra])
p.add_argument("--offset", dest="offset", type=int, help="Shift phase by some offset value") p.add_argument( "-b", "--batch", dest="batch", default=False, action="store_true", help="Execute without interaction" ) p.add_argument("-o", "--out", dest="out", default=None, help="Option to write to file") args = p.parse_args() if args.files == "config": files = glob.glob("%s/IC?*_24H_sid.fits" % my.ani_maps) configs = np.array([os.path.basename(f).split("_")[0] for f in files]) csort = configs.argsort() configs, files = configs[csort], np.asarray(files)[csort] x = range(len(configs)) smooth = 5 if args.files == "energy": files = getEnergyMaps("IC") ebins = [float(i) for i in getEbins()] nbins = len(ebins) - 1 x = [readDist_IC("IC", ebins[i], ebins[i + 1])[0] for i in range(nbins)] xL = [readDist_IC("IC", ebins[i], ebins[i + 1])[1] for i in range(nbins)] xR = [readDist_IC("IC", ebins[i], ebins[i + 1])[2] for i in range(nbins)] # x = getMids(ebins, infvalue=100) smooth = 20 # Custom treatment of IT map files += [["{}/IT_24H_sid_STA8.fits".format(my.ani_maps)]] # x = np.append(x, np.log10(2*10**6)) median, sigL, sigR = readDist_IT("IT", 8, 100) x += [median] xL += [sigL] xR += [sigR] if args.files == "comp":