This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf8 -*- | |
import arcpy | |
import numpy | |
import sys | |
#Overwrite the output if exist | |
arcpy.env.overwriteOutput = True | |
reload(sys) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This script required daily CHIRPS data and previous drspell data, if previous data not available | |
#then it will start with 0. | |
import os | |
import arcpy | |
from arcpy.sa import * | |
from datetime import date, timedelta | |
# to execute first DSLR data | |
def execute_first_DSLR(_tiffolder, _DSLRFolder, threshold): | |
sr = arcpy.SpatialReference(4326) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This script required daily CHIRPS data and previous wetspell data, if previous data not available | |
#then it will start with 0. | |
import os | |
import arcpy | |
from arcpy.sa import * | |
from datetime import date, timedelta | |
# to execute first DSLD data | |
def execute_first_DSLD(_tiffolder, _DSLDFolder, threshold): | |
sr = arcpy.SpatialReference(4326) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf8 -*- | |
import arcpy | |
import os | |
#Overwrite the output if exist | |
arcpy.env.overwriteOutput = True | |
# Set local variables | |
ws_in = r"Z:\Temp\CHIRPS\SPI\Month1D1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Arrange IMERG data based on number of days within month | |
# Source: https://github.com/andyprasetya | |
# -- Start script: change directory ke target directory, misal: 'imerg' | |
cd imerg | |
# -- Set shell option ke 'nullglob' - optional, bisa di-comment/disabled | |
shopt -s nullglob | |
# Mulai loop ke seluruh file dalam target directory. | |
# Biasanya menggunakan 'i', tapi ini pakai 'file' untuk memperjelas penulisan variable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
------------------------------------------------------------------------------------------------------------- | |
Convert raster GeoTIFF in a folder to single NetCDF file with time dimension enabled that is CF-Compliant | |
http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html | |
Based on Rich Signell's answer on StackExchange: https://gis.stackexchange.com/a/70487 | |
This script was tested using TerraClimate monthly data. Adjustment is needed if using other timesteps data | |
NCO (http://nco.sourceforge.net), GDAL, NetCDF4, numpy must be installed before using this script | |