diff --git a/docs/recipes/plot_1_recipe.html b/docs/recipes/plot_1_recipe.html index f5fe3629fb..13c1915b30 100644 --- a/docs/recipes/plot_1_recipe.html +++ b/docs/recipes/plot_1_recipe.html @@ -143,8 +143,8 @@

Related Topics

  1. Read the field constructs:

-
f = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc")
-print(f)
+
f = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc")
+print(f)
 
[<CF Field: ncvar%stn(long_name=time(1452), long_name=latitude(360), long_name=longitude(720))>,
@@ -154,8 +154,8 @@ 

Related Topics

  1. Select near surface temperature by index and look at its contents:

-
temp = f[1]
-print(temp)
+
temp = f[1]
+print(temp)
 
Field: long_name=near-surface temperature (ncvar%tmp)
@@ -169,14 +169,14 @@ 

Related Topics

  1. Select latitude and longitude dimensions by identities, with two different techniques:

-
lon = temp.coordinate("long_name=longitude")
-lat = temp.coordinate("Y")
+
lon = temp.coordinate("long_name=longitude")
+lat = temp.coordinate("Y")
 
  1. Print the description of near surface temperature using the dump method to show properties of all constructs:

-
temp.dump()
+
 
-----------------------------------------------------
@@ -224,9 +224,9 @@ 

Related Topics

  1. Latitude and longitude dimension coordinate cell bounds are absent, which are created and set:

-
a = lat.create_bounds()
-lat.set_bounds(a)
-lat.dump()
+
 
Dimension coordinate: long_name=latitude
@@ -237,9 +237,9 @@ 

Related Topics

Bounds:Data(360, 2) = [[-90.0, ..., 90.0]] degrees_north
-
b = lon.create_bounds()
-lon.set_bounds(b)
-lon.dump()
+
 
Dimension coordinate: long_name=longitude
@@ -250,7 +250,7 @@ 

Related Topics

Bounds:Data(720, 2) = [[-180.0, ..., 180.0]] degrees_east
-
print(b.array)
+
print(b.array)
 
[[-180.  -179.5]
@@ -265,10 +265,10 @@ 

Related Topics

  1. Time dimension coordinate cell bounds are similarly created and set for cell sizes of one calendar month:

-
time = temp.coordinate("long_name=time")
-c = time.create_bounds(cellsize=cf.M())
-time.set_bounds(c)
-time.dump()
+
time = temp.coordinate("long_name=time")
+c = time.create_bounds(cellsize=cf.M())
+time.set_bounds(c)
+time.dump()
 
Dimension coordinate: long_name=time
@@ -284,16 +284,16 @@ 

Related Topics

  1. Calculate and plot the area weighted mean surface temperature for each time:

-
global_avg = temp.collapse("area: mean", weights=True)
-cfp.lineplot(global_avg, color="red", title="Global mean surface temperature")
+
global_avg = temp.collapse("area: mean", weights=True)
+cfp.lineplot(global_avg, color="red", title="Global mean surface temperature")
 
Global mean surface temperature
  1. Calculate and plot the annual global mean surface temperature:

-
annual_global_avg = global_avg.collapse("T: mean", group=cf.Y())
-cfp.lineplot(
-    annual_global_avg,
+
annual_global_avg = global_avg.collapse("T: mean", group=cf.Y())
+cfp.lineplot(
+    annual_global_avg,
     color="red",
     title="Annual global mean surface temperature",
 )
diff --git a/docs/recipes/plot_2_recipe.html b/docs/recipes/plot_2_recipe.html
index cc50db0a5e..005b8f5246 100644
--- a/docs/recipes/plot_2_recipe.html
+++ b/docs/recipes/plot_2_recipe.html
@@ -143,8 +143,8 @@ 

Related Topics

  1. Read the field constructs:

-
f = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc")
-print(f)
+
f = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc")
+print(f)
 
[<CF Field: ncvar%stn(long_name=time(1452), long_name=latitude(360), long_name=longitude(720))>,
@@ -154,8 +154,8 @@ 

Related Topics

  1. Select near surface temperature by index and look at its contents:

-
temp = f[1]
-print(temp)
+
temp = f[1]
+print(temp)
 
Field: long_name=near-surface temperature (ncvar%tmp)
@@ -169,14 +169,14 @@ 

Related Topics

  1. Select latitude and longitude dimensions by identities, with two different techniques:

-
lon = temp.coordinate("long_name=longitude")
-lat = temp.coordinate("Y")
+
lon = temp.coordinate("long_name=longitude")
+lat = temp.coordinate("Y")
 
  1. Print the description of near surface temperature to show properties of all constructs:

-
temp.dump()
+
 
-----------------------------------------------------
@@ -224,9 +224,9 @@ 

Related Topics

  1. Latitude and longitude dimension coordinate cell bounds are absent, which are created and set:

-
a = lat.create_bounds()
-lat.set_bounds(a)
-lat.dump()
+
 
Dimension coordinate: long_name=latitude
@@ -237,9 +237,9 @@ 

Related Topics

Bounds:Data(360, 2) = [[-90.0, ..., 90.0]] degrees_north
-
b = lon.create_bounds()
-lon.set_bounds(b)
-lon.dump()
+
 
Dimension coordinate: long_name=longitude
@@ -250,7 +250,7 @@ 

Related Topics

Bounds:Data(720, 2) = [[-180.0, ..., 180.0]] degrees_east
-
print(b.array)
+
print(b.array)
 
[[-180.  -179.5]
@@ -265,10 +265,10 @@ 

Related Topics

  1. Time dimension coordinate cell bounds are similarly created and set for cell sizes of one calendar month:

-
time = temp.coordinate("long_name=time")
-c = time.create_bounds(cellsize=cf.M())
-time.set_bounds(c)
-time.dump()
+
time = temp.coordinate("long_name=time")
+c = time.create_bounds(cellsize=cf.M())
+time.set_bounds(c)
+time.dump()
 
Dimension coordinate: long_name=time
@@ -284,22 +284,22 @@ 

Related Topics

  1. Calculate the area weighted mean surface temperature for each time using the collapse method:

-
global_avg = temp.collapse("area: mean", weights=True)
+
global_avg = temp.collapse("area: mean", weights=True)
 
  1. Calculate the annual global mean surface temperature:

-
annual_global_avg = global_avg.collapse("T: mean", group=cf.Y())
+
 
  1. The temperature values are averaged for the climatological period of 1961-1990 by defining a subspace within these years using cf.wi query instance over subspace and doing a statistical collapse with the collapse method:

-
annual_global_avg_61_90 = annual_global_avg.subspace(
-    T=cf.year(cf.wi(1961, 1990))
+
 
Field: long_name=near-surface temperature (ncvar%tmp)
@@ -311,8 +311,8 @@ 

Related Topics

: long_name=longitude(1) = [0.0] degrees_east
-
temp_clim = annual_global_avg_61_90.collapse("T: mean")
-print(temp_clim)
+
 
Field: long_name=near-surface temperature (ncvar%tmp)
@@ -327,9 +327,9 @@ 

Related Topics

  1. The temperature anomaly is then calculated by subtracting these climatological temperature values from the annual global average temperatures and plotted:

-
temp_anomaly = annual_global_avg - temp_clim
-cfp.lineplot(
-    temp_anomaly,
+
temp_anomaly = annual_global_avg - temp_clim
+cfp.lineplot(
+    temp_anomaly,
     color="red",
     title="Global Average Temperature Anomaly (1901-2021)",
     ylabel="1961-1990 climatology difference ",
diff --git a/docs/recipes/plot_3_recipe.html b/docs/recipes/plot_3_recipe.html
index 36029127ed..e9b4be4dd8 100644
--- a/docs/recipes/plot_3_recipe.html
+++ b/docs/recipes/plot_3_recipe.html
@@ -143,8 +143,8 @@ 

Related Topics

  1. Read the field constructs:

-
f = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc")
-print(f)
+
f = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc")
+print(f)
 
[<CF Field: ncvar%stn(long_name=time(1452), long_name=latitude(360), long_name=longitude(720))>,
@@ -154,8 +154,8 @@ 

Related Topics

  1. Select near surface temperature by index and look at its contents:

-
temp = f[1]
-print(temp)
+
temp = f[1]
+print(temp)
 
Field: long_name=near-surface temperature (ncvar%tmp)
@@ -169,13 +169,13 @@ 

Related Topics

  1. Average the monthly mean surface temperature values by the time axis using the collapse method:

-
global_avg = temp.collapse("mean", axes="long_name=time")
+
global_avg = temp.collapse("mean", axes="long_name=time")
 
  1. Plot the global mean surface temperatures:

-
cfp.con(global_avg, lines=False, title="Global mean surface temperature")
+
cfp.con(global_avg, lines=False, title="Global mean surface temperature")
 
plot 3 recipe

Total running time of the script: ( 0 minutes 6.806 seconds)

diff --git a/docs/recipes/plot_4_recipe.html b/docs/recipes/plot_4_recipe.html index dbdf4b376e..bc8a355f63 100644 --- a/docs/recipes/plot_4_recipe.html +++ b/docs/recipes/plot_4_recipe.html @@ -141,18 +141,18 @@

Related Topics

  1. Read the field constructs:

-
obs = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc", chunks=None)
-print(obs)
+
obs = cf.read("~/recipes/cru_ts4.06.1901.2021.tmp.dat.nc", chunks=None)
+print(obs)
 
[<CF Field: ncvar%stn(long_name=time(1452), long_name=latitude(360), long_name=longitude(720))>,
  <CF Field: long_name=near-surface temperature(long_name=time(1452), long_name=latitude(360), long_name=longitude(720)) degrees Celsius>]
 
-
model = cf.read(
+
model = cf.read(
     "~/recipes/tas_Amon_HadGEM3-GC3-1_hist-1p0_r3i1p1f2_gn_185001-201412.nc"
 )
-print(model)
+print(model)
 
[<CF Field: air_temperature(time(1980), latitude(144), longitude(192)) K>]
@@ -161,8 +161,8 @@ 

Related Topics

  1. Select observation and model temperature fields by identity and index respectively, and look at their contents:

-
obs_temp = obs.select_field("long_name=near-surface temperature")
-print(obs_temp)
+
obs_temp = obs.select_field("long_name=near-surface temperature")
+print(obs_temp)
 
Field: long_name=near-surface temperature (ncvar%tmp)
@@ -173,8 +173,8 @@ 

Related Topics

: long_name=longitude(720) = [-179.75, ..., 179.75] degrees_east
-
model_temp = model[0]
-print(model_temp)
+
 
Field: air_temperature (ncvar%tas)
@@ -191,8 +191,8 @@ 

Related Topics

  1. Regrid observational data to that of the model data and create a new low resolution observational data using bilinear interpolation:

-
obs_temp_regrid = obs_temp.regrids(model_temp, method="linear")
-print(obs_temp_regrid)
+
 
Field: long_name=near-surface temperature (ncvar%tmp)
diff --git a/docs/recipes/plot_5_recipe.html b/docs/recipes/plot_5_recipe.html
index 7fe1b1bc68..c33630b4ba 100644
--- a/docs/recipes/plot_5_recipe.html
+++ b/docs/recipes/plot_5_recipe.html
@@ -143,22 +143,22 @@ 

Related Topics

  1. Read the field constructs:

-
f1 = cf.read("~/recipes/northward.nc")
-print(f1)
+
f1 = cf.read("~/recipes/northward.nc")
+print(f1)
 
[<CF Field: northward_wind(time(1980), latitude(144), longitude(192)) m s-1>]
 
-
f2 = cf.read("~/recipes/eastward.nc")
-print(f2)
+
f2 = cf.read("~/recipes/eastward.nc")
+print(f2)
 
[<CF Field: eastward_wind(time(1980), latitude(144), longitude(192)) m s-1>]
 
-
f3 = cf.read("~/recipes/monthly_precipitation.nc")
-print(f3)
+
f3 = cf.read("~/recipes/monthly_precipitation.nc")
+print(f3)
 
[<CF Field: long_name=precipitation(long_name=time(1452), latitude(144), longitude(192)) mm/month>]
@@ -167,8 +167,8 @@ 

Related Topics

  1. Select wind vectors and precipitation data by index and look at their contents:

-
v = f1[0]
-print(v)
+
v = f1[0]
+print(v)
 
Field: northward_wind (ncvar%vas)
@@ -181,8 +181,8 @@ 

Related Topics

: height(1) = [10.0] m
-
u = f2[0]
-print(u)
+
u = f2[0]
+print(u)
 
Field: eastward_wind (ncvar%uas)
@@ -195,8 +195,8 @@ 

Related Topics

: height(1) = [10.0] m
-
pre = f3[0]
-print(pre)
+
pre = f3[0]
+print(pre)
 
Field: long_name=precipitation (ncvar%pre)
@@ -210,23 +210,23 @@ 

Related Topics

  1. Plot the wind vectors on top of precipitation data for June 1995 by creating a subspace with a date-time object and using cfplot.con. Here cfplot.gopen is used to define the parts of the plot area, which is closed by cfplot.gclose; cfplot.cscale is used to choose one of the colour maps amongst many available; cfplot.levs is used to set the contour levels for precipitation data; and cfplot.vect is used to plot the wind vectors for June 1995:

-
june_95 = cf.year(1995) & cf.month(6)
-cfp.gopen()
-cfp.cscale("precip4_11lev")
-cfp.levs(step=100)
-cfp.con(
-    pre.subspace(T=june_95),
+
june_95 = cf.year(1995) & cf.month(6)
+cfp.gopen()
+cfp.cscale("precip4_11lev")
+cfp.levs(step=100)
+cfp.con(
+    pre.subspace(T=june_95),
     lines=False,
     title="June 1995 monthly global precipitation",
 )
-cfp.vect(
-    u=u.subspace(T=june_95),
-    v=v.subspace(T=june_95),
+cfp.vect(
+    u=u.subspace(T=june_95),
+    v=v.subspace(T=june_95),
     key_length=10,
     scale=35,
     stride=5,
 )
-cfp.gclose()
+cfp.gclose()
 
plot 5 recipe

Total running time of the script: ( 0 minutes 6.238 seconds)

diff --git a/docs/recipes/plot_6_recipe.html b/docs/recipes/plot_6_recipe.html index dc53d64fa2..eac5645f61 100644 --- a/docs/recipes/plot_6_recipe.html +++ b/docs/recipes/plot_6_recipe.html @@ -144,8 +144,8 @@

Related Topics

  1. Read the field constructs using read function:

-
f = cf.read("~/recipes/au952a.pd20510414.pp")
-print(f)
+
f = cf.read("~/recipes/au952a.pd20510414.pp")
+print(f)
 
[<CF Field: id%UM_m01s03i463_vn1006(time(8), grid_latitude(432), grid_longitude(444))>]
@@ -154,8 +154,8 @@ 

Related Topics

  1. Select the field by index and print its description to show properties of all constructs:

-
gust = f[0]
-gust.dump()
+
gust = f[0]
+gust.dump()
 
-----------------------------------------------------------
@@ -242,7 +242,7 @@ 

Related Topics

  1. Access the time coordinate of the gust field and retrieve the datetime values of the time coordinate:

-
print(gust.coordinate("time").datetime_array)
+
print(gust.coordinate("time").datetime_array)
 
[cftime.Datetime360Day(2051, 4, 14, 1, 30, 0, 0, has_year_zero=True)
@@ -258,8 +258,8 @@ 

Related Topics

  1. Create a new instance of the cf.dt class with a specified year, month, day, hour, minute, second and microsecond. Then store the result in the variable test:

-
test = cf.dt(2051, 4, 14, 1, 30, 0, 0)
-print(test)
+
test = cf.dt(2051, 4, 14, 1, 30, 0, 0)
+print(test)
 
2051-04-14 01:30:00
@@ -268,35 +268,35 @@ 

Related Topics

  1. Plot the wind gust by creating a subspace for the specified variable test using cfplot.con. Here cfplot.mapset is used to set the mapping parameters like setting the map resolution to 50m:

-
cfp.mapset(resolution="50m")
-cfp.con(gust.subspace(T=test), lines=False)
+
cfp.mapset(resolution="50m")
+cfp.con(gust.subspace(T=test), lines=False)
 
plot 6 recipe
  1. To see the rotated pole data on the native grid, the above steps are repeated and projection is set to rotated in cfplot.mapset:

-
cfp.mapset(resolution="50m", proj="rotated")
-cfp.con(gust.subspace(T=test), lines=False)
+
cfp.mapset(resolution="50m", proj="rotated")
+cfp.con(gust.subspace(T=test), lines=False)
 
plot 6 recipe
  1. Create dimension coordinates for the destination grid with the latitude and longitude values for Europe. np.linspace generates evenly spaced values between the specified latitude and longitude range. Bounds of the target longitude and target latitude are created and spherical regridding is then performed on the gust variable by passing the target latitude and target longitude as arguments. The method also takes an argument 'linear' which specifies the type of regridding method to use. The description of the regridded_data is finally printed to show properties of all its constructs:

-
target_latitude = cf.DimensionCoordinate(
-    data=cf.Data(np.linspace(34, 72, num=10), "degrees_north")
+
 
-----------------------------------------------------------
@@ -358,8 +358,8 @@ 

Related Topics

  1. Step 6 is similarly repeated for the regridded_data to plot the wind gust on a regular latitude-longitude domain:

-
cfp.mapset(resolution="50m")
-cfp.con(regridded_data.subspace(T=test), lines=False)
+
cfp.mapset(resolution="50m")
+cfp.con(regridded_data.subspace(T=test), lines=False)
 
plot 6 recipe

Total running time of the script: ( 0 minutes 30.084 seconds)