An example for the use of Intake for plotting 2m air temperatures.

The variable to be plotted is set in ‘var’ in the third field.

Copyright 2021 Florian Ziemen ziemen@dkrz.de. This program is free software: you can redistribute it and/or modify it under the terms of the BSD-3-Clause license (see bottom for details).

[1]:
import intake
import xarray as xr
import numpy as np
import os
import matplotlib.pyplot as plt
import cartopy.crs as crs
# import pandas as pd


[2]:

col_url = "/pf/k/k202134/DYAMOND/Processing/full_catalog.json"
col = intake.open_esm_datastore(col_url)

col
#col.unique()['variable']

ICON-ESM catalog with 67 dataset(s) from 64957 asset(s):

unique
variable 462
experiment 3
frequency 7
level_type 5
operation 3
time_range 853
filename 64947
institute 10
model 15
grid 3
ensemble_member 4
domain 4
project 2
[3]:
var = "tas"
cat = col.search( # institute="ECMWF",
               variable=var,
#                frequency=["15min", "1hr", "30min", "3hr" , "12hr"]
  #              time_range="2020-02-05T00:00:00.000-2020-02-05T23:59:20.000"
    #   grid="gn"
             )
#cat_dict = cat.to_dataset_dict()
cat_dict = cat.to_dataset_dict(cdf_kwargs={'chunks': {'time': 1}})
#cat_dict

--> The keys in the returned dictionary of datasets are constructed as follows:
        'project.institute.model.experiment.domain.frequency.grid.level_type.ensemble_member.operation'
100.00% [20/20 02:08<00:00]
[4]:
def name2dict(name):
    (project, institute, model, experiment, domain, frequency, grid, level_type, ensemble_member, operation) = name.split('.')
    ret =   {"project" : project, "institute" : institute, "model" : model, "experiment" :experiment, "domain" : domain, "frequency" : frequency, "grid": grid, "level_type" : level_type, "ensemble_member" : ensemble_member, "operation" : operation}
    print (ret)
    return ret
def guess_grid_file(name):
    nd = name2dict (name) # /work/ka1081/DYAMOND_WINTER/MPIM-DWD-DKRZ/ICON-SAP-5km/DW-CPL/atmos/fx/gn/
    return "/work/ka1081/{project}/{institute}/{model}/{experiment}/{domain}/fx/{grid}/grid.nc".format(**nd)
[5]:
def get_coords(cat_dict, x, var):
    root = '/work/ka1081/'
    end = "/grid.nc"
    lat = None
    lon = None
    grid = None
    print ("Processing " + x)
    components = x.split(".")
    image_filename = "tas_" + x + ".png"
    try:
        grid_file_name = guess_grid_file(x)
        grid = xr.open_dataset (grid_file_name)
        ds = xr.merge([cat_dict[x], grid])
        print ("loaded grid from file " + grid_file_name)
    except:
        print ("could not open a grid file at " + grid_file_name)
        ds = cat_dict[x]
    lat, lon = guess_coords(ds, var)
    print ('got coordinates')
    if lat.max()> 4:
        print ("converting degree to radian")
        lat = lat*np.pi/180.
        lon = lon*np.pi/180.
        lat['units'] = 'radian'
        lon['units'] = 'radian'

    if (lon.max() > np.pi):
        print ("shifting from 0 to 2pi to -pi to pi")
        lon = lon -  ( 2 * np.pi * (lon > np.pi))
#    print ("max lon ", lon.max())
    return (ds, lat, lon)



def guess_coords(ds, var):
    try:
#        print (ds[var].coordinates)
        lon, lat = [ds[x] for x in ds[var].coordinates.split()]
        print ("using " + ds[var].coordinates + " from coordinates attribute as coordinates.")
    except:
        lat = None
        lon = None
        try:
            lon = ds.clon
            lat = ds.clat
            print ("using clat and clon directly.")
        except:
            try:
                lon = ds.lon
                lat = ds.lat
            except:
                lat = None
                lon = None
                try:
                    for co in ds[var].coords.keys():
                        print ("trying variables from coords property " + co)
                        if "lon" in co:
                            print ("found " + co + " for *lon*.")
                            lon = ds[co]
                        if "lat" in co:
                            print ("found " + co + " for *lat*.")
                            lat = ds[co]
                    lat.shape
                except:
                    lat = None
                    lon = None

                    lon = ds[ds[var].dims[-1]]
                    lat = ds[ds[var].dims[-2]]
                    print ("using " + ds[var].dims[-1] + " as lon")
                    print ("using " + ds[var].dims[-2] + " as lat")
    return (lat, lon)
