Frequently Asked Questions (FAQ)
The section below tries to answer the most frequently asked questions
What is the geographical form of the input data
As outlined in the section on data shape the regional climate model data comes an a grid representing a rotated pole projection. This means the geographical north pole is usually not located at 0° E / 90° N but somewhere else. The rotation of the pole happens so that the considered region (for example Europe) is located on the equator around the 0 meridian. Hence the rotated base vectors of the model data for longitude and latitude have usaully the following form:
[18]:
rlon
[18]:
<xarray.DataArray 'rlon' (rlon: 105)> array([-3.08875 , -3.083462, -3.078173, -3.072885, -3.067596, -3.062308, -3.057019, -3.051731, -3.046442, -3.041154, -3.035865, -3.030577, -3.025288, -3.02 , -3.014712, -3.009423, -3.004135, -2.998846, -2.993558, -2.988269, -2.982981, -2.977692, -2.972404, -2.967115, -2.961827, -2.956538, -2.95125 , -2.945962, -2.940673, -2.935385, -2.930096, -2.924808, -2.919519, -2.914231, -2.908942, -2.903654, -2.898365, -2.893077, -2.887788, -2.8825 , -2.877212, -2.871923, -2.866635, -2.861346, -2.856058, -2.850769, -2.845481, -2.840192, -2.834904, -2.829615, -2.824327, -2.819038, -2.81375 , -2.808462, -2.803173, -2.797885, -2.792596, -2.787308, -2.782019, -2.776731, -2.771442, -2.766154, -2.760865, -2.755577, -2.750288, -2.745 , -2.739712, -2.734423, -2.729135, -2.723846, -2.718558, -2.713269, -2.707981, -2.702692, -2.697404, -2.692115, -2.686827, -2.681538, -2.67625 , -2.670962, -2.665673, -2.660385, -2.655096, -2.649808, -2.644519, -2.639231, -2.633942, -2.628654, -2.623365, -2.618077, -2.612788, -2.6075 , -2.602212, -2.596923, -2.591635, -2.586346, -2.581058, -2.575769, -2.570481, -2.565192, -2.559904, -2.554615, -2.549327, -2.544038, -2.53875 ]) Coordinates: * rlon (rlon) float64 -3.089 -3.083 -3.078 -3.073 ... -2.549 -2.544 -2.539 height float64 2.0 Attributes: standard_name: grid_longitude long_name: longitude in rotated pole grid units: degrees axis: X
[19]:
rlat
[19]:
<xarray.DataArray 'rlat' (rlat: 110)> array([0.67375 , 0.679048, 0.684346, 0.689644, 0.694943, 0.700241, 0.705539, 0.710837, 0.716135, 0.721433, 0.726732, 0.73203 , 0.737328, 0.742626, 0.747924, 0.753222, 0.758521, 0.763819, 0.769117, 0.774415, 0.779713, 0.785011, 0.79031 , 0.795608, 0.800906, 0.806204, 0.811502, 0.8168 , 0.822099, 0.827397, 0.832695, 0.837993, 0.843291, 0.848589, 0.853888, 0.859186, 0.864484, 0.869782, 0.87508 , 0.880378, 0.885677, 0.890975, 0.896273, 0.901571, 0.906869, 0.912167, 0.917466, 0.922764, 0.928062, 0.93336 , 0.938658, 0.943956, 0.949255, 0.954553, 0.959851, 0.965149, 0.970447, 0.975745, 0.981044, 0.986342, 0.99164 , 0.996938, 1.002236, 1.007534, 1.012833, 1.018131, 1.023429, 1.028727, 1.034025, 1.039323, 1.044622, 1.04992 , 1.055218, 1.060516, 1.065814, 1.071112, 1.076411, 1.081709, 1.087007, 1.092305, 1.097603, 1.102901, 1.1082 , 1.113498, 1.118796, 1.124094, 1.129392, 1.13469 , 1.139989, 1.145287, 1.150585, 1.155883, 1.161181, 1.166479, 1.171778, 1.177076, 1.182374, 1.187672, 1.19297 , 1.198268, 1.203567, 1.208865, 1.214163, 1.219461, 1.224759, 1.230057, 1.235356, 1.240654, 1.245952, 1.25125 ]) Coordinates: * rlat (rlat) float64 0.6738 0.679 0.6843 0.6896 ... 1.241 1.246 1.251 height float64 2.0 Attributes: standard_name: grid_latitude long_name: latitude in rotated pole grid units: degrees axis: Y
Not the suffix r
indicating that the base coordinates are rotated. The EUR-11
domain for example has the rotated pole at 39.25° N and 162.0° W. Plotting the resulting projection give the following:
[52]:
from cartopy import crs as ccrs
from matplotlib import pyplot as plt
rotated_pole = ccrs.RotatedPole(pole_latitude=39.25,
pole_longitude=-162)
fig, ax = plt.subplots(subplot_kw=dict(projection=rotated_pole), figsize=(10, 10))
ax.stock_img()
ax.coastlines()
_ = ax.gridlines()
How can I get access the data coordinates in projection of the shapefile
The output data of the plugin catains two 2D arrays X
and Y
representing the coordinates of the data points within the projection of the selected shapfile. For example, coordinates for data that have been cut using a shape file with a EPSG:25833
might look like this:
[53]:
dataset[["X", "Y"]]
[53]:
<xarray.Dataset> Dimensions: (rlat: 110, rlon: 105) Coordinates: X (rlat, rlon) float64 3.644e+05 3.65e+05 ... 4.225e+05 4.231e+05 Y (rlat, rlon) float64 5.687e+06 5.687e+06 ... 5.754e+06 5.754e+06 * rlat (rlat) float64 0.6738 0.679 0.6843 0.6896 ... 1.241 1.246 1.251 * rlon (rlon) float64 -3.089 -3.083 -3.078 -3.073 ... -2.549 -2.544 -2.539 height float64 2.0 Data variables: *empty* Attributes: (12/42) CDI: Climate Data Interface version 1.9.8 (htt... history: Mon Mar 29 18:31:53 2021: cdo -O -s -f nc... Conventions: CF-1.6 tracking_id: 5bbfc8a6-d228-4b84-9ed8-a9f1ecb6bfa1 creation_date: 2021-03-29T18:31:53Z CDO: Climate Data Operators version 1.9.8 (htt... ... ... ensemble_member: mpi-m-mpi-esm-lr-gerics-remo2015_r1i1p1 experiment: historical output_freqeuncy: day shape_file: /work/ch1187/regiklim-work/b381427/LK_EE_... swift_group: ch1187 path_prefix: ProcessedModelData-nukleus-ger-3km-pr_tas
I need 3D data as ouput data, how can I get 3D output data?
Assuming the input model data is 3 dimensional (time
x latitdue
x longitude
) how can I get data with the same dimensions but only for my region of interest? The strategy is to simply defining a pre processing function that simply returns the data it was given:
[54]:
def pre_proc(dataset):
"""This function doesn't do anything, it simply returns the dataset it was given."""
return dataset
How can I get projection information of the climate data?
The information on the rotated pole is given in the attributes of the output data. For example, if you have saved the data in netcdf
format you can access the the projection information via the projection
attributed:
[58]:
dataset.attrs["projection"]
[58]:
'+proj=ob_tran +ellps=WGS84 +a=6378137.0 +o_proj=latlon +o_lon_p=0.0 +o_lat_p=39.25 +lon_0=18.0 +to_meter=111319.4907932736 +no_defs +type=crs'