Skip to content

Commit

Permalink
Merge branch 'master' into issue-260-use-toast-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ajstewart committed Nov 20, 2020
2 parents 88440d7 + 66636fe commit 775c233
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

#### Added

- Added custom 404.html and 500.html templates for error pages [#415](https://github.com/askap-vast/vast-pipeline/pull/415)
- Added ability to export measurement_pairs.parqyet as an arrow file [#393](https://github.com/askap-vast/vast-pipeline/pull/393).
- Added new fields to detail pages and source and measurement tables [#406](https://github.com/askap-vast/vast-pipeline/pull/406).
- Added new fields to source query page (island flux ratio, min and max fluxes) [#406](https://github.com/askap-vast/vast-pipeline/pull/406).
Expand Down Expand Up @@ -58,6 +59,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
#### Changed

- Changed alerts to use the Bootstrap toasts system [#419](https://github.com/askap-vast/vast-pipeline/pull/419).
- Images table on pipeline run detail page changed to order by datetime by default [#417](https://github.com/askap-vast/vast-pipeline/pull/417).
- Changed config argument `CREATE_MEASUREMENTS_ARROW_FILE` -> `CREATE_MEASUREMENTS_ARROW_FILES` [#393](https://github.com/askap-vast/vast-pipeline/pull/393).
- Naming of average flux query fields to account for other min max flux fields [#406](https://github.com/askap-vast/vast-pipeline/pull/406).
- Expanded `README.md` to include `DjangoQ` and UI job scheduling information [#404](https://github.com/askap-vast/vast-pipeline/pull/404).
Expand Down Expand Up @@ -90,6 +92,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

#### Fixed

- Fixed new sources rms measurement returns when no measurements are valid [#417](https://github.com/askap-vast/vast-pipeline/pull/417).
- Fixed measuring rms values from selavy created NAXIS=3 FITS images [#417](https://github.com/askap-vast/vast-pipeline/pull/417).
- Fixed rms value calculation in non-cluster forced extractions [#402](https://github.com/askap-vast/vast-pipeline/pull/402).
- Increase request limit for gunicorn [#398](https://github.com/askap-vast/vast-pipeline/pull/398).
- Fixed max source Vs metric to being an absolute value [#391](https://github.com/askap-vast/vast-pipeline/pull/391).
Expand All @@ -110,6 +114,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
#### List of PRs

- [#419](https://github.com/askap-vast/vast-pipeline/pull/419) feat: Update alerts to use toasts.
- [#415](https://github.com/askap-vast/vast-pipeline/pull/415) feat: Added custom 404 and 500 templates.
- [#393](https://github.com/askap-vast/vast-pipeline/pull/393) feat: Added measurement_pairs arrow export.
- [#406](https://github.com/askap-vast/vast-pipeline/pull/406) feat, model: Added island flux ratio columns.
- [#402](https://github.com/askap-vast/vast-pipeline/pull/402) fix: Fixed rms value calculation in non-cluster forced extractions.
Expand Down
21 changes: 21 additions & 0 deletions templates/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% extends "base.html" %}

{% load static %}

{% block content %}
<!-- Begin Page Content -->
<div class="container-fluid">

<!-- 404 Error Text -->
<div class="text-center">
<div class="error mx-auto" data-text="404">404</div>
<p class="lead text-gray-800 mb-5">Page Not Found</p>
<p class="text-gray-500 mb-0">It looks like you found a transient page...</p>
<p class="text-gray-500 mb-0">Please report this error if it is unexpected.</p>
<a href="{% url 'index' %}">&larr; Back to Home</a>
</div>

</div>
<!-- /.container-fluid -->

{% endblock content %}
20 changes: 20 additions & 0 deletions templates/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "base.html" %}

{% load static %}

{% block content %}
<!-- Begin Page Content -->
<div class="container-fluid">

<!-- 404 Error Text -->
<div class="text-center">
<div class="error mx-auto" data-text="500">500</div>
<p class="lead text-gray-800 mb-5">Internal Server Error</p>
<p class="text-gray-500 mb-0">Please report this error if it is unexpected.</p>
<a href="{% url 'index' %}">&larr; Back to Home</a>
</div>

</div>
<!-- /.container-fluid -->

{% endblock content %}
38 changes: 23 additions & 15 deletions vast_pipeline/pipeline/new_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,7 @@ def get_image_rms_measurements(
with fits.open(image) as hdul:
header = hdul[0].header
wcs = WCS(header, naxis=2)

try:
# ASKAP tile images
data = hdul[0].data[0, 0, :, :]
except Exception as e:
# ASKAP SWarp images
data = hdul[0].data
data = hdul[0].data.squeeze()

# Here we mimic the forced fits behaviour,
# sources within 3 half BMAJ widths of the image
Expand Down Expand Up @@ -144,6 +138,15 @@ def get_image_rms_measurements(

group = group.loc[valid_indexes]

if group.empty:
# early return if all sources failed range check
logger.debug(
'All sources out of range in new source rms measurement'
f' for image {image}.'
)
group['img_diff_true_rms'] = np.nan
return group

# Now we also need to check proximity to NaN values
# as forced fits may also drop these values
coords = SkyCoord(
Expand Down Expand Up @@ -171,15 +174,20 @@ def get_image_rms_measurements(

valid_indexes = group[nan_valid].index.values

rms_values = data[
array_coords[0][nan_valid],
array_coords[1][nan_valid]
]
if np.any(nan_valid):
# only run if there are actual values to measure
rms_values = data[
array_coords[0][nan_valid],
array_coords[1][nan_valid]
]

# not matched ones will be NaN.
group.loc[
valid_indexes, 'img_diff_true_rms'
] = rms_values.astype(np.float64) * 1.e3

# not matched ones will be NaN.
group.loc[
valid_indexes, 'img_diff_true_rms'
] = rms_values.astype(np.float64) * 1.e3
else:
group['img_diff_true_rms'] = np.nan

return group

Expand Down
1 change: 1 addition & 0 deletions vast_pipeline/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ def RunDetail(request, id):
'Beam PA (deg)'
],
'search': True,
'order': [1, 'asc']
}

meas_fields = [
Expand Down

0 comments on commit 775c233

Please sign in to comment.