isDaylight.Rd
Determine whether times are during daylight within a region
isDaylight(datetime = NULL, timezone = "UTC", bbox = bbox_CONUS)
datetime | Desired datetime in any Y-m-d H [MS] format or |
---|---|
timezone | Timezone in which to interpret the |
bbox | Bounding box for region of interest, Default |
Logical vector.
# \donttest{ library(MazamaSatelliteUtils) setSatelliteDataDir("~/Data/Satellite") # BBOX AS CREATED BY sp::bbox() library(MazamaSpatialUtils) mx <- subset(SimpleCountries, countryCode == "MX") mx_bbox <- bbox(mx) isDaylight( datetime = "2019-09-06 12", bbox = mx_bbox, timezone = "UTC" )#> [1] TRUE# BBOX AS CREATED BY raster::extent() goesaodc_downloadAOD( satID = "G16", datetime = "201924918", timezone = "UTC", isJulian = TRUE) G16_filepath <- "OR_ABI-L2-AODC-M6_G16_s20192491826095_e20192491828468_c20192491835127.nc" nc <- goesaodc_openFile(G16_filepath) raster <- goesaodc_createRaster(nc, res = 0.1, dqfLevel = 2) extent <- raster::extent(raster) isDaylight( datetime = "2019-09-06 12", bbox = extent, timezone = "UTC")#> [1] TRUE# }