diff --git a/docs/examples/HowdoI/extract_axes_names.jl b/docs/examples/HowdoI/extract_axes_names.jl deleted file mode 100644 index 1d6fc31b0..000000000 --- a/docs/examples/HowdoI/extract_axes_names.jl +++ /dev/null @@ -1,6 +0,0 @@ -# !!! question -# How do I extract the axes names from a Cube? - -using YAXArrays -c = YAXArray(rand(10,10,5)) -caxes(c) \ No newline at end of file diff --git a/docs/examples/HowdoI/howdoi.jl b/docs/examples/HowdoI/howdoi.jl new file mode 100644 index 000000000..74d9487ee --- /dev/null +++ b/docs/examples/HowdoI/howdoi.jl @@ -0,0 +1,39 @@ +# The purpose of this section is to do a collection of small +# convinient pieces of code on how to do simple things. + +# !!! question + +# ## extract the axes names from a Cube? + +using YAXArrays +c = YAXArray(rand(10,10,5)) + +caxes(c) + +# !!! question + +# ## concatenate cubes? + +# It is possible to concatenate several cubes that shared the same dimensions using the [`concatenatecubes`]@ref function. + +# let's create two dummy cubes + +using YAXArrays + +axlist = [ + RangeAxis("time", range(1, 20, length=20)), + RangeAxis("lon", range(1, 10, length=10)), + RangeAxis("lat", range(1, 5, length=15))] + +data1 = rand(20, 10, 15) +ds1 = YAXArray(axlist, data1) + +data2 = rand(20, 10, 15) +ds2 = YAXArray(axlist, data2) + +# Now we can concatenate ```ds1``` and ```ds2``` cubes: + +dsfinal = concatenatecubes([ds1, ds2], + CategoricalAxis("Variables", ["var1", "var2"])) + +dsfinal diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index c79bceb56..906b54433 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -113,6 +113,5 @@ nav: - "Simple maps": "examples/generated/Gallery/simplemaps.md" - "Tutorials": - "Tutorial": "tutorials/tutorial.md" - - "How do I ...": - - "Extract axes names": "examples/generated/HowdoI/extract_axes_names.md" + - "How do I ...": "examples/generated/HowdoI/howdoi.md" - "API" : "api.md" \ No newline at end of file