Hi
I'm following the how-to guide on making a dynamic map, and trying to get it to work with a different dataset. By the way, the new guides and documentation are great and very helpful!
My script works fine with the original dataset, but instead of a nice gridded map it shows a map with blue contours when I use another dataset. In the how-to guide there is a note saying that "If you pass a data array with no name or a non-CDM name, a default blue contour line map will be returned", so perhaps this is to be expected.
My question is, how to deal with this issue? I've tried to update the attributes and name of my dataset, but to no avail, it still plots as blue contours. Even renaming the data array to give it the same name as the data in the example ('tas') doesn't help, suggesting it is not just a matter of the name being non-CDM. Exactly what attributes would I need to change for my data to be sufficiently CDM-compliant so that it would plot as a grid?
This is my script with the output of the print statement below.
import cdstoolbox as ct # Initialise the application @ct.application(title='Dynamic map', fullscreen=True) @ct.output.livemap() def application(): # Retrieve full resolution temperature data for a single date data = ct.catalogue.retrieve( 'sis-agrometeorological-indicators', { 'variable': '2m_temperature', 'statistics': 'day_time_maximum', 'year': '2018', 'month': '07' } ) # Plot temperature as a layer on a dynamic map print(data) plot = ct.livemap.plot(data) return plot |
Output:
<xarray.DataArray 'tasmax' (time: 31, lat: 1801, lon: 3600)> dask.array<xarray-tasmax, shape=(31, 1801, 3600), dtype=float32, chunksize=(31, 1801, 3600), chunktype=numpy.ndarray> Coordinates: * time (time) datetime64[ns] 2018-07-01 2018-07-02 ... 2018-07-31 * lon (lon) float64 -180.0 -179.9 -179.8 -179.7 ... 179.7 179.8 179.9 * lat (lat) float64 -90.0 -89.9 -89.8 -89.7 -89.6 ... 89.7 89.8 89.9 90.0 Attributes: long_name: Maximum temperature at 2 meter (06-18LT) units: K temporal_aggregation: Max 06-18LT standard_name: air_temperature comment: maximum near-surface (usually, 2 meter) air temper... type: real |
Many thanks for any pointers!
Rutger