<jupyter_start><jupyter_text>Notebook to create SFR obs from two stream stats gates<jupyter_code>stream_stats_file = '../processed_data/NWIS_DV_STREAMSTATS_INFO.csv'
bound_file = '../source_data/Shapefiles/Extents/Model_Extent_HUC12.shp'
df = pd.read_csv(stream_stats_file)
gdf = gp.GeoDataFrame(df, crs="EPSG:4326", geometry=gp.points_from_xy(x=df['Longitude (degrees NAD83)'], y=df['Latitude (degrees NAD83)']))
gdf = gdf.to_crs(epsg=5070)
gdf
bound = gp.read_file(bound_file)
bound = bound.to_crs(epsg=5070)
#  plot to make sure coords look right
fig, ax = plt.subplots(figsize=(8,8))
bound.plot(fc='none', ec='k', ax=ax)
gdf.plot(ax=ax)
#  calculate baseflow using mean annual flow and stream stats BFI
gdf['Mean_Annual_BFI_baseflow_cfs'] = gdf['Mean_Annual_Flow_cfs'] * gdf['Average_BFI_value']
#  make x and y cols
gdf['x'] = gdf.geometry.x
gdf['y'] = gdf.geometry.y
gdf
#  write as sfr obs file
gdf.to_csv('../processed_data/NWIS_DV_STREAMSTATS_SITES.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14300100704934543, 'fraction_numerical': 0.02014098690835851, 'mean_word_length': 6.952, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '328587', 'license': 'CC0-1.0', 'n_tokens_mistral': 437, 'n_tokens_neox': 412, 'n_words': 74, 'path': 'notebooks_preprocessing_blank/1.2_create_SFR_obs.ipynb', 'repo_name': 'usgs/neversink_workflow', 'size': '993'}