# Option 1. if FES2014 global tide model is setup from SDS_slope import compute_tide from SDS_slope import compute_tide_dates from SDS_slope import get_min_max import pyfes import os import pytz from datetime import datetime, timedelta import pickle import numpy as np import matplotlib.pyplot as plt # load the sitename_output.pkl generated by CoastSat #sitename = 'NARRA' with open('Pekalongan_longer_time_output.pkl','rb') as f: output = pickle.load(f) # From earlier part of notebook days_in_year = 365.2425 seconds_in_day = 24*3600 settings_slope = {'slope_min': 0.035, # minimum slope to trial 'slope_max': 0.2, # maximum slope to trial 'delta_slope': 0.005, # slope increment 'date_range': [1999,2020], # range of dates over which to perform the analysis 'n_days': 8, # sampling period [days] 'n0': 50, # parameter for Nyquist criterium in Lomb-Scargle transforms 'freqs_cutoff': 1./(seconds_in_day*30), # 1 month frequency 'delta_f': 100*1e-10, # deltaf for identifying peak tidal frequency band 'prc_conf': 0.05, # percentage above minimum to define confidence bands in energy curve } settings_slope['date_range'] = [pytz.utc.localize(datetime(settings_slope['date_range'][0],5,1)), pytz.utc.localize(datetime(settings_slope['date_range'][1],1,1))] # clip the dates between 1999 and 2020 as we need at least 2 Landsat satellites idx_dates = [np.logical_and(_>settings_slope['date_range'][0],_