Extract NASA VIIRS data in R

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Extract NASA VIIRS data in R

Miluji Sb
Dear all,

Hope everyone is keeping safe.

I am trying to extract/read VIIRS nighttime lights data but the output
seems rather strange.

I have uploaded the file here
<https://drive.google.com/open?id=1zpqXJ8AlEcnk6ApRb75tfQc4-Y8AfK5h> so as
not exceed the size limit of the email.

## Code ##
library(ncdf4)
library(rgdal)

netcdf_file <- c("VNP02DNB_NRT.A2020069.1048.001.nc
<http://vnp02dnb_nrt.a2020069.1048.001.nc/>")
nl <- brick(netcdf_file, lvar=0, values=TRUE,
varname="observation_data/DNB_observations")

## Detail ##
class      : RasterLayer
dimensions : 3232, 4064, 13134848  (nrow, ncol, ncell)
resolution : 1, 1  (x, y)
extent     : 0.5, 4064.5, 0.5, 3232.5  (xmin, xmax, ymin, ymax)
crs        : NA
source     : C:/Users/shour/Desktop/VNP02DNB_NRT.A2020069.1048.001.nc
<http://vnp02dnb_nrt.a2020069.1048.001.nc/>
names      : DNB.observations.at.pixel.locations
zvar       : observation_data/DNB_observations

The spatial resolution is supposed to be 750m but this shows 1°. What am I
doing wrong? Any help will be greatly appreciated. Thank you.

Cross-posted in R sig-geo but no reply - apologies.

Sincerely,

Millu

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.