Skip to content

Commit

Permalink
Merge pull request #80 from kleok/dev
Browse files Browse the repository at this point in the history
#78 missing LAI error
  • Loading branch information
kleok authored Jul 23, 2024
2 parents 0c986d9 + 311b49e commit e2e83ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions floodpy/Preprocessing_S1_data/Preprocessing_S1_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def Run_Preprocessing(Floodpy_app, overwrite):
if Flood_num_GRD_tiles == 1:
flood_hdf5_outfile=os.path.join(Floodpy_app.Preprocessing_dir,Floodpy_app.flood_datetime_str)
flood_xarray_outfile = flood_hdf5_outfile + '.nc'

flood_img1 = os.path.join(Floodpy_app.S1_dir,S1_flood_rows.iloc[0].Name+'.zip')

if not os.path.exists(flood_xarray_outfile):

flood_img1 = os.path.join(Floodpy_app.S1_dir,S1_flood_rows.iloc[0].Name+'.zip')
perform_single_1GRD_preprocessing(Floodpy_app.gpt,
flood_img1,
flood_hdf5_outfile,
Expand Down
5 changes: 3 additions & 2 deletions floodpy/Preprocessing_S1_data/xarray_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def save_DEM_xarray(DEM, S1_lon_vector, S1_lat_vector, geojson_bbox, ref_xarray,
df.y.attrs['axis'] = 'Y'

df.rio.write_crs("epsg:4326", inplace=True)

df = df.dropna("x", how="all").dropna("y", how="all")
df_coreg = df.rio.clip(gpd.read_file(geojson_bbox)['geometry'])

S1_coreg = df_coreg.rio.reproject_match(ref_xarray)
Expand Down Expand Up @@ -70,6 +70,7 @@ def save_LIA_xarray(LIA, S1_lon_vector, S1_lat_vector, geojson_bbox, ref_xarray,
df.y.attrs['axis'] = 'Y'

df.rio.write_crs("epsg:4326", inplace=True)
df = df.dropna("x", how="all").dropna("y", how="all")

df_coreg = df.rio.clip(gpd.read_file(geojson_bbox)['geometry'])

Expand Down Expand Up @@ -119,7 +120,7 @@ def save_backscatter_xarray(VV_dB, VH_dB, VV_VH_dB, S1_lon_vector, S1_lat_vector
df.y.attrs['axis'] = 'Y'

df.rio.write_crs("epsg:4326", inplace=True)

df = df.dropna("x", how="all").dropna("y", how="all")
df_coreg = df.rio.clip(gpd.read_file(geojson_bbox)['geometry'])

S1_coreg = df_coreg.rio.reproject_match(ref_xarray)
Expand Down

0 comments on commit e2e83ae

Please # to comment.