@@ -93,6 +93,7 @@ def main(
9393 mosaic_days : int ,
9494 step : int ,
9595 cdse_credentials : dict ,
96+ ratio : int ,
9697 snap_gpt_path : str = "gpt" ,
9798):
9899 logger = logging .getLogger (__file__ )
@@ -140,7 +141,7 @@ def main(
140141
141142
142143 with Timer (dsc = "Sentinel-2 preprocessing" , logger = logger ) as t :
143- footprint = s2_preprocessing (s2_bands = s2_bands )
144+ footprint = s2_preprocessing (s2_bands = s2_bands , ratio = ratio )
144145 timings .append (("Sentinel-2 pre-processing" , t .elapsed ))
145146
146147 with open (S2_PRE_MARKER , "w" ) as fp :
@@ -175,7 +176,7 @@ def main(
175176
176177
177178 with Timer (dsc = "EFAST" , logger = logger ) as t :
178- perform_efast (start_date = datetime .strptime (start_date , date_format ), end_date = datetime .strptime (end_date , date_format ), step = step )
179+ perform_efast (start_date = datetime .strptime (start_date , date_format ), end_date = datetime .strptime (end_date , date_format ), step = step , ratio = ratio )
179180
180181 timings .append (("EFAST" , t .elapsed ))
181182
@@ -212,7 +213,7 @@ def download_files(
212213 return instrument
213214
214215
215- def s2_preprocessing (* , s2_bands ):
216+ def s2_preprocessing (* , s2_bands , ratio ):
216217 # Sentinel-2 pre-processing
217218 s2 .extract_mask_s2_bands (
218219 s2_download_dir ,
@@ -221,6 +222,7 @@ def s2_preprocessing(*, s2_bands):
221222 )
222223 s2 .distance_to_clouds (
223224 s2_processed_dir ,
225+ ratio = ratio ,
224226 )
225227 footprint = s2 .get_wkt_footprint (
226228 s2_processed_dir ,
@@ -299,7 +301,7 @@ def s3_preprocessing(
299301 logger .info (f"[Timings] { t } ({ desc } )" )
300302
301303
302- def perform_efast (* , start_date , end_date , step ):
304+ def perform_efast (* , start_date , end_date , step , ratio ):
303305 # Perform EFAST fusion
304306 for date in rrule .rrule (
305307 rrule .DAILY ,
@@ -315,6 +317,7 @@ def perform_efast(*, start_date, end_date, step):
315317 s2_processed_dir ,
316318 fusion_dir ,
317319 product = "REFL" ,
320+ ratio = ratio ,
318321 max_days = 100 ,
319322 minimum_acquisition_importance = 0 ,
320323 )
@@ -373,13 +376,15 @@ def download_from_cdse(
373376 ) # Dahra EC tower
374377 parser .add_argument ("--s3-sensor" , default = "SYN" )
375378 parser .add_argument (
376- "--s3-bands" , default = ["SDR_Oa04" , "SDR_Oa06" , "SDR_Oa08" , "SDR_Oa17" ]
379+ "--s3-bands" , nargs = "+" , default = ["SDR_Oa04" , "SDR_Oa06" , "SDR_Oa08" , "SDR_Oa17" ]
377380 )
378- parser .add_argument ("--s2-bands" , default = ["B02" , "B03" , "B04" , "B8A" ])
381+ parser .add_argument ("--s2-bands" , nargs = "+" , default = ["B02" , "B03" , "B04" , "B8A" ])
379382 parser .add_argument ("--mosaic-days" , default = 100 )
380- parser .add_argument ("--step" , required = False , default = 2 )
383+ parser .add_argument ("--step" , required = False , default = 2 , type = int )
381384 parser .add_argument ("--cdse-credentials" , default = CREDENTIALS )
382385 parser .add_argument ("--snap-gpt-path" , required = False , default = "gpt" )
386+ parser .add_argument ("--ratio" , required = False , type = int , default = 30 )
387+ #parser.add_argument("--sigma-doy", type=float, default=20)
383388
384389 args = parser .parse_args ()
385390
@@ -394,4 +399,6 @@ def download_from_cdse(
394399 mosaic_days = args .mosaic_days ,
395400 cdse_credentials = args .cdse_credentials ,
396401 snap_gpt_path = args .snap_gpt_path ,
402+ ratio = args .ratio ,
403+ #sigma=args.sigma_doy,
397404 )
0 commit comments