Skip to content
Snippets Groups Projects
Commit e1fd503e authored by Eli Orland's avatar Eli Orland
Browse files

Update FireGpkg.py

parent f51dcd6c
No related branches found
No related tags found
1 merge request!13Rename Conus dps to Main
Pipeline #5224 passed with stage
in 6 seconds
......@@ -94,14 +94,13 @@ def make_gdf_snapshot(allfires, regnm, layer="perimeter"):
# read or initialize the gdf
t_pt = FireTime.t_nb(allfires.t, nb="previous")
#gdf = FireIO.load_gpkgobj(t_pt, regnm, layer=layer) # try to read data at t_pt
#gdf = None
#if gdf is None: # when no previous time step data, initialize the GeoDataFrame
gdf = gpd.GeoDataFrame(
columns=(list(dd.keys()) + ["fireID"]), crs="epsg:" + str(epsg), geometry=[]
)
gdf = gdf.set_index("fireID") # set fid column as the index column
gdf = FireIO.load_gpkgobj(t_pt, regnm, layer=layer) # try to read data at t_pt
if gdf is None: # when no previous time step data, initialize the GeoDataFrame
gdf = gpd.GeoDataFrame(
columns=(list(dd.keys()) + ["fireID"]), crs="epsg:" + str(epsg), geometry=[]
)
gdf = gdf.set_index("fireID") # set fid column as the index column
# 1. drop rows for fires that are newly invalidated or dead
......@@ -317,4 +316,4 @@ if __name__ == "__main__":
t2 = time.time()
print(f"{(t2-t1)/60.} minutes used to run code")
\ No newline at end of file
print(f"{(t2-t1)/60.} minutes used to run code")
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