Skip to content

Instantly share code, notes, and snippets.

View bennyistanto's full-sized avatar

Benny Istanto bennyistanto

View GitHub Profile
@bennyistanto
bennyistanto / Indonesia_S2S_and_Seasonal_Forecasts_using_PyCPT.md
Last active March 15, 2023 09:37
S2S and Seasonal (un)calibrated Forecasts using PyCPT for Indonesia

Indonesia S2S and Seasonal Forecasts using PyCPT

PyCPT is a Python interface and enhancement for the command line version of the International Research Institute for Climate and Society's Climate Predictability Tool (CPT), for seasonal and sub-seasonal skill assessment and forecast experiments.

This notes is describing on how to use PyCPT s2sv1.92 and seav1.92 for Subseasonal and Seasonal Forecasting in Indonesia

1 Installation

This section will explain on how to install the PyCPT inside Windows Subsystem for Linux (WSL) 2. This step-by-step guide was tested using Windows 11 with WSL2 - Ubuntu 22 enabled running on Thinkpad T480 2019, i7-8650U 1.9GHz, 64 GB 2400 MHz DDR4.

@bennyistanto
bennyistanto / Visualising_WRFOUT.ipynb
Created March 10, 2023 14:45
The code below required a new CF based NetCDF files generated from native WRFOUT NetCDF files using wrfout_to_cf.ncl from https://sundowner.colorado.edu/wrfout_to_cf/overview.html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bennyistanto
bennyistanto / 03_mxd13q1_fillnullwithstats.py
Last active March 13, 2024 01:15
Filling null on MXD13Q1 timeseries data with long-term mean
# -*- coding: utf-8 -*-
"""
NAME
03_mxd13q1_fillnullwithstats.py
Filling null on MXD13Q1 data with long-term mean
DESCRIPTION
Input data for this script will use MXD13Q1 16-days data generate from GEE or downloaded from NASA
This script can do filling null on MXD13Q1 data with long-term mean
REQUIREMENT
ArcGIS must installed before using this script, as it required arcpy module.
@bennyistanto
bennyistanto / 0_uga_rainfallzone.ipynb
Last active March 6, 2023 11:01
Experimental climatological rainfall zone using KMeans and Agglomerative Clustering
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bennyistanto
bennyistanto / csv_concat.py
Created March 1, 2023 14:44
Concatenate csv files by column, and use the date on filename as column name
#!/usr/bin/python
"""
NAME
csv_concat.py
Concatenate csv files by column, and use the date on filename as column name
DESCRIPTION
Input data for this script will use any csv, which must have lon, lat and value (no header)
All files required to follow the naming convention "_yyyymmdd.csv"
USAGE
python csv_concat.py <csv_dir>
@bennyistanto
bennyistanto / 0_install_WRF_on_WSL2.md
Last active February 14, 2025 05:26
Install the Weather Research and Forecasting Model on Windows Subsytem for Linux

Install the WRF Model in WSL2

This section will explain on how to install the Weather Research and Forecasting (WRF) Model inside Windows Subsystem for Linux (WSL) 2. This step-by-step guide was tested using Windows 11 with WSL2 - Debian 12 enabled running on ThinkStation P720.

--
Benny Istanto, Climate Geographer
GOST/DECSC/DECDG, The World Bank

Index

@bennyistanto
bennyistanto / spatiotemporal_regression.py
Created January 22, 2023 08:05
Perform a focal linear regression between two sets of timeseries raster
# -*- coding: utf-8 -*-
"""
NAME
spatiotemporal_regression.py
DESCRIPTION
Perform a focal linear regression between two sets of timeseries raster
REQUIREMENT
It required os, numpy, scipy, rasterio and sklearn module.
So it will work on any machine environment.
HOW-TO USE
@bennyistanto
bennyistanto / spatiotemporal_regression_arcpy.py
Created January 22, 2023 08:04
Perform a focal linear regression between two sets of timeseries raster using arcpy
# -*- coding: utf-8 -*-
"""
NAME
spatiotemporal_regression_arcpy.py
DESCRIPTION
Perform a focal linear regression between two sets of timeseries raster
REQUIREMENT
ArcGIS must installed before using this script, as it required arcpy module.
EXAMPLES
\\arcgispro-py3\\python spatiotemporal_regression_arcpy.py
@bennyistanto
bennyistanto / modis_viproducts.py
Last active April 8, 2023 14:18
MXD13Q1 derivative products: ratio, difference, standardize anomaly and vegetation condition index
# -*- coding: utf-8 -*-
"""
NAME
modis_viproducts.py
Generate derivative product from Vegetation Indices
DESCRIPTION
Input data for this script will use MXD13Q1 8-days data generate from GEE or downloaded
from NASA. This script can do calculation for ratio, difference, standardize anomaly
and vegetation condition index.
The calculation required timeseries VI and the long-term statistics (min, mean, max, std)
@bennyistanto
bennyistanto / spei_monthly_blend.py
Last active March 30, 2023 23:43
Global TerraClimate's SPEI-based drought indicators blend
# -*- coding: utf-8 -*-
"""
NAME
spei_monthly_blend.py
Global TerraClimate's SPEI-based dry/wet indicators blend.
DESCRIPTION
Input data for this script will use TerraClimate SPEI monthly data in GeoTIFF format
This experimental SPEI blends integrate several SPEI scales into a single product.
The combines 3-, 6-, 9-, 12-, and 24-month SPEI to estimate the overall dry/wet conditions.
METHOD