Commit 00f473e3 authored by Chris Pankow's avatar Chris Pankow
Browse files

common_cl.py: Add lambdas to command line utils

Original: f3cc370602320db3c6c5269540b2fad1b25e1d2d
parent ed271ee3
......@@ -132,6 +132,8 @@ def add_intrinsic_params(optp):
intrinsic_params.add_option("--pin-to-sim", help="Pin values to sim_inspiral table entry.")
intrinsic_params.add_option("--mass1", type=float, help="Value of first component mass, in solar masses. Required if not providing coinc tables.")
intrinsic_params.add_option("--mass2", type=float, help="Value of second component mass, in solar masses. Required if not providing coinc tables.")
intrinsic_params.add_option("--lambda1", type=float, help="Value of first tidal parameter. Optional, ignored if not given.")
intrinsic_params.add_option("--lambda2", type=float, help="Value of first tidal parameter. Optional, ignored if not given.")
optp.add_option_group(intrinsic_params)
return optp
......
......@@ -54,17 +54,21 @@ CMAP = { "right_ascension": "longitude",
# FIXME: Find way to intersect given cols with valid cols when making table.
# Otherwise, we'll have to add them manually and ensure they all exist
sim_valid_cols = ["process_id", "simulation_id", "inclination", "longitude", "latitude", "polarization", "geocent_end_time", "geocent_end_time_ns", "coa_phase", "distance", "mass1", "mass2", "alpha1", "alpha2", "alpha3", "psi0", "psi3"]
sim_valid_req = ["process_id", "simulation_id", "alpha1", "alpha2", "alpha3"]
sim_valid_ext = ["inclination", "longitude", "latitude", "polarization", "geocent_end_time", "geocent_end_time_ns", "coa_phase", "distance"]
sim_valid_int = ["mass1", "mass2", "psi0", "psi3"]
sngl_valid_cols = ["process_id", "event_id", "snr", "tau0", "tau3"]
multi_valid_cols = ["process_id", "event_id", "snr"]
def append_samples_to_xmldoc(xmldoc, sampdict):
write_cols = set(sim_valid_ext + sim_valid_int) & set(sampdict.keys())
write_cols = list(write_cols) + sim_valid_req
try:
si_table = table.get_table(xmldoc, lsctables.SimInspiralTable.tableName)
new_table = False
# Warning: This will also get triggered if there is *more* than one table
except ValueError:
si_table = lsctables.New(lsctables.SimInspiralTable, sim_valid_cols)
si_table = lsctables.New(lsctables.SimInspiralTable, write_cols)
new_table = True
keys = sampdict.keys()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment