import pandas as pd import rasterio import seaborn as sns from PIL import Image from matplotlib import pyplot as plt from rasterio.crs import CRS from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import confusion_matrix, classification_report, accuracy_score from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler import basicconfig as config import filemanager from trainingdata import get_labelled_features_as_df, extract_features_from input_dir, output_dir = filemanager.get_file_paths_based_on_os( platform.system(), filemanager.Product.grd) # input_dir = output_dir + config.LC_PATH # classified_LC_dir = output_dir + config.LC_CLASSIFIED_DIR # input_dir = config.GRD_PARENT_DIR + "Processing_2020\\" + config.LC_PATH # classified_LC_dir = config.GRD_PARENT_DIR + "Processing_2020\\" + config.LC_CLASSIFIED_DIR # input_dir = config.GRD_PARENT_DIR + "Processing_2018\\" + config.LC_PATH # classified_LC_dir = config.GRD_PARENT_DIR + "Processing_2018\\" + config.LC_CLASSIFIED_DIR # input_dir = config.GRD_PARENT_DIR + "Processing_2017\\" + config.LC_PATH # classified_LC_dir = config.GRD_PARENT_DIR + "Processing_2017\\" + config.LC_CLASSIFIED_DIR # input_dir = config.GRD_PARENT_DIR + "Processing_2016\\" + config.LC_PATH # classified_LC_dir = config.GRD_PARENT_DIR + "Processing_2016\\" + config.LC_CLASSIFIED_DIR input_dir = "D:\\Texana\\" + "Processing\\" + config.LC_PATH classified_LC_dir = "D:\\Texana\\" + "Processing\\" + config.LC_CLASSIFIED_DIR
import platform import re import subprocess import sys from snappy import GPF from snappy import ProductIO import basicconfig as config import filemanager from basicconfig import TEXANA_WKT, POLARIZATIONS, SNAPHU_PATH from snappy_tools import snappyconfigs, snappyoperators as sp GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis() usr_system = platform.system() input_dir, output_dir = filemanager.get_file_paths_based_on_os( usr_system, filemanager.Product.slc) # interferogram_dir = output_dir output_dir = "E:\\Texana_SLC\\Processing\\" interferogram_dir = output_dir + config.INTERFEROGRAM_PATH gc.enable() def call_snaphu_command(snaphu_path): try: with open(snaphu_path + "snaphu.conf") as f: snaphu_config_file = f.readlines() snaphu_cmd = "" for line in snaphu_config_file: if "snaphu -f" in line: snaphu_cmd = line