/registro accepts a full set of weather parameters, validates each value against defined ranges, and persists the record locally — tagged with fuente: "manual" so it can be distinguished from agency data throughout the rest of the application.
What you can record
Each manual entry captures the following fields:Date
The observation date in DD/MM/YYYY format. The form uses this as the primary temporal key for filtering and comparison.
Temperature
Air temperature in degrees Celsius. Accepted range: −50 °C to 60 °C.
Humidity
Relative humidity as a percentage. Accepted range: 0% to 100%.
Wind speed
Wind speed in km/h. Must be ≥ 0.
Rainfall
Accumulated rainfall in millimetres. Must be ≥ 0.
Station ID
The AEMET station identifier (
estacion_id) associated with your observation.Municipality
The municipality name. Loaded automatically when you select a station from the dropdown, or resolved as a fallback from
estacion_por_municipio.json.How to submit a reading
1
Navigate to /registro
Open the manual entry form by clicking Registro in the navigation bar or going directly to
/registro.2
Select a municipality
Choose your municipality from the dropdown. The list is populated from
static/js/estacion_por_municipio.json, which maps each municipality to its AEMET station ID. Selecting a municipality automatically sets the station ID field.3
Fill in the weather values
Enter the observed values for temperature, humidity, wind speed, rainfall, and date. All fields are required.
4
Submit the form
Click Submit. The browser sends a JSON payload to
POST /api/registrar. If validation passes, the record is written to storage and a success message is displayed. If any value is out of range or the date format is wrong, a validation error is returned.Validation rules
Every submission is checked byvalidate_weather_data in utils/validators.py before being written to disk. The following rules must all pass:
string
required
Observation date. Must be a parseable date string. The canonical format is
DD/MM/YYYY; DD-MM-YYYY and YYYY-MM-DD are also accepted by the validator, but the frontend always sends DD/MM/YYYY.number
required
Air temperature in °C. Must be a finite number in the range −50 to 60 (inclusive).
number
required
Relative humidity in %. Must be a finite number in the range 0 to 100 (inclusive).
number
required
Wind speed in km/h. Must be a finite number ≥ 0.
number
required
Rainfall in mm. Must be a finite number ≥ 0.
Storage
Validated records are appended todata/registros_climaticos.json by JSONRepository.guardar(). The file is created automatically if it does not exist. Each saved record includes two extra fields injected by the controller:
fuente: "manual" tag is what allows the historical records view and the comparison tool to distinguish your entries from AEMET-sourced data.