Esempio n. 1
0
Filename format is:

MJD_05d_bgsub_cl50.pha

"""
from __future__ import division, print_function
import numpy as np
from astropy.io import fits
import matplotlib.pyplot as plt
import subprocess
import glob
from tqdm import tqdm
import Lv0_dirs

Lv0_dirs.global_par()

bin_size = '05d'  #bins of 1 day!


def mathpha(bin_size, filetype):
    """
    Function that takes in a bin size, and does MATHPHA on the set of pha files.
    The file names are already saved in the binned .ffphot files. The function
    will output pha files of the format 'MJD_binsize_' + filetype + '_cl50.pha'!

    bin_size - bin size in days
    filetype - either 'bgsub' or 'bg' or 'cl'!
    """

    normfile = Lv0_dirs.NGC300 + 'n300_ulx.bgsub_cl50_RGnorm_' + bin_size + '.ffphot'
Esempio n. 2
0
Getting diagnostic plots - so say, how does angular offset change over time
for some desired time interval and/or energy range.

"""
from __future__ import division, print_function
import numpy as np
from astropy.io import fits
import Lv0_dirs,Lv0_fits2dict,Lv0_nicer_housekeeping,Lv1_data_bin,Lv2_mkdir
import Lv3_diagnostics_display
from matplotlib.backends.backend_pdf import PdfPages
from scipy import stats
import pathlib
import matplotlib.pyplot as plt

Lv0_dirs.global_par() #obtaining the global parameters

def diag_all(eventfile,par_list,tbin_size,mode,diag_vars):
    """
    Get the diagnostic plots for a desired time interval.
    [Likely too large a range in time (and energy) to be sufficiently useful for
    diagnosis.]

    eventfile - path to the event file. Will extract ObsID from this for the NICER files.
    par_list - A list of parameters we'd like to extract from the FITS file
    (e.g., from eventcl, PI_FAST, TIME, PI,)
    tbin_size - the size of the time bins (in seconds!)
    >> e.g., tbin_size = 2 means bin by 2s
    >> e.g., tbin_size = 0.05 means bin by 0.05s!
    mode - whether we want to show or save the plot.
    diag_vars - a dictionary where each key = 'att','mkf','hk', or 'cl', and