# (C) Copyright 1996-2019 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernmental organisation nor # does it submit to any jurisdiction. import xarray as xr import numpy as np from Magics import macro as magics ref = "xarray2" ds = xr.open_dataset('netcdf3_t_z.nc') png = magics.output(output_name_first_page_number = "off", output_name = ref) data = magics.mxarray( xarray_dataset = ds, xarray_variable_name = "z", xarray_dimension_settings = { "time": np.datetime64('2017-10-13T00:00:00.000000000'), "level": 925}), contour = magics.mcont(contour_automatic_setting = "ecmwf") magics.plot(png, data, contour, magics.mcoast())
# (C) Copyright 1996-2019 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernmental organisation nor # does it submit to any jurisdiction. import xarray as xr import numpy as np from Magics import macro as magics ref = "xarray1" ds = xr.open_dataset('2t.nc') png = magics.output(output_name_first_page_number = "off", output_name = ref) data = magics.mxarray(xarray_dataset = ds, xarray_variable_name = "t2m") contour = magics.mcont(contour_automatic_setting = "ecmwf") magics.plot(png, data, contour, magics.mcoast())
# (C) Copyright 1996-2019 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernmental organisation nor # does it submit to any jurisdiction. import cftime import xarray as xr import numpy as np from Magics import macro as magics ref = "xarray7" ds = xr.open_dataset('2dlatlon.nc') time = cftime.DatetimeNoLeap(2081, 2, 15, 0, 0, 0, 0, 5, 46) png = magics.output(output_name_first_page_number="off", output_name=ref) data = magics.mxarray(xarray_dataset=ds, xarray_variable_name="sic", xarray_dimension_settings={ "bnds": 1.0, "time": time }) contour = magics.mcont(contour_automatic_setting="ecmwf") magics.plot(png, data, contour, magics.mcoast())
# (C) Copyright 1996-2019 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernmental organisation nor # does it submit to any jurisdiction. import cftime import xarray as xr import numpy as np from Magics import macro as magics ref = "xarray3" ds = xr.open_dataset('tos_O1_2001-2002.nc') time = cftime.Datetime360Day(2001, 1, 16, 0, 0, 0, 0, 5, 16) png = magics.output(output_name_first_page_number="off", output_name=ref) data = magics.mxarray(xarray_dataset=ds, xarray_variable_name="tos", xarray_dimension_settings={"time": time}) contour = magics.mcont(contour_automatic_setting="ecmwf") magics.plot(png, data, contour, magics.mcoast())
# (C) Copyright 1996-2019 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernmental organisation nor # does it submit to any jurisdiction. import xarray as xr import numpy as np from Magics import macro as magics ref = "xarray5" ds = xr.open_dataset('C3S_OZONE-L4-TC-ASSIM_MSR-201608-fv0020.nc', decode_times=False) png = magics.output(output_name_first_page_number = "off", output_name = ref) data = magics.mxarray(xarray_dataset = ds, xarray_variable_name = "total_ozone_column") contour = magics.mcont(contour_automatic_setting = "ecmwf") magics.plot(png, data, contour, magics.mcoast())