Time zones

[1]:
import earthkit.data
import earthkit.plots
[2]:
data = earthkit.data.from_source(
    'cds',
    'reanalysis-era5-single-levels',
    {
        'product_type': 'reanalysis',
        'variable': '2m_temperature',
        'year': '2024',
        'month': '05',
        'day': '04',
        'time': '12:00',
    },
)
2025-02-04 14:11:16,382 WARNING [2025-02-04T14:11:16.361399] You are using a deprecated API endpoint. If you are using cdsapi, please upgrade to the latest version.
2025-02-04 14:11:16,384 INFO Request ID is a843faaf-5a99-4019-ab5e-6667c4133d29
2025-02-04 14:11:16,472 INFO status has been updated to accepted
2025-02-04 14:11:23,814 INFO status has been updated to running
2025-02-04 14:11:29,149 INFO status has been updated to successful
[3]:
chart = earthkit.plots.Map(domain="Japan")

chart.block(data, levels=range(31), colors="turbo", units="celsius")

with earthkit.plots.schema.set(time_zone="Asia/Tokyo"):
    chart.title("{variable_name} at {time:%H:%M %Z} ({utc_offset}) on {time:%-d %B %Y}")

chart.coastlines()
chart.borders()
chart.gridlines()

chart.legend(location="right")

chart.show()
/Users/mavj/ek-plots-tests/earthkit-plots/src/earthkit/plots/components/subplots.py:987: UserWarning: block is deprecated and will be removed in a future release. Please use grid_cells instead.
  warnings.warn(
Attempting time zone conversion, but some data has no time zone metadata; assuming UTC
Attempting time zone conversion, but some data has no time zone metadata; assuming UTC
Attempting time zone conversion, but some data has no time zone metadata; assuming UTC
../../../_images/examples_gallery_gridded-data_time-zones_3_1.png