{% extends "base.html" %} {% load i18n static ui help charts %} {% comment %} Step 2, Check quality (#77): the thresholds (the R app's six), the checks run as a "qc" job with its progress, and the results: the summary, the daily charts with the flagged values, a section per check with its table (linked both ways with the charts), the missing data per year, the distribution plots, the downloads, and the way back to correct the file. Context from views.qc_context. {% endcomment %} {% block title %}{% translate "Check quality" %}{% endblock %} {% block head %}{% if review %}{% chart_scripts %}{% endif %} {% if job and not job.is_finished %}{% endif %}{% endblock %} {% block steps %}{% include "components/steps.html" %}{% endblock %} {% block content %}

{% translate "Check quality" %}

{% blocktranslate with name=analysis.station_name first=analysis.summary.first_date last=analysis.summary.last_date trimmed %} {{ name }}, {{ first }} to {{ last }}. Climpact checks every value for likely errors. It does not change your data: you look at what it finds and decide whether to correct the file or to continue.{% endblocktranslate %}

{% if inspection and not inspection.ok %}{% include "stations/_problems.html" with file_name=replace_form.files.station_file.name %}{% endif %}
{% if job and not job.is_finished %} {% include "stations/_qc_progress.html" %} {% elif job.status == "failed" %} {% elif job.status == "cancelled" %} {% translate "The checks were stopped. Run them again below." as cancelled_message %} {% include "components/alert.html" with kind="info" message=cancelled_message title="" %} {% elif not review %} {% translate "The checks have not been run on this file yet. Choose the thresholds below, or keep the defaults, and run them." as not_run %} {% include "components/alert.html" with kind="info" message=not_run title="" %} {% endif %} {% if review %}{% include "stations/_qc_summary.html" %}{% endif %}
{% if review %}

{% translate "Daily values" %}

{% help_topic "qc.daily_series" %}

{% translate "Flagged values are circled. Click a circle to find it in the tables below; “Show on chart” in a table brings you back to the day here. Drag across a chart to zoom in." %}

{% url "charts:station_daily" analysis.pk as daily_url %}{% url "stations:series" analysis.pk as series_url %} {% for chart in charts %}

{{ chart.label }}

{% with chart_url=daily_url|add:"?variable="|add:chart.variable %} {% include "components/chart_frame.html" with id=chart.id title=chart.label data_url=chart_url csv_href=series_url height="18rem" only %} {% endwith %}
{% endfor %}

{% translate "What the checks found" %}

{% for group in check_groups %}

{% if group.kind == "error" %}{% translate "Usually errors in the data" %}{% else %}{% translate "May be genuine: worth a look" %}{% endif %}

{% for item in group.items %}{% include "stations/_qc_check.html" with check=item.check page=item.page %}{% endfor %}
{% endfor %}
{% include "stations/_qc_missing.html" %} {% include "stations/_qc_distributions.html" %}

{% translate "Quality-control files" %}

{% translate "The same files as Climpact for R writes in its qc folder, as CSV." %}

{% if review.zip %}

{% url "jobs:file" job.pk review.zip as zip_url %}{% blocktranslate with size=job|file_size:review.zip|filesizeformat asvar zip_label %}Download all quality-control files (zip, {{ size }}){% endblocktranslate %}{% include "components/button.html" with label=zip_label href=zip_url icon="download" variant="secondary" %}

{% endif %}
{% endif %}
{% if review or job and not job.is_finished %}{# while the checks run they are not to be started by hand (#114) #}
{% icon "sliders" %}{% if review %}{% translate "Change the thresholds and check again" %}{% else %}{% translate "Change the thresholds" %}{% endif %}{% icon "chevron-down" %}
{% include "stations/_qc_form.html" %}
{% else %}

{% translate "Thresholds" %}

{% include "stations/_qc_form.html" %} {% endif %}

{% translate "Correct the file and upload it again" %}

{% blocktranslate trimmed %}Climpact does not edit data. To correct a value, change it in your file (or write it as -99.9 if it is wrong and the right value is not known), then upload the corrected file here. The station details and the thresholds are kept, and the checks run again straight away.{% endblocktranslate %}

{% csrf_token %} {% include "components/dropzone.html" with field=replace_form.station_file hint="" %}
{% translate "Upload and check again" as replace_label %} {% include "components/button.html" with label=replace_label type="submit" variant="secondary" icon="upload" %}

{% icon "arrow-left" "" "icon--flip" %} {% translate "Change the station details or the base period" %}

{% include "stations/_retention.html" %}
{% csrf_token %} {% translate "Delete this data now" as delete_label %} {% include "components/button.html" with label=delete_label type="submit" variant="ghost" size="sm" icon="close" %} {% translate "Start again with another station" %}
{% endblock %}