diff --git a/Inst_eddies/Documentation_texfol/Graphiques/regions.py b/Inst_eddies/Documentation_texfol/Graphiques/regions.py index 223d196f70e6b008063abaff6de19553b5375e7b..754b36d6b670146f287f0c232a45b2901bc2b53d 100755 --- a/Inst_eddies/Documentation_texfol/Graphiques/regions.py +++ b/Inst_eddies/Documentation_texfol/Graphiques/regions.py @@ -17,8 +17,14 @@ colors = itertools.cycle(['blue', 'orange', 'green', 'red', 'purple', 'brown', for filename in glob.glob("h_region_*.nc") + ["h_outermost.nc"]: with netCDF4.Dataset(filename) as f: - jumble.draw_bbox(f.variables["lon"][0], f.variables["lon"][-1], - f.variables["lat"][0], f.variables["lat"][-1], + if "lon" in f.variables: + lon = "lon" + lat = "lat" + else: + lon = "longitude" + lat = "latitude" + + jumble.draw_bbox(f[lon][0], f[lon][-1], f[lat][0], f[lat][-1], colors = [next(colors)], label = filename) plt.legend(loc = "lower left", bbox_to_anchor = (1, 0.5))