Skip to content

Instantly share code, notes, and snippets.

View bennyistanto's full-sized avatar

Benny Istanto bennyistanto

View GitHub Profile
# -*- coding: utf-8 -*-
"""
Calculate annual rainfall from TERRACLIMATE Precipitation data, 1958-2020
"""
import arcpy
def AnnualRainfall(): # Annual Rainfall
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = False
@bennyistanto
bennyistanto / extract_spei_dry_month.py
Last active October 10, 2022 14:45
TerraClimate's SPEI drought characteristics
# -*- coding: utf-8 -*-
"""
NAME
extract_spei_dry_month.py
DESCRIPTION
Input data for this script will use TERRACLIMATE's SPEI-12, generated using pypi climate-indices
This script will calculate number of:
(i) Dry month,
(ii) Total dry month
@bennyistanto
bennyistanto / extract_imerg_daily_indices.py
Created December 21, 2021 02:12
Extract bulk of time series IMeRG's nc4 in a folder to GeoTIFF then calculate dry and wet days
# -*- coding: utf-8 -*-
"""
NAME
extract_imerg_daily_indices.py
Global IMERG daily indices data extraction
DESCRIPTION
Input data for this script will use IMERG Final or Late Run downloaded from NASA website
https://gpm1.gesdisc.eosdis.nasa.gov/data/GPM_L3/
This script can do:
(i) Translation from nc4 to GeoTIFF, and
@bennyistanto
bennyistanto / IMERG_nc2tif_subset.py
Last active March 2, 2022 07:32
Global IMERG daily nc4 translation to GeoTIFF and mask the sea
# -*- coding: utf-8 -*-
"""
NAME
imerg_nc2tif_subset.py
Global IMERG daily nc4 translation to GeoTIFF
DESCRIPTION
Input data for this script will use IMERG Final or Late Run downloaded from NASA website
This script can do translation from nc4 to GeoTIFF and mask the sea.
REQUIREMENT
ArcGIS must installed before using this script, as it required arcpy module.
@bennyistanto
bennyistanto / IMERG_daily_indices_1mm.py
Last active September 8, 2023 13:37
Global IMERG daily indices data extraction with rain day threshold 1mm
# -*- coding: utf-8 -*-
"""
NAME
imerg_daily_indices_1mm.py
Global IMERG daily indices data extraction
DESCRIPTION
Input data for this script will use IMERG Final or Late Run downloaded from NASA website
This script can do:
(i) Dry days
(ii) Wet days
@bennyistanto
bennyistanto / IMERG_daily2annual.py
Last active March 4, 2022 23:50
Global IMERG annual rainfall
# -*- coding: utf-8 -*-
"""
NAME
imerg_daily2annual.py
Global IMERG annual rainfall
DESCRIPTION
Input data for this script will use IMERG in GeoTIFF format
This script can do annual cell statistics to get SUM or other stat: MEAN, MAX, MIN and STDEV
REQUIREMENT
ArcGIS must installed before using this script, as it required arcpy module.
@bennyistanto
bennyistanto / IMERG_monthlystats.py
Last active February 4, 2022 05:01
Global IMERG monthly statistics data, long-term average, max, min and stdev
# -*- coding: utf-8 -*-
"""
NAME
imerg_monthlystats.py
Global IMERG monthly statistics data, long-term average, max, min and stdev
DESCRIPTION
Input data for this script will use IMERG monthly data generated by imerg_daily2monthly.py
This script can do monthly statistics calculation (AVERAGE, MAXIMUM, MINIMUM and STD)
REQUIREMENT
ArcGIS must installed before using this script, as it required arcpy module.
@bennyistanto
bennyistanto / IMERG_daily2monthly.py
Last active September 8, 2023 13:36
Global IMERG daily to monthly
# -*- coding: utf-8 -*-
"""
NAME
imerg_daily2monthly.py
Global IMERG daily to monthly
DESCRIPTION
Input data for this script will use IMERG daily data generated by imerg_nc2tif.py or other
IMERG-based daily products. Example: daily wetdays to monthly sum, daily cdd to monthly max
REQUIREMENT
ArcGIS must installed before using this script, as it required arcpy module.
@bennyistanto
bennyistanto / IMERG_nc2tif.py
Last active February 7, 2022 02:59
Global IMERG daily nc4 translation to GeoTIFF
# -*- coding: utf-8 -*-
"""
NAME
imerg_nc2tif.py
Global IMERG daily nc4 translation to GeoTIFF.
DESCRIPTION
Input data for this script will use IMERG Final or Late Run downloaded from NASA website.
This script can do translation from nc4 to GeoTIFF.
REQUIREMENT
ArcGIS must installed before using this script, as it required arcpy module.
@bennyistanto
bennyistanto / IMERG_daily_indices_5mm.py
Last active March 4, 2022 13:55
Global IMERG daily indices data extraction
# -*- coding: utf-8 -*-
"""
NAME
imerg_daily_indices_5mm.py
Global IMERG daily indices data extraction
DESCRIPTION
Input data for this script will use IMERG Final or Late Run downloaded from NASA website
This script can do:
(i) Dry days
(ii) Wet days