[6]:
def plot_fields(cat_dict, x, var, skip=100, raw_dot_size=5e9 , vmin=240, vmax=300):
    ds, lat, lon = get_coords(cat_dict, x, var)
    #    print (ds.time)
    ts=('2020-02-05T12:00:00')
    try:
        print (ds.time.units)
        if (ds.time.units== "day as %Y%m%d.%f"):
#            print (ds.time)
            ts=20200205.5
    except:
        pass
        #       [print (x) for x in ds.time]
    if (lon.shape[-1] != ds[var].shape[-1] or lat.shape[-1] != ds[var].shape[-1]):
        print ("assuming the grid to be lat x lon")
        print(lon.shape[-1], " != ", ds[var].shape[-1])
        print(lat.shape[-1], " != ", ds[var].shape[-1])

        lon, lat = np.meshgrid(lon, lat)
        #        print(ds.tas[0][5].shape)
        lon = lon.flatten()
        lat = lat.flatten()
        dflat = np.array(np.squeeze(ds[var].sel(time=ts))).flatten()
    else:
        print ("assuming full field variables for lat and lon")
        lon = np.array(lon).flatten()
        lat = np.array(lat).flatten()
        dflat = np.array(np.squeeze(ds[var].sel(time = ts))).flatten()
    print ("###############", lon.max())
    c = dflat[::skip]
    fig = plt.figure(figsize=(10,4))
    ax = fig.add_subplot(1,1,1, projection=crs.Mollweide())
    ax.set_global()
    #    print (raw_dot_size*1.0/skip/len(lon), " as dot size")
    plt.scatter(lon[::skip]*180/np.pi,
                lat[::skip]*180/np.pi,
                c=c,
                marker='o',
                s=raw_dot_size*1.0/skip/len(lon),
                cmap="inferno",
                vmin=vmin,
                vmax=vmax,
                transform=crs.PlateCarree()
               )

    print (lon[::skip]*180/np.pi,
            lat[::skip]*180/np.pi,
            np.squeeze(dflat)[::skip])
    components = x.split(".")
    plt.title(" ".join (components[:3]))
    plt.colorbar()

    image_filename = var + "_" + x + ".png"
    plt.savefig(image_filename)
#    plt.close()
[7]:
for x in cat_dict.keys():
    print ("")
    if "." in x:
#        try:
            plot_fields(cat_dict, x, var, skip=79, vmin=240, vmax=300)
#        except e:
#            print ("can't plot ", x, e )

Processing DYAMOND_WINTER.MPIM-DWD-DKRZ.ICON-SAP-5km.DW-CPL.atmos.6hr.gn.ml.dpp0029.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'MPIM-DWD-DKRZ', 'model': 'ICON-SAP-5km', 'experiment': 'DW-CPL', 'domain': 'atmos', 'frequency': '6hr', 'grid': 'gn', 'level_type': 'ml', 'ensemble_member': 'dpp0029', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/MPIM-DWD-DKRZ/ICON-SAP-5km/DW-CPL/atmos/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
day as %Y%m%d.%f
assuming full field variables for lat and lon
############### 3.141592566920249
[73.         73.05681214 72.38051029 ... 76.75600283 77.1945105
 76.08895849] [ 52.60689104  52.86428464  52.54610581 ... -44.92042431 -45.09067004
 -45.48656493] [271.34592 271.25406 270.4336  ... 284.7231  284.69113 284.94244]

Processing DYAMOND_WINTER.MPIM-DWD-DKRZ.ICON-SAP-5km.DW-ATM.atmos.6hr.gn.ml.dpp0014.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'MPIM-DWD-DKRZ', 'model': 'ICON-SAP-5km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '6hr', 'grid': 'gn', 'level_type': 'ml', 'ensemble_member': 'dpp0014', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/MPIM-DWD-DKRZ/ICON-SAP-5km/DW-ATM/atmos/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
assuming full field variables for lat and lon
############### 3.141592566920249
[73.         73.05681214 72.38051029 ... 76.75600283 77.1945105
 76.08895849] [ 52.60689104  52.86428464  52.54610581 ... -44.92042431 -45.09067004
 -45.48656493] [273.30835 273.35986 273.29175 ... 284.65152 284.83887 285.3542 ]

