Skip to content

Commit

Permalink
Merge pull request #913 from TOMToolkit/fix/error_mag_error_backwards…
Browse files Browse the repository at this point in the history
…-compatibility

add magnitude_error compatability
  • Loading branch information
jchate6 authored May 6, 2024
2 parents 8a01339 + 775f2ad commit a7413e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tom_dataproducts/alertstreams/hermes.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ def create_hermes_phot_table_row(datum, **kwargs):
phot_table_row['brightness'] = datum.value['magnitude']
else:
phot_table_row['limiting_brightness'] = datum.value.get('limit', None)
if datum.value.get('error', None):
phot_table_row['brightness_error'] = datum.value['error']
error_value = datum.value.get('error', datum.value.get('magnitude_error', None))
if error_value is not None:
phot_table_row['brightness_error'] = error_value
return phot_table_row


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
{% if datum.limit %}>{% endif %}
{{ datum.magnitude|truncate_number }}
</td>
<td>{{ datum.error|floatformat:4 }}</td>
{% if datum.error %}
<td>{{ datum.error|floatformat:4 }}</td>
{% else %}
<td>{{ datum.magnitude_error|floatformat:4 }}</td>
{% endif %}
<td>{{ datum.source }}</td>
</tr>
{% empty %}
Expand Down
2 changes: 1 addition & 1 deletion tom_dataproducts/templatetags/dataproduct_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def get_photometry_data(context, target, target_share=False):
'source': reduced_datum.source_name,
'filter': reduced_datum.value.get('filter', ''),
'telescope': reduced_datum.value.get('telescope', ''),
'error': reduced_datum.value.get('error', '')
'error': reduced_datum.value.get('error', reduced_datum.value.get('magnitude_error', ''))
}

if 'limit' in reduced_datum.value.keys():
Expand Down

0 comments on commit a7413e4

Please sign in to comment.