Skip to content

Commit 6a9eba2

Browse files
ranghettipkautio
andauthored
v. 2.0.10.9000 (#269)
* Update develop version * Fix default version (latest of each product instead than 006) * Fix version retrieval in manual mode * Changing default version from 006 to 061 * Product updates. Removed 060 versions. Product updates. Removed 060 versions. Updated all 060-only products to 061. * Product updates. Removed 060 versions. * Fix wrong filename --------- Co-authored-by: pkautio <[email protected]>
1 parent 082b1a3 commit 6a9eba2

File tree

8 files changed

+56
-41
lines changed

8 files changed

+56
-41
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: MODIStsp
22
Title: Find, Download and Process MODIS Land Products
33
Data
44
Type: Package
5-
Version: 2.0.10
5+
Version: 2.0.10.9000
66
Authors@R: c(person("Lorenzo", "Busetto",
77
role = c("aut"),
88
comment = c(ORCID = '0000-0001-9634-6038')),

R/MODIStsp.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#' a list of available product names using function `MODIStsp_get_prodnames`,
2424
#' Default: NULL
2525
#' @param prod_version Version of the selected MODIS product.
26-
#' Currently versions `"006"` and/or `"061"` can be chosen.
27-
#' Default value is `"006"` until decommission of this version will be
28-
#' announced by USGS.
29-
#' Products with version `"061` are experimental: in case users would encounter
26+
#' Currently versions `"061"` and/or `"006"` can be chosen.
27+
#' Default value is `"061"` (version `"006"` was decommissioned by USGS on
28+
#' July 31, 2023, products of this version will be gradually removed).
29+
#' In case users would encounter
3030
#' an error in the encoding of bands or quality flags they are encouraged
3131
#' to report it by opening a new issue on GitHub at
3232
#' \url{https://github.com/ropensci/MODIStsp/issues}.

R/check_proc_opts.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ check_proc_opts <- function(proc_opts) {
1717
assertthat::see_if(o$selprod %in% names(prod_opts),
1818
msg = "`selprod` is not a valid MODIS product name!")
1919

20-
prod_layers <- MODIStsp_get_prodlayers(o$selprod)
20+
prod_layers <- MODIStsp_get_prodlayers(o$selprod, prodver = o$prod_version)
2121
assertthat::see_if(all(o$bandsel %in% prod_layers$bandnames),
2222
msg = "Some of `bandsel` are not a valid bandname of the selected MODIS product!")
2323

inst/ExtData/MODIStsp_ProdOpts.RData

-497 KB
Binary file not shown.
-6.62 KB
Binary file not shown.

inst/ExtData/mstp_defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"selcat": null,
33
"selprod": null,
4-
"prod_version": "006",
4+
"prod_version": "061",
55
"sensor": "Both",
66
"bandsel": null,
77
"quality_bandsel": null,

inst/app/srv/mstp_prds_srv.R

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
#initialize product and category selectors ----
22

3-
general_opts <- reactiveValues()
3+
# general_opts <- reactiveValues()
44
rv <- reactiveValues()
55

66
output$selcats <-renderUI({
7-
curprod <- which(names(prod_opt_list) == general_opts$selprod)
8-
curcat <- mod_prod_cat$cat[curprod]
9-
shiny::selectInput("selcat", "Product Category",
10-
choices = unique(mod_prod_cat$cat),
11-
selected = curcat)
7+
# curprod <- which(names(prod_opt_list) == general_opts$selprod)
8+
# curcat <- mod_prod_cat$cat[curprod]
9+
shiny::selectInput(
10+
"selcat", "Product Category",
11+
choices = unique(mod_prod_cat$cat),
12+
selected = unique(mod_prod_cat$cat)[1]
13+
)
1214
})
1315

1416
output$selprods <-renderUI({
15-
shiny::selectInput("selprod",
16-
label = shiny::span("Product Name\u2000",
17-
shiny::actionLink("help_product",
18-
shiny::icon("question-circle"))),
19-
choices = mod_prod_list[mod_prod_cat$cat == (input$selcat)],
20-
selected = general_opts$selprod)
17+
shiny::selectInput(
18+
"selprod",
19+
label = shiny::span(
20+
"Product Name\u2000",
21+
shiny::actionLink("help_product", shiny::icon("question-circle"))
22+
),
23+
choices = mod_prod_list[mod_prod_cat$cat == (input$selcat)],
24+
selected = mod_prod_list[mod_prod_cat$cat == (input$selcat)][1]
25+
)
2126
})
2227

2328
output$selvers <-renderUI({
2429
req(input$selprod)
25-
shiny::selectInput("selver",
26-
label = shiny::span("Version\u2000",
27-
shiny::actionLink("help_version",
28-
shiny::icon("question-circle"))),
29-
choices = names(prod_opt_list[[input$selprod]]),
30-
selected = general_opts$selver)
30+
shiny::selectInput(
31+
"selver",
32+
label = shiny::span(
33+
"Version\u2000",
34+
shiny::actionLink("help_version", shiny::icon("question-circle"))
35+
),
36+
choices = names(prod_opt_list[[input$selprod]]),
37+
selected = rev(names(prod_opt_list[[input$selprod]]))[1]
38+
)
3139
})
3240

3341
shiny::observeEvent(input$prodinfo, {
@@ -45,10 +53,12 @@ observe({
4553

4654
curlayers <- prod_opt_list[[curprod]][[input$selver]]$bandnames
4755
curlabels <- prod_opt_list[[curprod]][[input$selver]]$band_fullnames
48-
shiny::updateCheckboxGroupInput(session, "sel_layers",
49-
choiceNames = curlabels,
50-
choiceValues = curlayers,
51-
selected = general_opts$curlayers)
56+
shiny::updateCheckboxGroupInput(
57+
session, "sel_layers",
58+
choiceNames = curlabels,
59+
choiceValues = curlayers,
60+
selected = NULL
61+
)
5262

5363
# shiny::isolate(general_opts$curlayers) <- ""
5464

@@ -60,10 +70,12 @@ observe({
6070
qalabels <- "No Quality layers available"
6171
}
6272

63-
shiny::updateCheckboxGroupInput(session, "sel_qual",
64-
choiceNames = qalabels,
65-
choiceValues = qalayers,
66-
selected = general_opts$curqual)
73+
shiny::updateCheckboxGroupInput(
74+
session, "sel_qual",
75+
choiceNames = qalabels,
76+
choiceValues = qalayers,
77+
selected = NULL
78+
)
6779

6880
# shiny::isolate(general_opts$curqual) <- ""
6981

@@ -90,10 +102,12 @@ observe({
90102
indlayers <- NA
91103
indlabels <- "No Indexes available"
92104
}
93-
shiny::updateCheckboxGroupInput(session, "sel_ind",
94-
choiceNames = indlabels,
95-
choiceValues = indlayers,
96-
selected = general_opts$curindexes)
105+
shiny::updateCheckboxGroupInput(
106+
session, "sel_ind",
107+
choiceNames = indlabels,
108+
choiceValues = indlayers,
109+
selected = NULL
110+
)
97111

98112
# shiny::isolate(general_opts$curindexes) <- ""
99113
})
@@ -209,6 +223,7 @@ shiny::observe({
209223
shiny::observe({
210224
shiny::req(input$selprod)
211225
shiny::req(input$selver)
226+
shiny::req(input$selver %in% names(prod_opt_list[[input$selprod]]))
212227
indexes <- MODIStsp_get_prodlayers(input$selprod, input$selver)$indexes_bandnames
213228
if (is.null(indexes)) {
214229
shinyjs::disable("addindex")

man/MODIStsp.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)