pkgOptions: Set or get options for the Rnightlights package

Description Usage Arguments Value Supported options Examples

View source: R/options.R

Description

Set or get options for the Rnightlights package

Usage

1

Arguments

...

Option names to retrieve option values or [key]=[value] pairs to set options.

Value

if an option name is supplied as a parameter this returns the value, else a list of all options is returned.

Supported options

The following options are supported

configName_OLS.Y

(character) The regex to uniquely identify the tile file to use out of the downloaded tile .tar. The data are available as annual composited series:

  • cf_cvg (Cloud-free coverages): tally the total number of observations that went into each 30 arc second grid cell. This image can be used to identify areas with low numbers of observations where the quality is reduced. In some years there are areas with zero cloud- free observations in certain locations.

  • avg_vis (Raw average visible band): contains the average of the visible band digital number values with no further filtering. Data values range from 0-63. Areas with zero cloud-free observations are represented by the value 255.

  • stable_lights (Cleaned up avg_vis): contains the lights from cities, towns, and other sites with persistent lighting, including gas flares. Ephemeral events, such as fires have been discarded. Then the background noise was identified and replaced with values of zero. Data values range from 1-63. Areas with zero cloud-free observations are represented by the value 255.

  • pct_lights (Percent detection freq): the percentage of observations where light is detected per grid cell.

  • avg_lights_x_pct (Avg vis band x percent detection freq): derived from the average visible band digital number(DN) of cloud-free light detections multiplied by the percent frequency of light detection. The inclusion of the percent frequency of detection term normalizes the resulting digital values for variations in the persistence of lighting. For instance, the value for a light only detected half the time is discounted by 50%. Note that this product contains detections from fires and a variable amount of background noise. This is the product used to infer gas flaring volumes from the nighttime lights.

configName_VIIRS.D

(character) The regex to uniquely identify the tile file to use out of the downloaded tile .tgz. The version 1 monthly series is run globally using two different configurations:

  • vcmcfg (Stray Light Removed): Excludes any data impacted by stray light.

  • vcmsl (Stray Light Corrected): includes data impacted by stray light if the radiance values have undergone the stray- light correction procedure.

The "vcmsl" version, that includes the stray-light corrected data, will have more data coverage toward the poles, but will be of reduced quality.

It is up to the users to determine which set is best for their applications. The annual versions are only made with the "vcm" version, excluding any data impacted by stray light.

configName_VIIRS.M

(character) The regex to uniquely identify the tile file to use out of the downloaded monthly .tgz tile. Has the same options as configName.VIIRS.D

configName_VIIRS.Y

(character) The regex to uniquely identify the tile file to use out of the downloaded tile .tgz. The annual products can have other values for the config shortname (Field 5). They are:

  • vcm-orm (VIIRS Cloud Mask - Outlier Removed): This product contains cloud-free average radiance values that have undergone an outlier removal process to filter out fires and other ephemeral lights.

  • vcm-orm-ntl (VIIRS Cloud Mask - Outlier Removed - Nighttime Lights): This product contains the "vcm-orm" average, with background (non-lights) set to zero.

  • vcm-ntl (VIIRS Cloud Mask - Nighttime Lights): This product contains the "vcm" average, with background (non-lights) set to zero.

cropMaskMethod

(character) The method to use to clip the nightlight raster tiles to the country boundaries

deleteTiles

(character) whether to delete tiles after processing may be useful where diskspace is a concern

dirNlData

(character) The directory to store the extracted data files in

dirNlRoot

character) The root directory storing the package data

dirNlTiles

(character) The directory in which to store the downloaded VIIRS raster tiles

dirPolygon

(character) The directory to store the downloaded country administration level polygons

dirRasterOutput

(character) The directory in which to store the clipped country rasters

dirRasterWeb

(character) The directory in which to store the rasters resampled for web display

dirZonals

(character) The directory in which to store the zonal statistics country polygon

downloadMethod

(character) The download method to use

extractMethod

(character) The method to use to extract data from the rasters

gdalCacheMax

(numeric) The maximum memory gdal should use in gdal_rasterize

ntLtsIndexUrlOLS.Y

(character) The url with the OLS tile index

ntLtsIndexUrlVIIRS

(character) The url with the VIIRS tile index

numCores

(integer) The number of processor cores to use when extractMethod = "raster"

omitCountries

(character) The countries to exclude in processing

stats

(character) The statistics to calculate for country regions. The default are sum and mean. Any other aggregate statistics can be included. Also any aggregate function accessible in the current environment can be added.

tmpDir

(character) Change the temporary directory for processing rasters. Not in use

Examples

1
2
3
4
5
6
7
8
#retrieve the current cropMaskMethod
pkgOptions("cropMaskMethod")

#set the cropMaskMethod
pkgOptions(cropMaskMethod="gdal")

#retrieve all options
pkgOptions()

Rnightlights documentation built on Aug. 29, 2019, 5:02 p.m.