<jupyter_start><jupyter_text>Interpolate Attempt-1<jupyter_code>plt.figure(figsize=(12, 8))
plt.scatter(elevation_df.x, elevation_df.y, alpha=0.5)
plt.scatter(vlm_d.Longitude, vlm_d.Latitude, color='r', alpha=0.5)<jupyter_output><empty_output><jupyter_text>Interpolate Attempt-2<jupyter_code>from scipy.interpolate import griddata
min1, max1 = min(vlm_d.Longitude), max(vlm_d.Longitude)
min2, max2 = min(vlm_d.Latitude), max(vlm_d.Latitude)
# grid_x, grid_y = np.mgrid[0:1:100j, 0:1:200j]
grid_x, grid_y = np.mgrid[min1:max1:1000j, min2:max2:1000j]
vlm_points = vlm_d[['Longitude', 'Latitude']].values
vlm_values = vlm_d.VLM.values
v_grid = griddata(vlm_points, vlm_values, (grid_x, grid_y), method = 'nearest')
plt.figure(figsize = (80,10))

plt.imshow(v_grid.T, extent=(min(vlm_d.Longitude), max(vlm_d.Longitude), min(vlm_d.Latitude), max(vlm_d.Latitude)), origin='lower') 
plt.plot(vlm_d.Longitude, vlm_d.Latitude,"ok", color='c')

plt.colorbar()
plt.show()<jupyter_output><empty_output><jupyter_text>Interpolate Attempt-3<jupyter_code>elev_coor = elevation_df[['x', 'y']].values
grid_2 = griddata(vlm_points, vlm_values, elev_coor, method='nearest')
# plt.figure(figsize=(12, 8))
# plt.scatter(elevation_df.x, elevation_df.y, c=grid_2)
# plt.show()<jupyter_output><empty_output><jupyter_text>Interpolate Attempt-4<jupyter_code>import fiona
import pandas as pd
from collections import OrderedDict
totalColi = pd.read_excel('Data/data_analisis.xls', index_col=0)
totalColi.head()
totalColi.dtypes
schema = {'properties': OrderedDict([('obsName', 'str')]), 'geometry': 'Point'}
crs = {'init': 'epsg:4326'}
coliShp = fiona.open('Data/totalColiforms.shp',mode='w',schema=schema,driver='ESRI Shapefile',crs=crs)

for index, line in totalColi.iterrows():
    feature = {
    'geometry':{'type':'Point','coordinates':(line.Longitude,line.Latitude)},
    'properties':OrderedDict([('obsName',index)])
    }
    coliShp.write(feature)
coliShp.close()
#open point shapefile
vlm_point = gpd.read_file('Data/totalColiforms.shp')
print(vlm_point.crs)
vlm_point.plot()
from rasterio.plot import show

elevation_raster = rasterio.open('Data/Elevation.tif')
print(elevation_raster.crs)
print(elevation_raster.count)
#show point and raster on a matplotlib plot
fig, ax = plt.subplots(figsize=(12,12))
vlm_point.plot(ax=ax, color='orangered')
show(elevation_raster, ax=ax)<jupyter_output><empty_output><jupyter_text>Scenarios<jupyter_code>slr_d = slr_d.drop(columns=['PSMSL ID','Site','Background RSL rate (mm/yr)','RSL in 2000 (cm)','RSL in 2010 (cm)','RSL in 2020 (cm)', 'RSL in 2040 (cm)', 'RSL in 2060 (cm)', 'RSL in 2070 (cm)', 'RSL in 2090 (cm)', 'RSL in 2120 (cm)', 'RSL in 2150 (cm)', 'RSL in 2200 (cm)'])
slr_d.head()
d = slr_d.iloc[1]
scenarios_df = pd.DataFrame()
scenarios_df = scenarios_df.append(d, ignore_index=True)
d = slr_d.iloc[17]
scenarios_df = scenarios_df.append(d, ignore_index=True)
scenarios_df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16831345826235095, 'fraction_numerical': 0.03339011925042589, 'mean_word_length': 8.089783281733746, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '321954', 'license': 'MIT', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1231, 'n_words': 192, 'path': 'Farah/Week-5/June30th.ipynb', 'repo_name': 'sashanksilwal/CRSLR', 'size': '2935'}