akhdefo_functions.unzip(zipdir, dst_dir)

This program unzips all the zip products into one folder

zipdir: path to directory contains all the zipfiles

dst_dir: path to destination folder to copy all unzipped products.

akhdefo_functions.copyImage_Data(path_to_unzipped_folders='', Path_to_raster_tifs='')

This program copy all the raster images

akhdefo_functions.copyUDM2_Mask_Data(path_to_unzipped_folders='', Path_to_UDM2raster_tifs='')

This program copy all raster masks

akhdefo_functions.Filter_PreProcess(unfiltered_folderPath='', UDM2_maskfolderPath='', outpath_dir='', Udm_Mask_Option=False)

This program prepare and uses filters to balanace raster image brightness

unfiltered_folderPath=r””

UDM2_maskfolderPath=r””

outpath_dir=r””

Udm_Mask_Option=False if True the program uses planetlabs imagery unusable pixel mask to ignore and mask bad image pixels

akhdefo_functions.Crop_to_AOI(Path_to_WorkingDir='', Path_to_AOI_shapefile='', output_CroppedDir='')

This program used to clip multiple raster files

Path_to_WorkingDir: path to raster working directory

Path_to_AOI_shapefile: path to Area of interest in shapefile format

output_CroppedDir: path to save cropped raster files

akhdefo_functions.Mosaic(Path_to_WorkingDir='', output_MosaicDir='', img_mode=(0, 1))

This program mosiacs raster images in geotif format as well grab dates the satellite image taken for further processing.

The current version only supports Planet Labs SurfaceReflectance products.

Path_to_WorkingDir=r””

output_MosaicDir=r””

img_mode=(0,1) if img_mode=0 the the programs mosaics only the raster images.

if img_mode=1 the program mosiacs only mask rasters

akhdefo_functions.Coregistration(input_Folder='', output_folder='', grid_res=20, min_reliability=60, window_size=(64, 64), path_figures='', showFig=False, no_data=[0, 0], single_ref_path='')

This program coregisteres multiple rasters using both structural similarity index and feature matching techniqws. This program is written based on arosics python library

Inputs

input_Folder: str Path to input raster folders

grid_res: int

min_reliability: int structural simialrity index threshold to differentaite deformation from raster shift (min=20, max=100)

window_size: tuple

window size for pixel search

showFig: bool

True to display results or False to not displat results

no_data: list

No data values to be ignored for both reference and target image

single_ref_path: str

provide path to raster if interested to coregister all rasters to a single reference, ignore this option the program uses subsequent rasters as refernce.

Returns:

output_folder: str

returns coregistred and georeferenced raster in geotif format

path_figures: str

returns figure with plotted displaced pixels in raster coordinate system units

akhdefo_functions.DynamicChangeDetection(Path_working_Directory='', Path_UDM2_folder='', Path_to_DEMFile='', Coh_Thresh=0.75, vel_thresh=0.063, udm_mask_option=False, cmap='jet', Median_Filter=False, Set_fig_MinMax=False, show_figure=False, plot_option='origional')

This program calculates optical flow velocity from triplets of daily optical satellite images.

Path_working_Directory=r””

Path_UDM2_folder=r””

Path_to_DEMFile=r””

Coh_Thresh=0.75

vel_thresh=0.063

udm_mask_option=False

cmap=’jet’

Median_Filter=False

Set_fig_MinMax=False

show_figure=False

plot_option=”origional”

Outputs: Raster velocity in X direction(EW) Raster Velocity in Y direction(NS) Initial Timesereis Figures (those figures are only intermediate products needs calibration)

Note: Final Timeseris products will be a shapefile format using Time_Series function after stackprep step.

akhdefo_functions.plot_stackNetwork(src_folder='', output_folder='', cmap='tab20', date_plot_interval=(5, 30), marker_size=15)

This Program plots temporal network of triplets to be stacked for calculating Annual Mean Velocity from stacked optical images.

src_folder: path to georeferenced_folder

output_folder: path to output folder to save output Figure plot

cmap: colormap for the plot default is “tab20”

date_plot_interval: minumum and maximum plot x axis interval dates for the plot

marker_size: size of plotted points default is 15

akhdefo_functions.Time_Series(stacked_raster_EW='', stacked_raster_NS='', velocity_points='', dates_name='', output_folder='', outputFilename='', rasteriz_mean_products=True, std=1, VEL_Scale='year')

This program uses candiate velocity points from stackprep function and performs linear interpolation in time-domain to calibrate stacked velocity. Additionally produces corrected timeseries velocity(daily) in a shapefile. Inputs:

stacked_raster_EW:

stacked_raster_NS:

velocity_points: Velcity Candidate points

dates_name:text file include name of each date in format YYYYMMDD

output_folder:

outputFilename

Returns:

Time-series shape file of velocity and direction EW, NS, and 2D(resultant Velocity and direction)

akhdefo_functions.akhdefo_ts_plot(path_to_shapefile='', dem_path='', point_size=1.0, opacity=0.75, cmap='turbo', Set_fig_MinMax=True, MinMaxRange=[-50, 50], color_field='VEL', user_data_points='', path_saveData_points='', save_plot=False, Fig_outputDir='', VEL_Scale='year')

Inputs:

This program used for analysis time-series velocity profiles

user_data_points: provide path to csv. file contains x and y coordinate for points of interest you can generate this file by providing path to path_saveData_points (POI.csv).

This is useful to save mouse click positions to repeat the plots for different datasets for example if you plot several TS profiles for EW velocity product, you can recreate TS for the same exact position by saving POI.csv with path_saveData_points and then use that as input for the another plot such as NS velocity product via setting user_datapoints=”POI.csv”

path_to_shapefile: type path to timeseries shapefile in stack_data/TS folder

dem_path=r”” path to dem raster in geotif fromat

point_size=1.0 size of the sactter plot points

opacity=0.75 transparency of the scater overlay

cmap=”turbo” Matplotlib colormap options

Set_fig_MinMax=True

MinMaxRange=[-50,50] Normalize plot colormap range

color_field=’VEL’ ,”VEL_2D”, ‘VEL_N’, ‘VEL_E’, ‘VELDir_MEA’

user_data_points=””,

path_saveData_points=””

save_plot=False,

Fig_outputDir=’’

VEL_Scale=’year’

Outputs: Interactive figures

akhdefo_functions.Akhdefo_inversion(horizontal_InSAR='', Vertical_InSAR='', EW_Akhdefo='', NS_Akhdefo='', demFile='', output_folder='')

This program calculates 3D displacement velocity (East-West,North-South and vertical) using combined optical and InSAR products

Inputs:

horizontal_InSAR: path to East Velocity InSAR product in geotif format

Vertical_InSAR: path to Vertical Velocity InSAR product in geotif format

EW_Akhdefo: path to east-west velocity akhdefo(optical) product in geotif format

NS_Akhdefo: path to north-south velocity akhdefo(optical) product in geotif format

demFile: path to DEM raster in geotif format

output_folder: path to save raster products

Returns:

3D-Velocity (D3D in mm/year) raster Plunge raster in degrees Trend raster in degress

akhdefo_functions.utm_to_latlon(easting, northing, zone_number, zone_letter)

This program converts geographic projection of shapefiles from UTM to LATLONG

Inputs: easting: Geopandas column with Easting

northing: Geopandas column with Northing

zone_number: int

zone_letter: “N” or “S”

Returns: [lon , lat ]: List