Skip to content

Instantly share code, notes, and snippets.

View bennyistanto's full-sized avatar

Benny Istanto bennyistanto

View GitHub Profile
@bennyistanto
bennyistanto / CHIRPS_sum4days.py
Created June 19, 2020 07:36
Generate 4days rolling accumulation of rainfall, and calculate maximum value from the result using arcpy
import arcpy
import os
from datetime import date
from datetime import timedelta
import multiprocessing
#Overwrite the output if exist
arcpy.env.overwriteOutput = True
#Working directory
@bennyistanto
bennyistanto / CHIRPS_sum3days.py
Last active June 19, 2020 07:32
Generate 3days rolling accumulation of rainfall, and calculate maximum value from the result using arcpy
import arcpy
import os
from datetime import date
from datetime import timedelta
import multiprocessing
#Overwrite the output if exist
arcpy.env.overwriteOutput = True
#Working directory
@bennyistanto
bennyistanto / CHIRPS_sum2days.py
Last active June 19, 2020 07:32
Generate 2days rolling accumulation of rainfall, and calculate maximum value from the result using arcpy
import arcpy
import os
from datetime import date
from datetime import timedelta
import multiprocessing
#Overwrite the output if exist
arcpy.env.overwriteOutput = True
#Working directory
@bennyistanto
bennyistanto / percentile.py
Created June 19, 2020 07:10
Extract percentile from each cell based on raster timeseries
#!/usr/bin/python
# -*- coding: utf8 -*-
import arcpy
import numpy
import sys
#Overwrite the output if exist
arcpy.env.overwriteOutput = True
reload(sys)
@bennyistanto
bennyistanto / max_valueof_rasters.py
Created June 16, 2020 14:07
Extract MAXIMUM value from daily CHIRPS rasters in a folder
# -*- coding: utf-8 -*-
import arcpy
import os
from datetime import date
from datetime import timedelta
import multiprocessing
#Overwrite the output if exist
arcpy.env.overwriteOutput = True
@bennyistanto
bennyistanto / longterm_16days_chirps.py
Created June 15, 2020 14:17
Longterm MEAN, MAXIMUM, MINIMUM, STD based on MODIS 16days calendar for CHIRPS daily data using arcpy
# -*- coding: utf-8 -*-
import os
import arcpy
# MODIS 16 days calendar using Julian Date
chirps_16days_data = ['001', '017', '033', '049', '065', '081', '097', '113', '129', '145', '161', '177',
'193', '209', '225', '241', '257', '273', '289', '305', '321', '337', '353']
# Change the data and output folder
data_folder = "X:\\01_Data\\01_Global\\Rasters\\Climate\\Precipitation\\CHIRPS\\By16days"
@bennyistanto
bennyistanto / rainanom_chirps_dekad.py
Last active March 31, 2026 16:32
Rainfall anomaly using CHIRPS dekad
#!/usr/bin/env python
# Import system modules
import optparse, sys, os, traceback, errno
import ast
import re
import json
import ConfigParser
import re
import logging
import arcpy
@bennyistanto
bennyistanto / longterm_chirps_dekad.py
Last active June 6, 2020 00:48
Longterm MEAN, MAXIMUM, MINIMUM, STD for CHIRPS dekad data using arcpy
#!/usr/bin/env python
# Import system modules
import optparse, sys, os, traceback, errno
import ast
import re
import json
import ConfigParser
import re
import logging
import arcpy
@bennyistanto
bennyistanto / radiation.frm
Created May 19, 2020 10:31
Calculate radiation
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' Program untuk menghitung Radiasi
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Private Sub cmdCal_Click()
Dim LAT As Double
Dim lon As Double
Dim MONTH As Double
Dim hari As Integer
@bennyistanto
bennyistanto / rainfall_sst_regression.r
Created May 17, 2020 06:27
Pixel-wise regression between two raster time-series
#####
# Installing packages
install.packages(c('raster','readr','tidyr','dplyr','RColorBrewer','GISTools','sp',
'sf','ggplot2','bioimagetools','plyr',"orcutt","lmtest"), dependencies = T)
library(raster)
library(readr)
library(tidyr)
library(dplyr)
library(RColorBrewer)