LocSim

Detector module

class Detector.Detector(name='det', azimuth_angle='0:0:0', zenith_angle='0:0:0', noise=True, background_rate=10.0, window=2.0, lat='37:56:24.7', lon='75:27:59', elev=550000.0)[source]
altitude
cart2polar(x, y, z)[source]
exposure(ra, dec, FoV=False, alt=-10.0, index=0.77, horizon=90.0)[source]

This function takes an ra and a dec and reports the exposure at that point. If you declare FoV to be true, it’ll assume the exposure is uniform across the field of view. Otherwise, it will return an effective areas scaled by a cosine dependance up to the horizon.

Parameters:
  • ra (the right ascension of the test point) –
  • dec (the declination of the test point) –
  • FoV (If True, assumes a flat exposure. If false, assumes a cosine dependance.) –
  • alt (The location of the Earth's limb. No exposure below this point (degrees)) –
  • index (the scaling of the cosine dependance.) –
  • horizon (A cut on the field of view of a detector. No exposure below this point (degrees)) –
Returns:

float

Return type:

the exposure at the test point

get_separation(grb)[source]
polar2cart(theta, phi)[source]
sign_time
sign_times
throw_grb(grb)[source]
trigger_time
triggered_counts
triggered_counts_error

GRB module

class GRB.GRB(ra, dec, amplitude=10000.0, decay=2.0, T0=0.0, binz=1.0, real=False, filename='')[source]
loadFRED()[source]
loadReal(filename, nbins=20000.0, sub=True)[source]

Spacecraft module

class Spacecraft.Spacecraft(pointings={'01': ('0:0:0', '5:0:0'), '02': ('30:0:0', '20:0:0'), '03': ('60:0:0', '35:0:0'), '04': ('90:0:0', '10:0:0'), '05': ('120:0:0', '25:0:0'), '06': ('150:0:0', '40:0:0'), '07': ('180:0:0', '15:0:0'), '08': ('210:0:0', '30:0:0'), '09': ('240:0:0', '45:0:0'), '10': ('270:0:0', '20:0:0'), '11': ('300:0:0', '35:0:0'), '12': ('330:0:0', '50:0:0')}, lat='37:56:24.7', lon='75:27:59', elev=550000.0, window=4.0, background_rate=10.0, noise=True)[source]

The pointings are just key,item pairs of the pointing directions of the detectors on the spacecraft (respect to 0,0 at zenith). The default are 12 detectors pointing every 30 degrees in azimuth and 15 degrees in zenith (offset a bit).

detnum
throw_grb(grb)[source]
throw_grbs(grbs, scaled=False, save=False, filename='grbs.pkl')[source]

Stats module

Stats.addErrors(real_counts, training_counts)[source]

Adds all of the errors together in quadrature

Parameters:
  • real_counts (the array of real grb counts in each detector) –
  • training_counts (the arrary of traning counts in each detector) –
Returns:

null – numpy array of the errors

Return type:

array

Stats.calcNorms(real_counts, training_counts)[source]

Calculates the norm between the vectors in two numpy arrays.

Parameters:
  • real_counts (the array of real grb counts in each detector) –
  • training_counts (the arrary of traning counts in each detector) –
Returns:

null – numpy array of the norm between all of the vectors

Return type:

array

Stats.calcNormsWithError(real_counts, training_counts, real_counts_with_error)[source]

Utils module

Utils.deg2DMS(DEC)[source]

Borrowed from Sylvain Baumont http://supernovae.in2p3.fr/~baumont/

Utils.deg2HMS(RA)[source]

Borrowed from Sylvain Baumont http://supernovae.in2p3.fr/~baumont/