Skip to content

Commit e26a0c0

Browse files
committed
some new plots in force-level2-report template + fix of empty sensor
1 parent 582bb31 commit e26a0c0

File tree

1 file changed

+78
-2
lines changed

1 file changed

+78
-2
lines changed

rstats/force-level2-report.Rmd

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ time <- mm + ss / 60
4343
4444
id <- log %>%
4545
gsub(":.*", "", .) %>%
46+
gsub("/ ", "", .) %>%
4647
basename()
4748
4849
id_split <- id %>% strsplit("_")
@@ -108,7 +109,24 @@ data <- data.frame(status,
108109
year = format(date, "%Y"),
109110
month = format(date, "%m"),
110111
week = format(date, "%W"),
111-
doy = format(date, "%j"),
112+
doy = format(date, "%j"),
113+
yearhalf = paste(
114+
format(date, "%Y"),
115+
format(date, "%m") %>%
116+
as.integer() %>%
117+
`/`(6) %>%
118+
ceiling(),
119+
sep = "-"
120+
),
121+
yearquarter = paste(
122+
format(date, "%Y"),
123+
format(date, "%m") %>%
124+
as.integer() %>%
125+
`/`(3) %>%
126+
ceiling(),
127+
sep = "-"
128+
),
129+
yearmonth = format(date, "%Y-%m"),
112130
dc,
113131
cc,
114132
sc,
@@ -166,6 +184,30 @@ fig <- plot_ly(data = data %>%
166184
fig
167185
```
168186

187+
```{r plot-l1-yearhalf, echo = FALSE, warning = FALSE}
188+
fig <- plot_ly(data = data %>%
189+
count(sensor, yearhalf),
190+
x = ~yearhalf, y = ~n, color = ~sensor, type = "bar") %>%
191+
layout(yaxis = list(title = "# of L1 images"), barmode = "stack")
192+
fig
193+
```
194+
195+
```{r plot-l1-yearquarter, echo = FALSE, warning = FALSE}
196+
fig <- plot_ly(data = data %>%
197+
count(sensor, yearquarter),
198+
x = ~yearquarter, y = ~n, color = ~sensor, type = "bar") %>%
199+
layout(yaxis = list(title = "# of L1 images"), barmode = "stack")
200+
fig
201+
```
202+
203+
```{r plot-l1-yearmonth, echo = FALSE, warning = FALSE}
204+
fig <- plot_ly(data = data %>%
205+
count(sensor, yearmonth),
206+
x = ~yearmonth, y = ~n, color = ~sensor, type = "bar") %>%
207+
layout(yaxis = list(title = "# of L1 images"), barmode = "stack")
208+
fig
209+
```
210+
169211
```{r plot-l1-month, echo = FALSE, warning = FALSE}
170212
fig <- plot_ly(data = data %>%
171213
count(sensor, month),
@@ -182,6 +224,14 @@ fig <- plot_ly(data = data %>%
182224
fig
183225
```
184226

227+
```{r plot-l1-ts, echo = FALSE, warning = FALSE}
228+
fig <- plot_ly(data = data %>%
229+
count(sensor, ts),
230+
x = ~ts, y = ~n, color = ~sensor, type = "bar") %>%
231+
layout(yaxis = list(title = "# of L1 images"), barmode = "stack")
232+
fig
233+
```
234+
185235

186236
# Number of Level 2 images
187237

@@ -205,6 +255,33 @@ fig <- plot_ly(data = data %>%
205255
fig
206256
```
207257

258+
```{r plot-l2-yearhalf, echo = FALSE, warning = FALSE}
259+
fig <- plot_ly(data = data %>%
260+
group_by(sensor, yearhalf) %>%
261+
summarise(n = sum(nchip, na.rm = TRUE), .groups = "drop"),
262+
x = ~yearhalf, y = ~n, color = ~sensor, type = "bar") %>%
263+
layout(yaxis = list(title = "# of L2 images"), barmode = "stack")
264+
fig
265+
```
266+
267+
```{r plot-l2-yearquarter, echo = FALSE, warning = FALSE}
268+
fig <- plot_ly(data = data %>%
269+
group_by(sensor, yearquarter) %>%
270+
summarise(n = sum(nchip, na.rm = TRUE), .groups = "drop"),
271+
x = ~yearquarter, y = ~n, color = ~sensor, type = "bar") %>%
272+
layout(yaxis = list(title = "# of L2 images"), barmode = "stack")
273+
fig
274+
```
275+
276+
```{r plot-l2-yearmonth, echo = FALSE, warning = FALSE}
277+
fig <- plot_ly(data = data %>%
278+
group_by(sensor, yearmonth) %>%
279+
summarise(n = sum(nchip, na.rm = TRUE), .groups = "drop"),
280+
x = ~yearmonth, y = ~n, color = ~sensor, type = "bar") %>%
281+
layout(yaxis = list(title = "# of L2 images"), barmode = "stack")
282+
fig
283+
```
284+
208285
```{r plot-l2-month, echo = FALSE, warning = FALSE}
209286
fig <- plot_ly(data = data %>%
210287
group_by(sensor, month) %>%
@@ -224,7 +301,6 @@ fig
224301
```
225302

226303

227-
228304
# Coverages
229305

230306
Data cover is the percentage of valid pixels in an input image, i.e. excl. the black border or SLC-off stripes.

0 commit comments

Comments
 (0)