Beispiel #1
0
                                         h=True,
                                         verbose=False)

skymap_header = {name: val for name, val in skymap_header}
ev_mjd = skymap_header['EVENTMJD']
ev_run, ev_id = skymap_header['RUNID'], skymap_header['EVENTID']
source = {"Skipped Events": [(ev_run, ev_id)]}
source['Name'] = "RUN {} EVENT {} time window {:.2e}".format(
    str(skymap_header['RUNID']), str(skymap_header['EVENTID']), args.deltaT)
source['alert_type'] = 'track'

deltaT = args.deltaT / 86400.
event_mjd = ev_mjd
start_mjd = event_mjd - (deltaT / 2.)
stop_mjd = event_mjd + (deltaT / 2.)
start = Time(start_mjd, format='mjd').iso
stop = Time(stop_mjd, format='mjd').iso

f = FastResponseAnalysis(skymap_files[args.index],
                         start,
                         stop,
                         save=False,
                         alert_event=True,
                         smear=args.smear,
                         **source)
inj = f.initialize_injector(
    gamma=2.5)  #just put this here to initialize f.spatial_prior
ts = f.unblind_TS()
smear_str = 'smeared/' if args.smear else 'norm_prob/'
res = f.save_results(alt_path=output_paths + smear_str)
Beispiel #2
0
print('')   

import logging as log
from astropy.time import Time
from astropy.coordinates import Angle
import astropy.units as u
from fast_response.FastResponseAnalysis import FastResponseAnalysis

log.basicConfig(level=log.ERROR)
source = final_args
source['alert_event'] = args.alert_event
####################### INITIALIZE FAST RESPONSE OBJECT #######################
f = FastResponseAnalysis(source['Location'], source['Start Time'], source['Stop Time'], **source)
# Point source, gw, etc. handling done in analysis object instantiation

f.unblind_TS()
f.plot_ontime()
f.ns_scan()
f.calc_pvalue(ntrials = args.ntrials)
if not args.nodiag:
    f.make_dNdE()
    f.plot_tsd()
    f.upper_limit()
    
results = f.save_results()
f.generate_report()
if args.document:
    subprocess.call(['cp','-r',results['analysispath'],
        '/home/apizzuto/public_html/FastResponse/webpage/output/{}'.format(results['analysisid'])])
    utils.updateFastResponseWeb(results)