Commit 9f82f559 authored by Brandon Piotrzkowski's avatar Brandon Piotrzkowski

Fix bug where sky map is not found due to comma versioning

parent 7dd7bed1
......@@ -2,7 +2,9 @@
## 1.1.2 (unreleased)
- No changes yet
- Remove check that sky map has `public` and `sky_loc` tags in order to
fix bug preventing finding files with version numbers in their extension
(e.g. LALinference.fits.gz,0)
## 1.1.1 (2019-09-11)
......
......@@ -52,7 +52,6 @@ def main_dict(gracedb_id, client):
if pipeline not in other_pipelines and pipeline != preferred_pipeline:
other_pipelines.append(pipeline)
voevents = client.voevents(gracedb_id).json()['voevents']
log = client.logs(gracedb_id).json()['log']
gpstime = float(preferred_event['gpstime'])
event_time = astropy.time.Time(gpstime, format='gps').utc
......@@ -71,16 +70,11 @@ def main_dict(gracedb_id, client):
skyloc_pipeline = guess_skyloc_pipeline(filename)
issued_time = astropy.time.Time(root.find('./Who/Date').text).datetime
if filename not in skymaps:
for message in log:
if filename == message['filename']:
tag_names = message['tag_names']
if 'sky_loc' in tag_names and 'public' in tag_names:
skymaps[filename] = dict(
alert_type=alert_type,
pipeline=skyloc_pipeline,
filename=filename,
latency=issued_time-event_time.datetime)
break
skymaps[filename] = dict(
alert_type=alert_type,
pipeline=skyloc_pipeline,
filename=filename,
latency=issued_time-event_time.datetime)
skymaps = list(skymaps.values())
preferred_event_files = client.files(preferred_event_id).json()
em_brightfile = 'em_bright.json'
......
......@@ -9,8 +9,8 @@
"psd.xml.gz": "https://gracedb-dev1.ligo.org/api/events/S5678/files/psd.xml.gz",
"coinc.xml,0": "https://gracedb-dev1.ligo.org/api/events/S5678/files/coinc.xml,0",
"bayestar.fits.gz": "https://gracedb-dev1.ligo.org/api/events/S5678/files/bayestar.fits.gz",
"LALInference.v1.fits.gz": "https://gracedb-dev1.ligo.org/api/events/S5678/files/LALInference.v1.fits.gz",
"LALInference.v1.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/S5678/files/LALInference.v1.fits.gz,0",
"LALInference.fits.gz": "https://gracedb-dev1.ligo.org/api/events/S5678/files/LALInference.fits.gz",
"LALInference.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/S5678/files/LALInference.fits.gz,0",
"S5678-1-Initial.xml": "https://gracedb-dev1.ligo.org/api/events/S5678/files/S5678-1-Initial.xml",
"S5678-2-Update.xml": "https://gracedb-dev1.ligo.org/api/events/S5678/files/S5678-2-Update.xml",
"coincidence_far.json": "https://gracedb-dev1.ligo.org/api/events/S5678/files/coincidence_far.json"
......
......@@ -54,7 +54,7 @@
<Description>Specific low-latency search</Description>
</Param>
<Group type="GW_SKYMAP" name="LALInference">
<Param name="skymap_fits" dataType="string" value="https://gracedb-playground.ligo.org/apibasic/superevents/S5678/files/LALInference.v1.fits.gz" ucd="meta.ref.url" unit=""> <Description>Sky Map FITS basic auth protected</Description>
<Param name="skymap_fits" dataType="string" value="https://gracedb-playground.ligo.org/apibasic/superevents/S5678/files/LALInference.fits.gz,0" ucd="meta.ref.url" unit=""> <Description>Sky Map FITS basic auth protected</Description>
<Description>Sky Map FITS</Description>
</Param>
</Group>
......
......@@ -128,7 +128,7 @@
"created": "2018-06-28 04:08:44 UTC",
"self": "https://gracedb-dev1.ligo.org/api/events/S5678/log/10",
"issuer": "leo.singer@LIGO.ORG",
"filename": "LALInference.v1.fits.gz",
"filename": "LALInference.fits.gz",
"tags": "https://gracedb-dev1.ligo.org/api/events/S5678/log/10/tag/",
"N": 10
},
......
......@@ -15,7 +15,7 @@ class MockGraceDb(object):
self.service_url = service
def _open(self, graceid, filename):
if filename.endswith('.fits.gz'):
if '.fits.gz' in filename:
# url = ('https://dcc.ligo.org/public/0145/T1700453/001/'
# 'LALInference_v1.fits.gz')
# filename = astropy.utils.data.download_file(url, cache=True)
......@@ -29,7 +29,7 @@ class MockGraceDb(object):
return open(pkg_resources.resource_filename(
__name__, filename), 'rb')
elif filename.endswith('.fits'):
elif '.fits' in filename:
return open(pkg_resources.resource_filename(
__name__, filename), 'rb')
......
......@@ -42,7 +42,7 @@ console_scripts =
[options.package_data]
ligo.followup_advocate.templates = *.jinja2
ligo.followup_advocate.test = data/*/*.json, data/*/files/*.json, data/*/files/*.xml, data/*/files/*.fits, data/*/files/*.fits.gz, data/*/files/*.data
ligo.followup_advocate.test = data/*/*.json, data/*/files/*.json, data/*/files/*.xml, data/*/files/*.fits, data/*/files/*.fits.gz, data/*/files/*.data, data/*/files/*.fits.gz*
[versioneer]
VCS = git
......
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