Exemple #1
0
#%%
##################################
####      PREPROCESS DATA     ####
##################################
years_requested_str = [str(yr) for yr in years_requested]

for idx in ids_filtered:  # For each available transect go though the entire analysis
    print(idx)
    #start = time.time()
    trsct = str(idx)

    Dimensions = []

    # Here the JARKUS filter is set and the data for the requested transect and years is retrieved
    Jk = Jk = Transects(url=settings['url'])
    df, years_available = Jk.get_dataframe(idx, years_requested)

    # Interpolate x and y along standardized cross shore axis
    cross_shore = list(range(-3000, 9320, 1))

    # Convert elevation data for each year of each transect into aray that can be easily analysed
    y_all = []
    for i, yr in enumerate(years_requested_str):
        if yr in years_available:
            y = np.array(df.loc[trsct, yr]['y'])
            x = np.array(df.loc[trsct, yr]['x'])
            y_grid = griddata(x, y, cross_shore)
            if i == 0:
                y_all = y_grid
            else:
                y_all = np.column_stack((y_all, y_grid))