Commit 6e174797 authored by Tanner Prestegard's avatar Tanner Prestegard

Add CLI command for updating a GRB event

parent 09fac61f
......@@ -15,7 +15,8 @@ class UpdateCommand(RegisteredCommandBase):
name = "update"
description = textwrap.dedent("""\
Update an event with a new event file, update a superevent's
parameters, or update an existing superevent signoff
parameters, update a GRB event's parameters, or update an existing
superevent signoff
""").rstrip()
subcommands = registry
......@@ -131,3 +132,54 @@ class UpdateSupereventCommand(UpdateChildBase):
args.superevent_id, t_0=args.t_0, t_start=args.t_start,
t_end=args.t_end, preferred_event=args.preferred_event
)
class UpdateGrbEventCommand(UpdateChildBase):
name = "grbevent"
description = "Update GRB event-specific parameters"
long_description = textwrap.dedent("""\
Update ra, dec, error_radius, t90, redshift, and/or declination for
a GRB event.
""").rstrip()
parent_parsers = (graceid_parser,)
def add_custom_arguments(self, parser):
parser.add_argument(
'--ra',
type=float,
help="New right ascension value for the GRB event (degrees)"
)
parser.add_argument(
'--dec',
type=float,
help="New declination value for the GRB event (degrees)"
)
parser.add_argument(
'--error-radius',
type=float,
help="New error radius value for the GRB event (degrees)"
)
parser.add_argument(
'--t90',
type=float,
help="New t90 value for the GRB event (seconds)"
)
parser.add_argument(
'--redshift',
type=float,
help="New redshift value for the GRB event"
)
parser.add_argument(
'--designation',
type=str,
help=("New designation for the GRB event (GRByymmddx or "
"GRByymmddfff format)")
)
return parser
def run(self, client, args):
return client.update_grbevent(
args.graceid, ra=args.ra, dec=args.dec,
error_radius=args.error_radius, t90=args.t90,
redshift=args.redshift, designation=args.designation
)
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