diff --git a/bin/pygrb/pycbc_pygrb_grb_info_table b/bin/pygrb/pycbc_pygrb_grb_info_table index 9c88861a00e..5f8e92496b6 100644 --- a/bin/pygrb/pycbc_pygrb_grb_info_table +++ b/bin/pygrb/pycbc_pygrb_grb_info_table @@ -42,18 +42,18 @@ __program__ = "pycbc_pygrb_grb_info_table" parser = argparse.ArgumentParser(description=__doc__, formatter_class= argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("--version", action="version", version=__version__) -parser.add_argument("--trigger-time", action="store", - default=None, required=True, +parser.add_argument("--trigger-time", type=int, + required=True, help="GPS time of the GRB.") -parser.add_argument("--ra", action="store", - default=None, required=True, - help="Right ascention (degrees) of the GRB.") -parser.add_argument("--dec", action="store", - default=None, required=True, - help="Declination (degrees) of the GRB.") -parser.add_argument("--sky-error", action="store", +parser.add_argument("--ra", type=float, + required=True, + help="Right ascension (radians) of the GRB.") +parser.add_argument("--dec", type=float, + required=True, + help="Declination (radians) of the GRB.") +parser.add_argument("--sky-error", type=float, default=0, required=False, - help="Sky-localisation error (degrees) of the GRB.") + help="Sky-localisation error (radians) of the GRB.") parser.add_argument("--ifos", action="store", nargs='+', default=None, required=True, help="List containing the active IFOs.") @@ -69,14 +69,14 @@ data = [[]] data[0].append(str(opts.trigger_time)) headers.append('GPS Time') -utc_time = datetime(*lal.GPSToUTC(int(opts.trigger_time))[0:6]).strftime("%B %d %Y, %H:%M:%S UTC") +utc_time = datetime(*lal.GPSToUTC(opts.trigger_time)[0:6]).strftime("%B %d %Y, %H:%M:%S UTC") data[0].append(utc_time) headers.append('Coordinated Universal Time') -data[0].append(str(opts.ra)) +data[0].append(str(numpy.rad2deg(opts.ra))) headers.append('R.A. (deg)') -data[0].append(str(opts.dec)) +data[0].append(str(numpy.rad2deg(opts.dec))) headers.append('Dec (deg)') data[0].append(str(opts.sky_error)) @@ -88,8 +88,8 @@ headers.append('IFOs') for ifo in opts.ifos: antenna = Detector(ifo) factor = get_antenna_dist_factor(antenna, - numpy.deg2rad(float(opts.ra)), - numpy.deg2rad(float(opts.dec)), + opts.ra, + opts.dec, float(opts.trigger_time)) data[0].append('%.3f' % factor) headers.append(ifo + ' Antenna Factor') diff --git a/bin/pygrb/pycbc_pygrb_page_tables b/bin/pygrb/pycbc_pygrb_page_tables index bc19b545f93..c3dc22aec3b 100755 --- a/bin/pygrb/pycbc_pygrb_page_tables +++ b/bin/pygrb/pycbc_pygrb_page_tables @@ -117,8 +117,8 @@ def load_missed_found_injections(hdf_file, ifos, snr_threshold, bank_file, found_data['rec_mass1'], found_data['rec_mass2']) # Recovered RA and Dec - found_data['rec_ra'] = np.degrees(inj_data['network/ra'][...]) - found_data['rec_dec'] = np.degrees(inj_data['network/dec'][...]) + found_data['rec_ra'] = inj_data['network/ra'][...] + found_data['rec_dec'] = inj_data['network/dec'][...] # Statistics values for param in ['coherent_snr', 'reweighted_snr', 'null_snr']: found_data[param] = inj_data['network/%s' % param][...] @@ -375,8 +375,8 @@ if lofft_outfile: mchirps[trig_index], bank_data['spin1z'][trig_data['network/template_id'][trig_index]], bank_data['spin2z'][trig_data['network/template_id'][trig_index]], - np.degrees(trig_data['network/ra'][trig_index]), - np.degrees(trig_data['network/dec'][trig_index]), + trig_data['network/ra'][trig_index], + trig_data['network/dec'][trig_index], trig_data['network/coherent_snr'][trig_index], trig_data['network/my_network_chisq'][trig_index], trig_data['network/null_snr'][trig_index]] @@ -500,8 +500,8 @@ if onsource_file: mchirps[on_trigs['network/template_id'][trig_index]], bank_data['spin1z'][on_trigs['network/template_id'][trig_index]], bank_data['spin2z'][on_trigs['network/template_id'][trig_index]], - np.degrees(on_trigs['network/ra'][trig_index]), - np.degrees(on_trigs['network/dec'][trig_index]), + on_trigs['network/ra'][trig_index], + on_trigs['network/dec'][trig_index], on_trigs['network/coherent_snr'][trig_index], on_trigs['network/my_network_chisq'][trig_index], on_trigs['network/null_snr'][trig_index]] + \ diff --git a/pycbc/workflow/matched_filter.py b/pycbc/workflow/matched_filter.py index f16baacbfc8..877b4113d7e 100644 --- a/pycbc/workflow/matched_filter.py +++ b/pycbc/workflow/matched_filter.py @@ -31,7 +31,6 @@ import os import logging -from math import radians from pycbc.workflow.core import FileList, make_analysis_dir from pycbc.workflow.jobsetup import (select_matchedfilter_class, @@ -243,12 +242,11 @@ def setup_matchedfltr_dax_generated_multi(workflow, science_segs, datafind_outs, if match_fltr_exe == 'pycbc_multi_inspiral': exe_class = select_matchedfilter_class(match_fltr_exe) - # Right ascension + declination provided in degrees, - # so convert to radians + # Right ascension + declination must be provided in radians cp.set('inspiral', 'ra', - str(radians(float(cp.get('workflow', 'ra'))))) + cp.get('workflow', 'ra')) cp.set('inspiral', 'dec', - str(radians(float(cp.get('workflow', 'dec'))))) + cp.get('workflow', 'dec')) # At the moment we aren't using sky grids, but when we do this code # might be used then. # from pycbc.workflow.grb_utils import get_sky_grid_scale