The comparison tool atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/adrianaarang/climapp/llms.txt
Use this file to discover all available pages before exploring further.
/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
Navigate to /comparar
Open the comparison form using the Comparar link in the navigation bar, or go directly to
/comparar.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.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.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.Discrepancy thresholds
A comparison is marked as discrepant (hay_discrepancia: true) if any of the following absolute differences are exceeded:
| Parameter | Threshold |
|---|---|
| Temperature | > 3 °C |
| Humidity | > 10% |
| Wind speed | > 10 km/h |
| Rainfall | > 5 mm |
compare_controller.py’s has_discrepancy() function:
What the result shows
A successful comparison returns a structured result rendered on the page:| Field | Description |
|---|---|
municipio | Municipality name (title-cased) |
fecha | Observation date in DD/MM/YYYY format |
manual | The full manual record retrieved from local JSON storage |
api | The normalised AEMET record for the same station |
diferencias | Absolute differences for temperatura, humedad, viento, and lluvia |
hay_discrepancia | true if any threshold is exceeded; false otherwise |
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.