Skip to content

Commit fcce30a

Browse files
committed
Change output mode
1 parent df055cc commit fcce30a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/scripts/EddyMergeCorrespondances

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Track eddy with Identification file produce with EddyIdentification
55
"""
66
from py_eddy_tracker import EddyParser
77
from py_eddy_tracker.tracking import Correspondances
8-
from os.path import exists
8+
from os.path import exists, dirname
99
from os import mkdir
1010
import logging
1111
from numpy import unique
@@ -22,23 +22,21 @@ def usage():
2222
nargs='+',
2323
help='File of correspondances to reload link '
2424
'without tracking computation')
25-
parser.add_argument('--path_out',
26-
default='./',
27-
help='Path, where to write file')
25+
parser.add_argument('path_out', help='Path, where to write file')
2826
return parser.parse_args()
2927

3028

3129
if __name__ == '__main__':
3230
CONFIG = usage()
3331

3432
# Create output directory
35-
if not exists(CONFIG.path_out):
36-
mkdir(CONFIG.path_out)
33+
if not exists(dirname(CONFIG.path_out)):
34+
mkdir(dirname(CONFIG.path_out))
3735

3836
START_TIME = dt.datetime.now()
3937
CORRESPONDANCES = Correspondances.load(CONFIG.nc_file[0])
4038
logging.info('Start merging')
4139
for i in CONFIG.nc_file[1:]:
4240
CORRESPONDANCES.merge_correspondance(Correspondances.load(i))
4341

44-
CORRESPONDANCES.save('%s/toto.nc' % CONFIG.path_out)
42+
CORRESPONDANCES.save(CONFIG.path_out)

0 commit comments

Comments
 (0)