Skip to content
Snippets Groups Projects
Commit edecaf7a authored by Julia Signell's avatar Julia Signell
Browse files

Use pd.read_csv to read in static file source

parent bffe3ba1
No related branches found
No related tags found
4 merge requests!72[DRAFT] All the changes,!70Make it easier to use filepaths as inputs to pipelines,!67Back all `AllFires` and `Fire` objects with 2 dataframes,!61Additions: primary keys, speed ups (preprocessing and postprocessing), tests, scalene, reorg entire fireatlas
......@@ -139,16 +139,17 @@ def maybe_remove_static_sources(region: Region, input_data_dir: str) -> Region:
A region that is the difference between the user-supplied region and the points identified as static flaring/gas according to the source. Creates a "swiss cheese"- like region, with negative space where there were points, with a buffer around points determined by "remove_static_sources_buffer".
"""
import os
from FireIO import get_reg_shp, gpd_read_file
from FireIO import get_reg_shp
from FireConsts import epsg, remove_static_sources_bool, remove_static_sources_sourcefile, remove_static_sources_buffer
import geopandas as gpd
import pandas as pd
if not remove_static_sources_bool:
return region
# get source data geometry
global_flaring = gpd_read_file(os.path.join(input_data_dir, 'static_sources', remove_static_sources_sourcefile))
global_flaring = pd.read_csv(os.path.join(input_data_dir, 'static_sources', remove_static_sources_sourcefile))
global_flaring = global_flaring.drop_duplicates()
global_flaring = global_flaring[0:(len(global_flaring.id_key_2017) - 1)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment