I downloaded NASA's Black Marble monthly nighttime light NTL data, VNP46A3
<https://ladsweb.modaps.eosdis.nasa.gov/missions-and-measurements/products/VNP46A3/>.
In a previous question
<https://gis.stackexchange.com/questions/466571/extent-not-found-on-nasas-black-marble-monthly-images-how-to-set-it/466574?noredirect=1#comment761916_466574>
of mine the reprojection worked perfectly but now it seems that it doesn't.
For example, I wanted to download NTL data for the city of Mumbai, India.
After reprojecting the NTL (product 5 (All_Angles_Snow_Free) from the .h5)
the result is attached here
<https://drive.google.com/drive/folders/1V115zpdU2-5fXssI6iWv_F6aNu4E5qA7>.

At the bottom if the image is a shp of Mumbai (downloaded from GADM) and
the red circle in the top indicates where Mumbai is in the NTL image.
Clearly something's not right.

I downloaded the image from here
<https://ladsweb.modaps.eosdis.nasa.gov/missions-and-measurements/products/VNP46A3/>
(LAADS-DAAC, Level-1 and Atmosphere Archive & Distribution System
Distributed Active Archive Center). The code I used to extract the NTL
radiance image is:

library(terra)

wd <- "path/"

r <- rast(paste0(wd, "VNP46A3.A2018091.h25v07.001.2021125122857.h5"))
crs(r) <- "epsg:4326"

2400*(15/(60*60))

h = 25
v = 7

ext(r) = c(-180+h*10,-180+(h+1)*10, (v-2)*10,(v-1)*10)

ntl <- r[[5]]

writeRaster(ntl, paste0(wd, "ntl.tif"), overwrite = TRUE)

Why the code worked perfectly in the previous question and now it doesn't?
>From here
<https://drive.google.com/drive/folders/1V115zpdU2-5fXssI6iWv_F6aNu4E5qA7>
you can download the .h5 image if you don't want to use NASA's website. I
am using R 4.3.1 and RStudio 2023.06.2+561.

-- 
Tziokas Nikolaos
Cartographer

Tel:(+44)07561120302
LinkedIn <http://linkedin.com/in/nikolaos-tziokas-896081130>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to