-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummary.qmd
More file actions
99 lines (82 loc) · 3.02 KB
/
Copy pathsummary.qmd
File metadata and controls
99 lines (82 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: "Resumen operativo"
format:
html:
toc: true
page-layout: full
execute:
echo: false
warning: false
message: false
---
```{r}
source("R/page_helpers.R")
vf_load_packages()
layers <- vf_read_csv(c("data/processed/layers.csv", "assets/aemet/layers.csv"))
aemet_latest <- vf_latest_aemet_layers(layers)
status <- vf_status_table()
```
## Estado general
```{r}
vf_kable(status)
```
## AEMET
Esta página usa la misma convención que el mapa principal: `D00` se interpreta como **Día 1** de la fecha del fichero AEMET, sin desplazamiento adicional de un día. Si hay varias emisiones en disco, solo se resume la **última emisión** presente en el catálogo.
```{r}
vf_kable(vf_aemet_overview(layers))
```
```{r}
if (nrow(aemet_latest) > 0) {
capa <- dplyr::coalesce(
as.character(vf_get_col(aemet_latest, "label")),
as.character(vf_get_col(aemet_latest, "layer_id")),
as.character(vf_get_col(aemet_latest, "url")),
as.character(vf_get_col(aemet_latest, "source_file"))
)
aemet_table <- tibble::tibble(
area = aemet_latest$area_label,
fecha_emision = as.character(aemet_latest$issue_date),
fecha_valida = as.character(aemet_latest$valid_date),
horizonte = aemet_latest$forecast_label,
dia = aemet_latest$forecast_day,
capa = capa
) |>
dplyr::arrange(.data$area, .data$fecha_valida, .data$dia)
vf_kable(aemet_table, caption = "Capas AEMET publicadas")
} else {
knitr::asis_output("_No hay capas AEMET publicadas._\n")
}
```
## FIRMS y alertas
```{r}
firms <- vf_read_csv(c("data/processed/firms_active_fires.csv", "data/processed/firms.csv", "assets/firms/firms_active_fires.csv"))
alerts <- vf_read_csv(c("data/processed/operational_alerts.csv", "assets/alerts/operational_alerts.csv"))
fires_total <- nrow(firms)
alerts_total <- nrow(alerts)
fire_cols <- names(firms)
alert_cols <- names(alerts)
summary_rows <- tibble::tibble(
indicador = c("Detecciones FIRMS", "Alertas operativas"),
valor = c(fires_total, alerts_total)
)
vf_kable(summary_rows)
```
```{r}
if (nrow(alerts) > 0) {
show_cols <- intersect(c("alert_id", "cluster_id", "admin_name", "ccaa", "province", "n_detections", "max_frp", "last_seen", "priority", "level"), names(alerts))
if (length(show_cols) == 0) show_cols <- names(alerts)[seq_len(min(8, ncol(alerts)))]
vf_kable(alerts |> dplyr::select(dplyr::all_of(show_cols)) |> utils::head(20), caption = "Primeras alertas operativas")
} else {
knitr::asis_output("_No hay alertas operativas en el último procesamiento._\n")
}
```
## EFFIS
```{r}
effis <- vf_read_csv(c("data/processed/effis_layers.csv", "assets/effis/effis_layers.csv"))
if (nrow(effis) > 0) {
effis_cols <- intersect(c("layer", "label", "date", "base_url", "version", "format", "url"), names(effis))
vf_kable(effis |> dplyr::select(dplyr::all_of(effis_cols)), caption = "Capas EFFIS publicadas")
} else {
knitr::asis_output("EFFIS está desactivado o no se ha encontrado una capa visual actual publicable. Se evita mostrar información histórica como si fuera operativa.\n")
}
```