You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' * For `product_id` `"VNP46A2"`, uses `Gap_Filled_DNB_BRDF-Corrected_NTL`.
477
528
#' * For `product_id`s `"VNP46A3"` and `"VNP46A4"`, uses `NearNadir_Composite_Snow_Free`.
478
529
#' For information on other variable choices, see [here](https://ladsweb.modaps.eosdis.nasa.gov/api/v2/content/archives/Document%20Archive/Science%20Data%20Product%20Documentation/VIIRS_Black_Marble_UG_v1.2_April_2021.pdf); for `VNP46A1`, see Table 3; for `VNP46A2` see Table 6; for `VNP46A3` and `VNP46A4`, see Table 9.
479
-
#' @param quality_flag_rm Quality flag values to use to set values to `NA`. Each pixel has a quality flag value, where low quality values can be removed. Values are set to `NA` for each value in ther `quality_flag_rm` vector. (Default: `c(255)`).
530
+
#' @param quality_flag_rm Quality flag values to use to set values to `NA`. Each pixel has a quality flag value, where low quality values can be removed. Values are set to `NA` for each value in ther `quality_flag_rm` vector. (Default: `NULL`).
#' - `2`: Poor-quality, Outlier, potential cloud contamination, or other issues
486
-
#' - `255`: No retrieval, Fill value (masked out on ingestion)
487
537
#'
488
538
#'
489
539
#' For `VNP46A3` and `VNP46A4` (monthly and annual data):
490
540
#' - `0`: Good-quality, The number of observations used for the composite is larger than 3
491
541
#' - `1`: Poor-quality, The number of observations used for the composite is less than or equal to 3
492
542
#' - `2`: Gap filled NTL based on historical data
493
-
#' - `255`: Fill value
494
543
#' @param check_all_tiles_exist Check whether all Black Marble nighttime light tiles exist for the region of interest. Sometimes not all tiles are available, so the full region of interest may not be covered. If `TRUE`, skips cases where not all tiles are available. (Default: `TRUE`).
495
544
#' @param interpol_na When data for more than one date is downloaded, whether to interpolate `NA` values in rasters using the `raster::approxNA` function. Additional arguments for the `raster::approxNA` function can also be passed into `bm_extract` (eg, `method`, `rule`, `f`, `ties`, `z`, `NA_rule`). (Default: `FALSE`).
496
545
#' @param output_location_type Where to produce output; either `memory` or `file`. If `memory`, functions returns a dataframe in R. If `file`, function exports a `.csv` file and returns `NULL`.
#' * For `product_id` `"VNP46A2"`, uses `Gap_Filled_DNB_BRDF-Corrected_NTL`.
785
834
#' * For `product_id`s `"VNP46A3"` and `"VNP46A4"`, uses `NearNadir_Composite_Snow_Free`.
786
835
#' For information on other variable choices, see [here](https://ladsweb.modaps.eosdis.nasa.gov/api/v2/content/archives/Document%20Archive/Science%20Data%20Product%20Documentation/VIIRS_Black_Marble_UG_v1.2_April_2021.pdf); for `VNP46A1`, see Table 3; for `VNP46A2` see Table 6; for `VNP46A3` and `VNP46A4`, see Table 9.
787
-
#' @param quality_flag_rm Quality flag values to use to set values to `NA`. Each pixel has a quality flag value, where low quality values can be removed. Values are set to `NA` for each value in ther `quality_flag_rm` vector. (Default: `c(255)`).
836
+
#' @param quality_flag_rm Quality flag values to use to set values to `NA`. Each pixel has a quality flag value, where low quality values can be removed. Values are set to `NA` for each value in ther `quality_flag_rm` vector. (Default: `NULL`).
#' - `2`: Poor-quality, Outlier, potential cloud contamination, or other issues
794
-
#' - `255`: No retrieval, Fill value (masked out on ingestion)
795
843
#'
796
844
#'
797
845
#' For `VNP46A3` and `VNP46A4` (monthly and annual data):
798
846
#' - `0`: Good-quality, The number of observations used for the composite is larger than 3
799
847
#' - `1`: Poor-quality, The number of observations used for the composite is less than or equal to 3
800
848
#' - `2`: Gap filled NTL based on historical data
801
-
#' - `255`: Fill value
802
849
#' @param check_all_tiles_exist Check whether all Black Marble nighttime light tiles exist for the region of interest. Sometimes not all tiles are available, so the full region of interest may not be covered. If `TRUE`, skips cases where not all tiles are available. (Default: `TRUE`).
803
850
#' @param interpol_na When data for more than one date is downloaded, whether to interpolate `NA` values using the `raster::approxNA` function. Additional arguments for the `raster::approxNA` function can also be passed into `bm_raster` (eg, `method`, `rule`, `f`, `ties`, `z`, `NA_rule`). (Default: `FALSE`).
804
851
#' @param output_location_type Where to produce output; either `memory` or `file`. If `memory`, functions returns a raster in R. If `file`, function exports a `.tif` file and returns `NULL`.
@@ -181,8 +182,6 @@ For daily data, the quality values are:
181
182
182
183
* 2: Poor-quality, Outlier, potential cloud contamination, or other issues
183
184
184
-
* 255: No retrieval, Fill value (masked out on ingestion)
185
-
186
185
We can map quality by using the `Mandatory_Quality_Flag` variable.
187
186
188
187
```{r, results='hide'}
@@ -206,8 +205,7 @@ quality_df <- quality_df %>%
206
205
dplyr::mutate(value_str = case_when(
207
206
value == 0 ~ "0: High-quality, persistent",
208
207
value == 1 ~ "1: High-quality, ephemeral",
209
-
value == 2 ~ "2: Poor-quality",
210
-
value == 255 ~ "255: Fill value"
208
+
value == 2 ~ "2: Poor-quality"
211
209
))
212
210
213
211
##### Map
@@ -228,15 +226,15 @@ ggplot() +
228
226
229
227
#### Nighttime lights for good quality observations <aname="daily-goodq"></a>
230
228
231
-
The `quality_flag_rm` parameter determines which pixels are set to `NA` based on the quality indicator. By default, only pixels with a value of `255`are filtered out. However, if we only want data for good quality pixels, we can adjust the `quality_flag_rm` parameter.
229
+
The `quality_flag_rm` parameter determines which pixels are set to `NA` based on the quality indicator. By default, no pixels are filtered out (except for those that are assigned a "fill value" by BlackMarble, which are always removed). However, if we only want data for good quality pixels, we can adjust the `quality_flag_rm` parameter.
@@ -446,8 +444,6 @@ For monthly and annual data, the quality values are:
446
444
447
445
* 2: Gap filled NTL based on historical data
448
446
449
-
* 255: Fill value
450
-
451
447
We can map quality by adding `_Quality` to the variable name.
452
448
453
449
```{r, results='hide'}
@@ -471,8 +467,7 @@ quality_df <- quality_df %>%
471
467
dplyr::mutate(value_str = case_when(
472
468
value == 0 ~ "0: Good quality",
473
469
value == 1 ~ "1: Poor quality",
474
-
value == 2 ~ "2: Gap filled",
475
-
value == 255 ~ "255: Fill value"
470
+
value == 2 ~ "2: Gap filled"
476
471
))
477
472
478
473
##### Map
@@ -493,15 +488,15 @@ ggplot() +
493
488
494
489
#### Nighttime lights for good quality observations <aname="ma-ntl_gq"></a>
495
490
496
-
The `quality_flag_rm` parameter determines which pixels are set to `NA` based on the quality indicator. By default, only pixels with a value of `255`are filtered out. However, if we also want to remove poor quality pixels, we can adjust the `quality_flag_rm` parameter.
491
+
The `quality_flag_rm` parameter determines which pixels are set to `NA` based on the quality indicator. By default, no pixels are filtered out (except for those that are assigned a "fill value" by BlackMarble, which are always removed). However, if we also want to remove poor quality pixels, we can adjust the `quality_flag_rm` parameter.
0 commit comments