Processing DYAMOND_WINTER.ECMWF.IFS-4km.DW-CPL.atmos.1hr.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'ECMWF', 'model': 'IFS-4km', 'experiment': 'DW-CPL', 'domain': 'atmos', 'frequency': '1hr', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/ECMWF/IFS-4km/DW-CPL/atmos/fx/gn/grid.nc
using clat and clon directly.
got coordinates
assuming full field variables for lat and lon
############### 3.141592653589793
[  0.          78.75       162.         ... -98.18181818 -90.
 150.        ] [ 89.97309123  89.86805875  89.79779402 ... -89.76265262 -89.83293066
 -89.93823315] [239.53775 239.31314 239.72916 ... 236.08463 236.28384 236.15884]

Processing NextGEMS.ECMWF-AWI.IFS-FESOM2-4km.Cycle1.atm.12hr.gn.2d.r1i1p1f1.unknown
{'project': 'NextGEMS', 'institute': 'ECMWF-AWI', 'model': 'IFS-FESOM2-4km', 'experiment': 'Cycle1', 'domain': 'atm', 'frequency': '12hr', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/NextGEMS/ECMWF-AWI/IFS-FESOM2-4km/Cycle1/atm/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
assuming full field variables for lat and lon
############### 3.141592653589793
[  0.          78.75       162.         ... -98.18181818 -90.
 150.        ] [ 89.97309123  89.86805875  89.79779402 ... -89.76265262 -89.83293066
 -89.93823315] [240.1891  240.47035 240.50941 ... 239.07973 239.43129 239.49379]

Processing DYAMOND_WINTER.LLNL.SCREAM-3km.DW-ATM.atmos.15min.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'LLNL', 'model': 'SCREAM-3km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/LLNL/SCREAM-3km/DW-ATM/atmos/fx/gn/grid.nc
using grid_center_lon grid_center_lat from coordinates attribute as coordinates.
got coordinates
converting degree to radian
shifting from 0 to 2pi to -pi to pi
assuming full field variables for lat and lon
############### 3.141209158392822
[-44.97803576 -43.26416838 -41.55030099 ... 139.65908379 137.98840072
 136.2744358 ] [-35.25403233 -35.99945755 -36.74700071 ...  37.37844932  36.63372702
  35.8749468 ] [294.93716 294.67065 294.56924 ... 270.8223  269.62244 273.00708]

Processing NextGEMS.ECMWF-AWI.IFS-NEMO-9km.Cycle1.atm.1hr.gn.2d.r1i1p1f1.unknown
{'project': 'NextGEMS', 'institute': 'ECMWF-AWI', 'model': 'IFS-NEMO-9km', 'experiment': 'Cycle1', 'domain': 'atm', 'frequency': '1hr', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-9km/Cycle1/atm/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
assuming full field variables for lat and lon
############### 3.141592653589793
[  0.    78.75 162.   ...  18.    56.25   0.  ] [ 89.94618772  89.73614327  89.59562754 ... -89.59562754 -89.73614327
 -89.94618772] [240.98825 241.33395 240.2109  ... 238.25583 238.44528 237.93942]

Processing DYAMOND_WINTER.SBU.SAM2-4km.DW-ATM.atmos.15min.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'SBU', 'model': 'SAM2-4km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
could not open a grid file at /work/ka1081/DYAMOND_WINTER/SBU/SAM2-4km/DW-ATM/atmos/fx/gn/grid.nc
got coordinates
converting degree to radian
shifting from 0 to 2pi to -pi to pi
assuming the grid to be lat x lon
9216  !=  9216
4608  !=  9216
############### 3.1415927410125732
[ 0.          3.08593752  6.17187505 ... -6.52344902 -3.43748759
 -0.35155348] [-88.9 -88.9 -88.9 ...  88.9  88.9  88.9] [241.65364 241.69312 241.71848 ... 233.99245 233.97412 233.99808]

Processing DYAMOND_WINTER.ECMWF.IFS-9km.DW-CPL.atmos.1hr.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'ECMWF', 'model': 'IFS-9km', 'experiment': 'DW-CPL', 'domain': 'atmos', 'frequency': '1hr', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/ECMWF/IFS-9km/DW-CPL/atmos/fx/gn/grid.nc
using clat and clon directly.
got coordinates
assuming full field variables for lat and lon
############### 3.141592653589793
[  0.    78.75 162.   ...  18.    56.25   0.  ] [ 89.94618772  89.73614327  89.59562754 ... -89.59562754 -89.73614327
 -89.94618772] [239.13432 239.74565 240.01714 ... 241.38042 240.53667 240.2144 ]

Processing DYAMOND_WINTER.NOAA.SHiELD-3km.DW-ATM.atmos.15min.gn.pl.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'NOAA', 'model': 'SHiELD-3km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': 'pl', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/NOAA/SHiELD-3km/DW-ATM/atmos/fx/gn/grid.nc
using lon lat from coordinates attribute as coordinates.
got coordinates
shifting from 0 to 2pi to -pi to pi
assuming full field variables for lat and lon
############### 3.141589641571045
[-54.98782125 -53.0420916  -51.05248482 ...  30.78396995  32.77986734
  34.73167927] [-35.25864885 -36.14968118 -37.0085399  ... -37.14391767 -36.28911608
 -35.40188817] [292.3522  292.32578 292.4368  ... 293.98148 294.38168 296.0521 ]

Processing DYAMOND_WINTER.MPIM-DWD-DKRZ.ICON-SAP-5km.DW-ATM.atmos.15min.gn.2d.dpp0014.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'MPIM-DWD-DKRZ', 'model': 'ICON-SAP-5km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'dpp0014', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/MPIM-DWD-DKRZ/ICON-SAP-5km/DW-ATM/atmos/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
assuming full field variables for lat and lon
############### 3.141592566920249
[73.         73.05681214 72.38051029 ... 76.75600283 77.1945105
 76.08895849] [ 52.60689104  52.86428464  52.54610581 ... -44.92042431 -45.09067004
 -45.48656493] [273.4005  273.06854 273.08554 ... 284.59222 284.78564 285.3213 ]

Processing NextGEMS.ECMWF-AWI.IFS-NEMO-4km.Cycle1.atm.1hr.gn.2d.r1i1p1f1.unknown
{'project': 'NextGEMS', 'institute': 'ECMWF-AWI', 'model': 'IFS-NEMO-4km', 'experiment': 'Cycle1', 'domain': 'atm', 'frequency': '1hr', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
assuming full field variables for lat and lon
############### 3.141592653589793
[  0.          78.75       162.         ... -98.18181818 -90.
 150.        ] [ 89.97309123  89.86805875  89.79779402 ... -89.76265262 -89.83293066
 -89.93823315] [251.37659 251.45862 251.40198 ... 236.65979 236.8512  236.89026]

Processing NextGEMS.MPIM-DWD-DKRZ.ICON-SAP-5km.Cycle1.atm.30min.gn.2d.dpp0052.mean
{'project': 'NextGEMS', 'institute': 'MPIM-DWD-DKRZ', 'model': 'ICON-SAP-5km', 'experiment': 'Cycle1', 'domain': 'atm', 'frequency': '30min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'dpp0052', 'operation': 'mean'}
loaded grid from file /work/ka1081/NextGEMS/MPIM-DWD-DKRZ/ICON-SAP-5km/Cycle1/atm/fx/gn/grid.nc
using clat and clon directly.
got coordinates
day as %Y%m%d.%f
assuming full field variables for lat and lon
############### 3.141592566920249
[73.         73.05681214 72.38051029 ... 76.75600283 77.1945105
 76.08895849] [ 52.60689104  52.86428464  52.54610581 ... -44.92042431 -45.09067004
 -45.48656493] [250.84354 252.67932 248.94806 ... 286.89102 286.3836  286.76227]

Processing DYAMOND_WINTER.METEOFR.ARPEGE-NH-2km.DW-ATM.atmos.15min.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'METEOFR', 'model': 'ARPEGE-NH-2km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/METEOFR/ARPEGE-NH-2km/DW-ATM/atmos/fx/gn/grid.nc
using clat and clon directly.
got coordinates
assuming full field variables for lat and lon
############### 3.141592653589793
[   0.    45.   -30.  ... -120.    67.5    0. ] [ 89.98299039  89.9165971   89.89439188 ... -89.84996762 -89.89439188
 -89.93879118] [270.84045 270.88593 270.79495 ... 241.23639 240.91806 240.7589 ]

Processing DYAMOND_WINTER.MPIM-DWD-DKRZ.ICON-SAP-5km.DW-CPL.atmos.15min.gn.2d.dpp0029.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'MPIM-DWD-DKRZ', 'model': 'ICON-SAP-5km', 'experiment': 'DW-CPL', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'dpp0029', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/MPIM-DWD-DKRZ/ICON-SAP-5km/DW-CPL/atmos/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
day as %Y%m%d.%f
assuming full field variables for lat and lon
############### 3.141592566920249
[73.         73.05681214 72.38051029 ... 76.75600283 77.1945105
 76.08895849] [ 52.60689104  52.86428464  52.54610581 ... -44.92042431 -45.09067004
 -45.48656493] [270.97043 271.51242 270.72806 ... 284.50314 284.7178  285.20032]

Processing NextGEMS.MPIM-DWD-DKRZ.ICON-SAP-5km.Cycle1.atm.30min.gn.2d.dpp0052.inst
{'project': 'NextGEMS', 'institute': 'MPIM-DWD-DKRZ', 'model': 'ICON-SAP-5km', 'experiment': 'Cycle1', 'domain': 'atm', 'frequency': '30min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'dpp0052', 'operation': 'inst'}
loaded grid from file /work/ka1081/NextGEMS/MPIM-DWD-DKRZ/ICON-SAP-5km/Cycle1/atm/fx/gn/grid.nc
using clat and clon directly.
got coordinates
day as %Y%m%d.%f
assuming full field variables for lat and lon
############### 3.141592566920249
[73.         73.05681214 72.38051029 ... 76.75600283 77.1945105
 76.08895849] [ 52.60689104  52.86428464  52.54610581 ... -44.92042431 -45.09067004
 -45.48656493] [250.48587 252.07964 248.49669 ... 287.3047  286.60544 286.69427]

Processing DYAMOND_WINTER.AORI.NICAM-3km.DW-ATM.atmos.15min.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'AORI', 'model': 'NICAM-3km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
could not open a grid file at /work/ka1081/DYAMOND_WINTER/AORI/NICAM-3km/DW-ATM/atmos/fx/gn/grid.nc
got coordinates
converting degree to radian
shifting from 0 to 2pi to -pi to pi
assuming the grid to be lat x lon
10240  !=  10240
5120  !=  10240
############### 3.141285475641442
[ 0.0176  2.7949  5.5723 ... -7.4707 -4.6934 -1.916 ] [-89.9824 -89.9824 -89.9824 ...  89.9824  89.9824  89.9824] [241.13304 241.13501 241.13707 ... 269.99792 269.99683 269.9957 ]

Processing DYAMOND_WINTER.MetOffice.UM-5km.DW-ATM.atmos.15min.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'MetOffice', 'model': 'UM-5km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
could not open a grid file at /work/ka1081/DYAMOND_WINTER/MetOffice/UM-5km/DW-ATM/atmos/fx/gn/grid.nc
trying variables from coords property time
trying variables from coords property longitude
found longitude for *lon*.
trying variables from coords property latitude
found latitude for *lat*.
got coordinates
converting degree to radian
shifting from 0 to 2pi to -pi to pi
assuming the grid to be lat x lon
5120  !=  5120
3840  !=  5120
############### 3.140979051589966
[  0.03515625   5.58984389  11.14453109 ... -15.99607445 -10.44138213
  -4.8866898 ] [-89.97656 -89.97656 -89.97656 ...  89.97656  89.97656  89.97656] [244.80054 244.80518 244.8125  ... 248.25317 248.26099 248.25659]

Processing DYAMOND_WINTER.MPIM-DWD-DKRZ.ICON-NWP-2km.DW-ATM.atmos.15min.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'MPIM-DWD-DKRZ', 'model': 'ICON-NWP-2km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/DYAMOND_WINTER/MPIM-DWD-DKRZ/ICON-NWP-2km/DW-ATM/atmos/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
assuming full field variables for lat and lon
############### 3.1415924913770916
[73.         73.19769918 72.80174973 ... 76.57372993 76.0883897
 76.51711138] [ 52.60684202  52.65625795  52.75526292 ... -45.30234493 -45.48816598
 -45.18180946] [266.65564 267.56775 266.11267 ... 283.80408 284.62634 283.65173]

Processing DYAMOND_WINTER.NASA.GEOS-3km.DW-ATM.atmos.15min.gn.2d.r1i1p1f1.unknown
{'project': 'DYAMOND_WINTER', 'institute': 'NASA', 'model': 'GEOS-3km', 'experiment': 'DW-ATM', 'domain': 'atmos', 'frequency': '15min', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
could not open a grid file at /work/ka1081/DYAMOND_WINTER/NASA/GEOS-3km/DW-ATM/atmos/fx/gn/grid.nc
trying variables from coords property time
trying variables from coords property lons
found lons for *lon*.
trying variables from coords property lats
found lats for *lat*.
got coordinates
converting degree to radian
shifting from 0 to 2pi to -pi to pi
assuming full field variables for lat and lon
############### 3.1415927410125732
[-54.98700163 -52.91005039 -50.78299288 ...  29.89225802  32.04056766
  34.13839879] [-35.258274 -36.207565 -37.12011  ... -37.50984  -36.612637 -35.677795] [295.1723  296.1714  295.57526 ... 296.252   295.75882 295.619  ]

Processing NextGEMS.ECMWF-AWI.IFS-NEMO-DEEPon-4km.Cycle1.atm.1hr.gn.2d.r1i1p1f1.unknown
{'project': 'NextGEMS', 'institute': 'ECMWF-AWI', 'model': 'IFS-NEMO-DEEPon-4km', 'experiment': 'Cycle1', 'domain': 'atm', 'frequency': '1hr', 'grid': 'gn', 'level_type': '2d', 'ensemble_member': 'r1i1p1f1', 'operation': 'unknown'}
loaded grid from file /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/fx/gn/grid.nc
using clon clat from coordinates attribute as coordinates.
got coordinates
assuming full field variables for lat and lon
############### 3.141592653589793
[  0.          78.75       162.         ... -98.18181818 -90.
 150.        ] [ 89.97309123  89.86805875  89.79779402 ... -89.76265262 -89.83293066
 -89.93823315] [245.07657 245.27579 245.2211  ... 236.16641 236.35782 236.39883]
../../_images/Processing_Intake_grid-guessing-test_7_1.png
../../_images/Processing_Intake_grid-guessing-test_7_2.png
../../_images/Processing_Intake_grid-guessing-test_7_3.png
../../_images/Processing_Intake_grid-guessing-test_7_4.png
../../_images/Processing_Intake_grid-guessing-test_7_5.png
../../_images/Processing_Intake_grid-guessing-test_7_6.png
../../_images/Processing_Intake_grid-guessing-test_7_7.png
../../_images/Processing_Intake_grid-guessing-test_7_8.png
../../_images/Processing_Intake_grid-guessing-test_7_9.png
../../_images/Processing_Intake_grid-guessing-test_7_10.png
../../_images/Processing_Intake_grid-guessing-test_7_11.png
../../_images/Processing_Intake_grid-guessing-test_7_12.png
../../_images/Processing_Intake_grid-guessing-test_7_13.png
../../_images/Processing_Intake_grid-guessing-test_7_14.png
../../_images/Processing_Intake_grid-guessing-test_7_15.png
../../_images/Processing_Intake_grid-guessing-test_7_16.png
../../_images/Processing_Intake_grid-guessing-test_7_17.png
../../_images/Processing_Intake_grid-guessing-test_7_18.png
../../_images/Processing_Intake_grid-guessing-test_7_19.png
../../_images/Processing_Intake_grid-guessing-test_7_20.png
[ ]:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

[ ]:

[ ]:

[ ]:

[ ]:

[ ]:

[ ]:

[ ]: