Getting Data NASA POWER, such as Precipitation in Regional by Single Point approach.
Here, you'll find a versatile codebase for retrieving NASA Power data from regional grids. This code allows you to customize various parameters, such as time and temporal averages, communities, and specific data parameters like precipitation, temperatures, and more. The regional grid you work with is derived from a single-point approach, making it highly adaptable to your specific research or application needs.
Key Features:
- Retrieve NASA Power data from regional grids. Utilize a single-point approach for regional grid adaptation.
- Customize time intervals and temporal averages.
- Select specific communities of interest (modify data parameters, including precipitation, temperatures, and more).
This repository hosts scripts for processing NASA POWER (Prediction Of Worldwide Energy Resources) data. The data processing pipeline comprises four main steps: getting data, pivoting data, combining and filtering data, and visualizing data. The data retrieved in this project pertains to precipitation or rainfall, represented by the parameter code "PRECTOTCORR". This data provides insights into total precipitation corrected for gauge and other biases. Let's delve into each step:
- File:
Step 1 (Getting Data).r
- Description: This R script retrieves NASA POWER data for precipitation (parameter code: PRECTOTCORR) for a specified geographical area and time range. It divides the area into smaller parts, downloads the data for each part, and saves it into separate Excel files.
- Instructions:
- Install and load the necessary R packages:
nasapower
andwritexl
. - Define the parameter code, date range, and geographical coordinates.
- Run the script to download and save the data into Excel files.
- Install and load the necessary R packages:
- File:
Step 2 (Pivot Data).r
- Description: This R script pivots the downloaded NASA POWER data from wide to long format, where longitude and latitude become rows and dates become columns. It iterates through the downloaded Excel files from Step 1 and saves the pivoted data into new Excel files.
- Instructions:
- Install and load the necessary R package:
writexl
. - Specify the base path for input and output files.
- Run the script to pivot the data and save it into new Excel files.
- Install and load the necessary R package:
- File:
Step 3 (Combined and Filtered Data).py
- Description: This Python script combines the pivoted NASA POWER data from Step 2 and preprocesses it. It filters the data points within a specific geographical region (Jawa Timur) using shapefile data and plots the observation points on a map. Finally, it saves the filtered data into an Excel file.
- Instructions:
- Install and import the necessary Python libraries:
geopandas
andpandas
. - Read geometrical data for Jawa Timur from a shapefile.
- Combine and preprocess the data from Step 2.
- Plot observation points on a map.
- Save the filtered data into an Excel file.
- Install and import the necessary Python libraries:
- File:
Step 4 (Visualize Data).py
- Description: This Python script visualizes the filtered NASA POWER data within the geographical region of Jawa Timur. It reads shapefile data for Jawa Timur and Indonesia, as well as the filtered data from Step 3, and plots the observation points on a map.
- Instructions:
- Install and import the necessary Python libraries:
geopandas
,pandas
, andmatplotlib
. - Read geometrical data for Jawa Timur and Indonesia from shapefiles.
- Read filtered data from Step 3.
- Plot observation points on a map within the geographical boundaries of Jawa Timur.
- Display the map.
- Install and import the necessary Python libraries:
The data retrieved comprises precipitation or rainfall data for the region of Jawa Timur, Indonesia from the years 2018 to 2022
nasa_power_data_part1.xlsx
tonasa_power_data_part19.xlsx
: Excel files containing downloaded NASA POWER data parts.
nasa_power_data_pivoted_part1.xlsx
tonasa_power_data_pivoted_part19.xlsx
: Excel files containing pivoted NASA POWER data parts.
nasa_power_data_filtered_within.xlsx
: Filtered NASA POWER data within the geographical region of Jawa Timur.
-
Indo and Jatim Kab_Kot SHP 2019.part01.rar
toIndo and Jatim Kab_Kot SHP 2019.part06.rar
: RAR files containing shapefiles for Indonesia and Jawa Timur Kabupaten/Kota (districts) for the year 2019. Note: Shapefiles are compressed into multiple parts for easier distribution and download. Please make sure to extract all parts at the same time before use. -
Jawa Timur Map: Map of Jawa Timur after data processing in Step 4.
Feel free to explore each step and adapt the scripts to your specific requirements.