Assistance Required: Spatial Extent and CRS Issues with GPM IMERG V07 Data
Posted: Tue Dec 31, 2024 11:49 am America/New_York
I am encountering some issues with spatial extent and CRS when processing the .nc4 data downloaded from GPM IMERG Final Precipitation L3 1-day 0.1° x 0.1° V07 (GPM_3IMERGDF) - https://search.earthdata.nasa.gov/search?q=GPM_3IMERGDF_07&lat=-0.0703125.
Project Overview:
My objective is to download daily precipitation data and use zonal statistics to calculate the daily average precipitation for each village in the Philippines.
Steps Taken:
1. I downloaded IMERG V07 files from Earthdata (e.g., 3B-DAY.MS.MRG.3IMERG.20110110-S000000-E235959.V07B.nc4) and imported them into R as raster data.
2. I uploaded a shapefile containing ADM4 administrative boundaries for the Philippines.
Upon inspection, I noticed the following issues:
1. The .nc4 file lacks a CRS.
2. The longitude and latitude in the spatial extent are flipped.
Challenges Faced:
1. Missing CRS:
Without the correct CRS, aligning the data with the shapefile fails during zonal statistics calculations.
2. Flipped Spatial Extent:
1)Attempting to correct the extent with R code (ext(raster_data) <- c(current_extent[3],
current_extent[4], current_extent[1], current_extent[2])) results in incorrect precipitation values.
2)Using t(raster_data$precipitation) to transpose the raster also produces invalid results.
3)Attempts to correct the file in QGIS were unsuccessful.
Request for Guidance:
Could you please help address these issues:
1. The missing CRS and the flipped spatial extent in the .nc4 files from GPM IMERG V07?
2. Suggestions for the correct steps to align these files with my shapefile for ADM4 in the Philippines?
Additional Query:
I noticed that the GPM IMERG Final Precipitation L3 1-day data can be visualized and directly downloaded as .tif files from GIOVANNI, which perfectly aligns with my shapefile. However, downloading daily data from 2005-01-01 to 2020-12-31 involves more than 5,000 files, which makes manual download impractical. I try to automate this process using the RSelenium package in R, but it was unsuccessful.
Could you please advise on how to batch download .tif files directly from GIOVANNI or an alternative method to automate this process?
Thank you very much for your time and help. I deeply appreciate your help in addressing these issues!
Project Overview:
My objective is to download daily precipitation data and use zonal statistics to calculate the daily average precipitation for each village in the Philippines.
Steps Taken:
1. I downloaded IMERG V07 files from Earthdata (e.g., 3B-DAY.MS.MRG.3IMERG.20110110-S000000-E235959.V07B.nc4) and imported them into R as raster data.
2. I uploaded a shapefile containing ADM4 administrative boundaries for the Philippines.
Upon inspection, I noticed the following issues:
1. The .nc4 file lacks a CRS.
2. The longitude and latitude in the spatial extent are flipped.
Challenges Faced:
1. Missing CRS:
Without the correct CRS, aligning the data with the shapefile fails during zonal statistics calculations.
2. Flipped Spatial Extent:
1)Attempting to correct the extent with R code (ext(raster_data) <- c(current_extent[3],
current_extent[4], current_extent[1], current_extent[2])) results in incorrect precipitation values.
2)Using t(raster_data$precipitation) to transpose the raster also produces invalid results.
3)Attempts to correct the file in QGIS were unsuccessful.
Request for Guidance:
Could you please help address these issues:
1. The missing CRS and the flipped spatial extent in the .nc4 files from GPM IMERG V07?
2. Suggestions for the correct steps to align these files with my shapefile for ADM4 in the Philippines?
Additional Query:
I noticed that the GPM IMERG Final Precipitation L3 1-day data can be visualized and directly downloaded as .tif files from GIOVANNI, which perfectly aligns with my shapefile. However, downloading daily data from 2005-01-01 to 2020-12-31 involves more than 5,000 files, which makes manual download impractical. I try to automate this process using the RSelenium package in R, but it was unsuccessful.
Could you please advise on how to batch download .tif files directly from GIOVANNI or an alternative method to automate this process?
Thank you very much for your time and help. I deeply appreciate your help in addressing these issues!