Skip to content

Commit

Permalink
fixed daily output file name
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptisteVandecrux committed Jun 12, 2024
1 parent 697fa60 commit b9fb365
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pypromice/process/get_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def get_l2():

# Write out level 2
if args.outpath is not None:
if not os.path.isdir(arg.outpath):
os.mkdir(arg.outpath)
if not os.path.isdir(args.outpath):
os.mkdir(args.outpath)
if aws.L2.attrs['format'] == 'raw':
prepare_and_write(aws.L2, args.outpath, getVars(), getMeta(), '10min')
prepare_and_write(aws.L2, args.outpath, getVars(), getMeta(), '60min')
Expand Down
3 changes: 3 additions & 0 deletions src/pypromice/process/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def prepare_and_write(dataset, outpath, vars_df, meta_dict, time='60min'):
elif t == 3600:
out_csv = os.path.join(outdir, d2.attrs['station_id']+'_hour.csv')
out_nc = os.path.join(outdir, d2.attrs['station_id']+'_hour.nc')
elif t == 86400:
out_csv = os.path.join(outdir, d2.attrs['station_id']+'_day.csv')
out_nc = os.path.join(outdir, d2.attrs['station_id']+'_day.nc')
else:
out_csv = os.path.join(outdir, d2.attrs['station_id']+'_month.csv')
out_nc = os.path.join(outdir, d2.attrs['station_id']+'_month.nc')
Expand Down

0 comments on commit b9fb365

Please sign in to comment.