Commit c50ee7d2 authored by Clément Haëck's avatar Clément Haëck
Browse files

grid_file argument does not comprise extension

parent 5534b76e
......@@ -50,7 +50,7 @@ def generate_grid(args, zone, land):
def main():
args = lib.get_args(['region'], add_args=add_args)
args['grid_file'] = 'boxgrid_{:.1f}_{:.1f}.txt'.format(
args['grid_file'] = 'boxgrid_{:.1f}_{:.1f}'.format(
args['size_lon'], args['size_lat'])
grid_file = lib.box.IndexBox.GetGridFile(args)
......@@ -76,6 +76,9 @@ def main():
ax.set_xlim(args['lon_min'], args['lon_max'])
ax.set_ylim(args['lat_min'], args['lat_max'])
fig.canvas.draw()
fig.savefig(path.splitext(grid_file)[0] + '.png',
dpi=300)
if __name__ == '__main__':
......
......@@ -24,7 +24,7 @@ def main():
parser.add_argument('-threshold', type=float, default=5.)
parser.add_argument('-nbins', type=int, default=3000)
parser.add_argument('-grid_file', type=str,
default='boxgrid_5.0_5.0.txt')
default='boxgrid_5.0_5.0')
args = lib.get_args(['region', 'year', 'days',
'scale', 'number', 'coef', 'fixes'],
......
......@@ -270,7 +270,8 @@ class IndexBox(Box):
Arguments must contain 'region' and 'grid_file'.
"""
return path.join(lib.root_data, args['region'], args['grid_file'])
return path.join(lib.root_data, args['region'],
args['grid_file'] + '.txt')
class Image(Box):
......
......@@ -9,4 +9,4 @@ number: 1
coef: 0
level: L3
zone: gyre
grid_file: boxgrid_5.0_5.0.txt
grid_file: boxgrid_5.0_5.0
......@@ -18,7 +18,7 @@ def get_root(args=None, **kwargs):
return root
def k2c(ds, variable='SST'):
def k2c(ds, variable='analysed_sst'):
ds[variable] -= 273.15
ds[variable].attrs['units'] = 'celsius'
return ds
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment