@@ -463,8 +463,6 @@ def quick_compare():
463
463
)
464
464
parser .contour_intern_arg ()
465
465
args = parser .parse_args ()
466
- if args .path_out is not None and not exists (args .path_out ):
467
- mkdir (args .path_out )
468
466
469
467
kw = dict (
470
468
include_vars = [
@@ -475,6 +473,9 @@ def quick_compare():
475
473
if args .area :
476
474
kw ["include_vars" ].append ("speed_area" if args .intern else "effective_area" )
477
475
476
+ if args .path_out is not None :
477
+ kw = dict ()
478
+
478
479
ref = EddiesObservations .load_file (args .ref , ** kw )
479
480
print (f"[ref] { args .ref } -> { len (ref )} obs" )
480
481
groups_ref , groups_other = dict (), dict ()
@@ -493,6 +494,21 @@ def quick_compare():
493
494
groups_ref [other_ ] = gr1
494
495
groups_other [other_ ] = gr2
495
496
497
+ if args .path_out is not None :
498
+ if not exists (args .path_out ):
499
+ mkdir (args .path_out )
500
+ for i , other_ in enumerate (args .others ):
501
+ dirname_ = f"{ args .path_out } /{ other_ .replace ('/' , '_' )} /"
502
+ if not exists (dirname_ ):
503
+ mkdir (dirname_ )
504
+ for k , v in groups_other [other_ ].items ():
505
+ basename_ = f"other_{ k } .nc"
506
+ others [other_ ].index (v ).write_file (filename = f"{ dirname_ } /{ basename_ } " )
507
+ for k , v in groups_ref [other_ ].items ():
508
+ basename_ = f"ref_{ k } .nc"
509
+ ref .index (v ).write_file (filename = f"{ dirname_ } /{ basename_ } " )
510
+ return
511
+
496
512
def display (value , ref = None ):
497
513
outs = list ()
498
514
for v in value :
0 commit comments