from ximpol.srcmodel.img import xFITSImage from ximpol.utils.matplotlib_ import pyplot as plt #from matplotlib import rc #rc('text', usetex=True) CFG_FILE = os.path.join(XIMPOL_CONFIG, 'tycho.py') DURATION = 200000. E_BINNING = [1., 4., 6.] evt_file_path = os.path.join(XIMPOL_DATA, 'tycho.fits') reg_file_path = os.path.join(XIMPOL_CONFIG, 'fits', 'tycho_multiple.reg') map_file_path = os.path.join(XIMPOL_DATA, 'tycho_cmap.fits') pipeline = xPipeline(clobber=False) def get_sel_file_path(i): """ """ return os.path.join(XIMPOL_DATA, 'tycho_reg%04d.fits' % i) def get_mcube_file_path(i): """ """ return os.path.join(XIMPOL_DATA, 'tycho_reg%04d_mcube.fits' % i) def generate(): """ """
""" CFG_FILE_PATH = os.path.join(XIMPOL_CONFIG, 'herx1_pulsar17off.py') OUT_FILE_PATH_BASE = os.path.join(XIMPOL_DATA, 'herx1_pulsar17off') EVT_FILE_PATH = '%s.fits' % OUT_FILE_PATH_BASE ANALYSIS_FILE_PATH = '%s_analysis.txt' % OUT_FILE_PATH_BASE SIM_DURATION = 1000000. NUM_PHASE_BINS = 25 EQP_BINNING = False PHASE_BINNING = None E_BINNING = [1., 10.] OUTPUT_FOLDER = os.path.join(XIMPOL_DOC, 'figures', 'showcase') """Main pipeline object. """ PIPELINE = xPipeline(clobber=False) def _sel_file_path(i): """Return the path to the i-th xpselct output file. """ return '%s_phase%04d.fits' % (OUT_FILE_PATH_BASE, i) def _mcube_file_path(i): """Return the path to the i-th xpbin MCUBE output file. """ return '%s_phase%04d_mcube.fits' % (OUT_FILE_PATH_BASE, i) def _pha1_file_path(i): """Return the path to the i-th xpbin PHA1 output file. """
from ximpol.srcmodel.img import xFITSImage from ximpol.utils.matplotlib_ import pyplot as plt #from matplotlib import rc #rc('text', usetex=True) CFG_FILE = os.path.join(XIMPOL_CONFIG, 'tycho.py') DURATION = 300000. E_BINNING = [1., 4., 6.] evt_file_path = os.path.join(XIMPOL_DATA, 'tycho.fits') reg_file_path = os.path.join(XIMPOL_CONFIG, 'fits', 'tycho_multiple.reg') map_file_path = os.path.join(XIMPOL_DATA, 'tycho_cmap.fits') pipeline = xPipeline(clobber=False) def get_sel_file_path(i): """ """ return os.path.join(XIMPOL_DATA, 'tycho_reg%04d.fits' % i) def get_mcube_file_path(i): """ """ return os.path.join(XIMPOL_DATA, 'tycho_reg%04d_mcube.fits' % i) def generate(): """ """
from ximpol.core.spline import xInterpolatedUnivariateSpline """Script-wide simulation and analysis settings. """ CFG_FILE_PATH = os.path.join(XIMPOL_CONFIG, 'grb130427_swift.py') OUT_FILE_PATH_BASE = os.path.join(XIMPOL_DATA, 'grb130427_swift') EVT_FILE_PATH = '%s.fits' % OUT_FILE_PATH_BASE ANALYSIS_FILE_PATH = '%s_analysis.txt' % OUT_FILE_PATH_BASE SIM_DURATION = 1000000. NUM_TIME_BINS = 25 TIME_BINNING = numpy.logspace(numpy.log10(131.2489717), numpy.log10(1000131.2489717), NUM_TIME_BINS) E_BINNING = [1., 10.] OUTPUT_FOLDER = os.path.join(XIMPOL_DOC, 'figures', 'showcase') """Main pipeline object. """ PIPELINE = xPipeline(clobber=False) def _lc_file_path(): """Return the path to the binned light curve. """ return '%s_lc.fits' % OUT_FILE_PATH_BASE def _sel_file_path(i): """Return the path to the i-th xpselct output file. """ return '%s_interval%04d.fits' % (OUT_FILE_PATH_BASE, i) def _mcube_file_path(i):
from ximpol.config.ark_120 import pol_degree, pol_angle elif i is 2: from ximpol.config.ngc_1365 import pol_degree, pol_angle NAME_LIST = ['mcg_6_30_15', 'ark_120', 'ngc_1365'] CFG_FILE = os.path.join(XIMPOL_CONFIG, NAME_LIST[i]+'.py') TIME = 3000000. E_BINNING = [2.,3.,5.,8.] SIM_NUM = 10 pol_degree_array = numpy.empty([SIM_NUM, len(E_BINNING)]) pol_degree_error_array = numpy.empty([SIM_NUM, len(E_BINNING)]) pol_angle_array = numpy.empty([SIM_NUM, len(E_BINNING)]) pol_angle_error_array = numpy.empty([SIM_NUM, len(E_BINNING)]) pipeline = xPipeline(clobber=True) for j in range(0, SIM_NUM): SEED = j evt_file_path = pipeline.xpobssim(configfile=CFG_FILE, duration=TIME, seed=SEED) #pipeline.xpbin(evt_file_path, algorithm='CMAP') mod_cube_file_path = pipeline.xpbin(evt_file_path, algorithm='MCUBE', ebinalg='LIST', ebinning=E_BINNING) mod_cube = xBinnedModulationCube(mod_cube_file_path) mod_cube.fit() pol_degree_array[j,:] = numpy.array([r.polarization_degree for r in mod_cube.fit_results]) pol_degree_error_array[j,:] = numpy.array([r.polarization_degree_error for r in mod_cube.fit_results]) pol_angle_array[j,:] = numpy.array([numpy.degrees(r.phase) for r in mod_cube.fit_results]) pol_angle_error_array[j,:] = numpy.array([numpy.degrees(r.phase_error) for
EMAX = 8.0 EBINS = 1 TIME = 2000000 SEED = 0 PLOT = True RA_CORE = 187.70634 DEC_CORE = 12.39109 RA_JET = 187.70233 DEC_JET = 12.392549 RAD_PSF = 11 / 60.0 """Main pipeline object. """ PIPELINE = xPipeline(clobber=True) def plot(cmap_file): full_map = xBinnedMap(cmap_file) fig = full_map.plot(show=False) # fig.show_circles(RA, DEC, RAD/60., lw=1) fig.show_circles(RA_CORE, DEC_CORE, RAD_PSF / 60.0, lw=1, color="white") fig.show_circles(RA_JET, DEC_JET, RAD_PSF / 60.0, lw=1, color="white") fig.recenter(RA + 0.003, DEC, 1 / 60.0) fig.show_colorscale(stretch="linear", cmap="afmhot", vmin=80, vmax=1500) fig.add_label(0.1, 0.9, "XIPE 2 Ms", relative=True, size="xx-large", color="white", horizontalalignment="left") image = xFITSImage(IMAGE_FITS_PATH, build_cdf=False) fig2 = image.plot(show=False) fig2.recenter(RA + 0.003, DEC, 1 / 60.0) fig2.show_colorscale(stretch="log", cmap="afmhot", vmin=2, vmax=200)