/comparar lets you validate the accuracy of your manual observations by placing them side-by-side with official AEMET data for the same station. ClimApp fetches live measurements, calculates absolute differences across all weather parameters, and automatically flags the result if any value strays beyond acceptable bounds.
How it works
1
Navigate to /comparar
Open the comparison form using the Comparar link in the navigation bar, or go directly to
/comparar.2
Enter municipality name and date
Type the municipality name exactly as it was used when you logged the manual entry, and select the observation date. The form sends the date in
YYYY-MM-DD format; the controller normalises it to DD/MM/YYYY before querying stored records.3
ClimApp finds your manual record
The backend calls
filter_records(municipio=municipio.title(), fecha=fecha_target) and looks for an entry where fuente == "manual". If no match is found, the comparison cannot proceed and an error message is returned.4
ClimApp fetches live AEMET data
Using the
estacion_id from your manual record, ClimApp queries the AEMET observations endpoint via WeatherAPIService._obtener_datos_crudos() and locates the entry whose idema matches the station ID.5
Differences are calculated and displayed
Each weather parameter is compared using
calculate_difference(), which returns the absolute difference rounded to two decimal places. The results are displayed in a summary table alongside a hay_discrepancia flag.Discrepancy thresholds
A comparison is marked as discrepant (hay_discrepancia: true) if any of the following absolute differences are exceeded:
These thresholds are defined in
compare_controller.py’s has_discrepancy() function:
What the result shows
A successful comparison returns a structured result rendered on the page:Raw AEMET data is passed through
normalizar_datos_aemet() before the comparison is performed. This normalisation step maps AEMET field names and units to ClimApp’s internal schema, ensuring that both records use the same keys and the same units before differences are calculated.