@@ -37,8 +37,10 @@ def _remove_double_entries(inventory_df):
3737 )['ingestiondate' ].transform (max ) == inventory_df ['ingestiondate' ]
3838
3939 # re-initialize GDF geometry due to groupby function
40- crs = fiona .crs .from_epsg (4326 )
41- gdf = gpd .GeoDataFrame (inventory_df [idx ], geometry = 'geometry' , crs = crs )
40+ gdf = gpd .GeoDataFrame (
41+ inventory_df [idx ], geometry = 'geometry' , crs = 'epsg:4326'
42+ )
43+
4244 logger .info (
4345 f'{ len (inventory_df [idx ])} frames remain after double entry removal'
4446 )
@@ -91,7 +93,7 @@ def _handle_equator_crossing(inventory_df):
9193 crossing the equator the relative orbit will increase by 1.
9294
9395 This routine checks for the appearance of such kind and unifies the
94- relativeorbitnumbers so that the inventory is complinat with the
96+ relativeorbit numbers so that the inventory is compliant with the
9597 subsequent batch processing routines of OST
9698
9799 Args:
@@ -247,7 +249,8 @@ def _remove_incomplete_tracks(aoi_gdf, inventory_df):
247249 out_frame = out_frame .append (gdf_date )
248250
249251 logger .info (
250- f'{ len (out_frame )} frames remain after removal of non-full AOI crossing'
252+ f' { len (out_frame )} frames remain after'
253+ f' removal of non-full AOI crossing'
251254 )
252255 return out_frame
253256
@@ -279,9 +282,10 @@ def _handle_non_continous_swath(inventory_df):
279282
280283 for date in dates :
281284
282- subdf = inventory_df [(inventory_df ['acquisitiondate' ] == date ) &
283- (inventory_df ['relativeorbit' ] == track )
284- ].sort_values ('slicenumber' )
285+ subdf = inventory_df [
286+ (inventory_df ['acquisitiondate' ] == date ) &
287+ (inventory_df ['relativeorbit' ] == track )
288+ ].sort_values ('slicenumber' )
285289
286290 if (len (subdf ) <= int (subdf .slicenumber .max ()) -
287291 int (subdf .slicenumber .min ())):
@@ -320,8 +324,9 @@ def _forward_search(aoi_gdf, inventory_df, area_reduce=0):
320324 out_frame = gpd .GeoDataFrame (columns = inventory_df .columns )
321325
322326 # loop through dates
323- for date in sorted (inventory_df ['acquisitiondate' ].unique (),
324- reverse = False ):
327+ for date in sorted (
328+ inventory_df ['acquisitiondate' ].unique (), reverse = False
329+ ):
325330
326331 # set starting date for curent mosaic
327332 if start_date is None :
@@ -391,8 +396,10 @@ def _backward_search(aoi_gdf, inventory_df, datelist, area_reduce=0):
391396 for dates in datelist :
392397
393398 # extract scenes for single mosaics
394- gdf = inventory_df [(inventory_df ['acquisitiondate' ] <= dates [1 ]) &
395- (inventory_df ['acquisitiondate' ] >= dates [0 ])]
399+ gdf = inventory_df [
400+ (inventory_df ['acquisitiondate' ] <= dates [1 ]) &
401+ (inventory_df ['acquisitiondate' ] >= dates [0 ])
402+ ]
396403
397404 # we create an emtpy list and fill with tracks used for the mosaic,
398405 # so they are not used twice
@@ -413,12 +420,15 @@ def _backward_search(aoi_gdf, inventory_df, datelist, area_reduce=0):
413420 included_tracks .append (track )
414421
415422 # get all footprints for each date and track
416- track_gdf = gdf [(gdf ['acquisitiondate' ] == date ) &
417- (gdf ['relativeorbit' ] == track )]
423+ track_gdf = gdf [
424+ (gdf ['acquisitiondate' ] == date ) &
425+ (gdf ['relativeorbit' ] == track )
426+ ]
418427
419428 # re-initialize GDF due to groupby fucntion
420- track_gdf = gpd .GeoDataFrame (track_gdf ,
421- geometry = 'geometry' )
429+ track_gdf = gpd .GeoDataFrame (
430+ track_gdf , geometry = 'geometry'
431+ )
422432
423433 # get a unified geometry for date/track combination
424434 union = track_gdf .geometry .unary_union
@@ -520,7 +530,8 @@ def search_refinement(
520530 (inventory_df ['orbitdirection' ] == orb )]
521531
522532 logger .info ('{} frames for {} tracks in {} polarisation.' .format (
523- len (inv_df_sorted ), orb , pol ))
533+ len (inv_df_sorted ), orb , pol )
534+ )
524535
525536 # calculate intersected area
526537 inter = aoi_gdf .geometry .intersection (inv_df_sorted .unary_union )
0 commit comments