Info
Alle Inhalte des Nutzerportal sind nur auf Englisch verfügbar.

source_code

Contains the source code of the 'new' DKRZ NCL examples page.
DKRZ NCL add latitude/longitude annotation to Robinson projection example
The example script creates a contour plot using Robinson projection and adds the latitude and longitude labels to the plot.
DKRZ NCL add text to plot example
The example script shows how to add text to a plot. It also demonstrates the use of subscript and superscript and how to create German 'Umlaute'.
DKRZ NCL attach plot to another plot along the y-axis example
To a slice plot a data averages xy-plot will be attached along the right y-axis.
DKRZ NCL counts per country map plot example
The script reads an ASCII file containing the counts per country of something. It colors only the listed countries with the corresponding counts color.
DKRZ NCL EUMETSAT IASI regrid to gaussian T63 grid example
The example script regrid the unstructured EUMETSAT IASI data to a gaussian T63 grid using ESMF.
DKRZ NCL EUMETSAT IASI swath data example
The example script creates a plot of the EUMETSAT IASI swath data using the NCL markers.
DKRZ NCL FESOM data example
The script generates a sub-region (Marian Trench) plot of the FESOM variable topo (topography).
DKRZ NCL font and function code example
The script gives an overview how to change font settings using gsn_text_ndc.
DKRZ NCL ICON add_polygon triangles example
The script creates a 1024x1024 pixel PNG plot of the ICON model data on a global map. The traingles are drawn using the add_polygon function of NCL.
DKRZ NCL ICON Mollweide projection + add latitude annotation example
The example uses Mollweide projection and a function to add latitude labels to the plot.
DKRZ NCL JPEG images as background map overlayed by clouds example
This example demonstrates how to read in a JPEG file which is used as background map. The ICON cloud data are drawn on top of the map using different color transparencies.
DKRZ NCL legend settings example
The script creates 4 plot with different legend settings. 1. using NCL legend defaults, 2. define box size and move it into the plot, 3. change font settings and 4. reverse legend line order and fill legend box with color.
DKRZ NCL overlay small map on map plot example
This example shows how to draw a small global map on top of a regional map for a better location of the sub-region.
DKRZ NCL plot a sub-region of curvilinear data example
If the input data is on a curvilinear grid it is not as simple as described before to select a sub-region because the coordinate arrays lat and lon are not 1-dimensional arrays. In this example script it is shown how to retrieve the indices of a given sub-region and to define a subset of the data and its subsetted coordinate arrays.
DKRZ NCL REMO plot rotated data example
The REMO model data are computed on a rotated grid. The script shows how to plot these data on the origin grid.
DKRZ NCL scatter plot with legend example
The script demonstrates how to create a scatter plot with different marker types and colors and a legend in the lower right corner of the plot.
DKRZ NCL tickmarks example
The script gives an example how to use the resources for the map tickmarks and axis labels.
DKRZ NCL two different resolutions on a globe example
This example shows how to plot two different local regions on a map with Orthographic projection.
DKRZ NCL unrotate CORDEX EUR-11 rotated data to its origin example
This script shows how to do the calculation to unrotate rotated data (here CORDEX EUR-11) to its origin grid.
DKRZ NCL vectors on a curvilinear grid example
The example script creates a map with the curvilinear grid of the data and draws the vectors on the map.
DKRZ NCL xy-plot example
The script creates a simple xy-plot from 1D data and write the plot to a PNG file.
DKRZ NCL xy-plot with multiple lines and y-axis
The script shows how to plot two different variables in one plot.
DKRZ NCL regional map overlayed on global map Satellite projection example
The example shows the complexity of overlaying different maps and contour plots on a base map. To point the Satellite view up a grey shadow is attached to the regional contour plot.
NCL/ImageMagick example to tilt 3 contour plots into one new image
This example shows how to create 3 contour plots, one seperated title plot and another seperated labelbar plot with an NCL script. With ImageMagicks 'convert' we'll tilt the 3 contour plots and compose them with the title and labelbar plots into one new image. This all will be done with one KSH script.
NCL/ImageMagick example to tilt a contour plot
The next example demonstrate how to tilt a contour plot created with NCL. Therfore ImageMagick's 'convert' is used to crop the white space around the contour plot and furthermore to tilt and last but not least to compose the tilted plot image with the title and labelbar plots into one new image. All steps will be done by a Korn-Shell script.
DKRZ NCL bar chart with some statistics
NCL Example script to draw bar chart, running mean and trend
DKRZ NCL spiral example
The example script shows how to create an animation of multi-year monthly mean temperature change data of the northern hemisphere similar to Ed Hawkins's spiral animation (https://www.climate-lab-book.ac.uk/spirals/).
DKRZ NCL example attached plots among others
A long time series data is splitted into 3 parts and plotted among each other using gsn_attach_plots function.
NCL script EUMETSAT IASI plot with marker
The NCL script reads and plots the unstructured data with colored markers.
NCL script to regrid EUMETSAT IASI data to T63 gaussian grid
NCL script to regrid EUMETSAT IASI data to T63 gaussian grid.
DKRZ NCL animation example
NCL script which creates the plots (frames) for an animation.
DKRZ NCL bar chart example
NCL script to create bar chart plot.
DKRZ NCL bar chart plot with text example
NCL script which reads an CSV data file and plot the data using bar chart resources. The labels of the bars are positioned next to the bars.
DKRZ NCL contour curvilinear example
NCL script to create a contour plot of a curvilinear data set (MPI-ESM).
DKRZ NCL contour filled example for rectilinear grid
NCL script to create a contour filled plot for data on a rectilinear grid.
DKRZ NCL contour lines plot example (rectilinear grid)
NCL contour lines plot example for data on a rectilinear grid.
DKRZ NCL contour unstructured example
NCL script to create a contour plot of unstructured data.
DKRZ NCL ESMF regridding curvilinear to rectilinear example
NCL script that uses the ESMF library to regrid curvilinear gridded data to rectilinear grid.
DKRZ NCL FESOM grid example
NCL script that plots the FESOM grid cells using polygons.
DKRZ NCL ICON polygon example
NCL script to draw the ICON cells as polygons.
DKRZ NCL map plot example
Simple NCL script creating a map using Orthographic projection.
DKRZ NCL multiple time series example
NCL script to create a plot showing multiple time series in one plot.
DKRZ NCL panel example
NCL script creates a panel plot of 3 rows by 2 columns (6 plots) showing the use of PreDraw, Draw and PostDraw setting.
DKRZ NCL shapefile German federal states example
NCL script to read and plot the shapefile contents of DEU_adm1.shp (German federal states).
DKRZ NCL shapefile mean temperature change German coast example
NCL script to create a plot of averaged dummy data using shapefile containing the German coastal counties.
DKRZ NCL slice plot example
NCL script to create a slice plot.
DKRZ NCL statistic running mean example
NCL script to plot the running mean of a given data set.
DKRZ NCL vector plot colorized by variable example
NCL script to create a vector plot where the vectors are colorized by a variable.
DKRZ NCL vector plot example
NCL script to plot vectors.
DKRZ NCL vector plot on contour plot example
NCL script to overlay a vector plot on a contour plot.
DKRZ NCL Workshop: animations
All animation exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: caption and annotation
All caption and annotation exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: contours
All contour exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: map resolutions, projections and shapefiles
All map resolution, projection and shapefile exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: maps
All map exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: panels
All panel exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: slices and overlays
All slices and overlay exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: vectors
All vector exercises from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL Workshop: xy-plots
All xy-plots from the DKRZ NCL Workshop. Requirement: NCL version 6.2.0 and higher
DKRZ NCL xy-plot multiple lines with two y-axis example
NCL script creating a xy-plot with multiple lines and two y-axis.
DKRZ NCL bar chart plot with some statistics
NCL script which reads an data file and plot the data using bar chart resources. Statistics like running mean and trend are added to the plot.
DKRZ NCL example relative difference plot
This example shows how to compute the relative difference using on one side the difference of the variables and on the other side the absolute value of the difference.
DKRZ NCL color map example - use gsn_define_colormap()
Demonstrate the use gsn_define_colormap() to set a color map for all plots of a frame (file/page). After a frame is advanced when gsnFrame is set to True or frame(wks) is used the color map is fixed for that frame and for the next frame it can be changed. This example is useful if you want to use the same color map for all plots of one frame.
DKRZ NCL color map example - use new resources
Since NCL version 6.1.0 a few new resources to set color maps have been added - cnFillPalette, vcLevelPalette, and stLevelPalette. This example shows how to create a panel plot of two contour plot s which are using two different color maps in the same frame. Notice that the color map is set in the resource list and not with a function call of gsn_define_colormap like in older NCL scripts.
DKRZ NCL color map example - use named colors
The example shows how to use named colors instead of a pre-defined color map. The user has to define an array containg the color names as strings which can be used with the resources cnFillPalette, vcLevelPalette, and stLevelPalette. The following script creates two plots in a panel using the color array (defined by named colors) which is reversed in the lower plot.
DKRZ NCL daily climatology
This example script shows how to compute the daily climatology.
DKRZ NCL using time coordinate variable with units yyyymm
This example shows how to plot data versus time when the time units are yyyymm.
DKRZ NCL tick mark example
Here, we show how to change the x-axis labels (its equivalent for the y-axis labels).
DKRZ NCL ICON (unstructured grid): draw vectors
NCL's vector functions can't be used for data with an underlying unstructured grid. This example shows a workaround which uses the WMAP package to plot arrows at the center longitudes/latitudes.
DKRZ NCL Example masked data by shapefile
This example shows how to use a shapefile to mask your data.
DKRZ NCL add significance points (sig = 1) to contour plot
Here, we want to show where the grid cells of significance are. This example uses dummy data for contouring and significance, so you are able to copy and run the script on your local computer.
DKRZ NCL Spiral of sea ice fraction
This special plot shows the sea ice fraction (yearly mean) for the Arctic reagion as a spiral plot along time based on the plot 'Arctic Death Spiral' by Andy Lee Robinson, 2017. NCL doen't provide this type of plot so we have to build it from scratch.
DKRZ NCL Germany sunshine duration colored by temperature
The next example demonstrate how to create a bar chart plot which shows the sunshine hours per year colored by the average temperature per year for Germany. The data can be downloded from DWD ftp://ftp-cdc.dwd.de/pub/CDC/regional_averages_DE/annual/.
DKRZ NCL example scatter plot with two attached histograms
This example use random data to create a scatter plot with two attached histograms at the top and right side.
DKRZ NCL example use markers to plot data on grid
This example shows how to create a raster filled contour plot which is used to create a second plot using markers instead of raster filled contour. The colors are retrieved from the raster filled contour plot and the size is given by another variable, here quality factor, for each grid cell.
DKRZ PyNGL example Hovmueller plot
This example demonstrates how to create a default black and white Hovmueller plot.
DKRZ NCL example rotated grid: mask data by shapefile content (country borderline)
This example shows how to mask data on a rotated curvilinear grid by a shapefile of Argentina's borderline (download shapefile from www.gadm.org). It uses the function shapefile_mask_data from shapefile_utils.ncl (http://ncl.ucar.edu/Applications/Scripts/shapefile_utils.ncl) to create a mask array which is used with the mask function. A small trick brings shapefile_mask_data to accept the named 2D coordinates of the rotated grid.
DKRZ NCL example rotated grid: mask data by shapefile content (selected provinces)
This example shows how to mask data on a rotated curvilinear grid by a shapefile of selected provinces of Argentina (download shapefile from www.gadm.org). It uses the function shapefile_mask_data from shapefile_utils.ncl (http://ncl.ucar.edu/Applications/Scripts/shapefile_utils.ncl) to create a mask array which is used with the mask function. A small trick brings shapefile_mask_data to accept the named 2D coordinates of the rotated grid.
DKRZ NCL example arrange multiple plots on one page
The example shows how to arrange multiple plots on one page without the use of the gsn_panel function. The plots are placed using the vp-resources.

Artikelaktionen