Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You have seen already how to visualise your outputs either on the display or saving it to a file. Most processing you will do with Metview will lead to an a visualisation you might want to save to either publish it on web pages or in reports or simply to keep records. This session will give you more information on how you can save and customise your visualisations. 

...

Info
titleBe careful

The KML output is till still experimental and we look for feedback on it. KML can only be generated if the Cylindrical projections is selected!

  

Metadata

When a large amount number of plots is are generated it is often hard to find later plots with specific contents. What can help is to store additional information with the plots to describe what the content is. This These descriptions about the content are called Metadata. Magics/Metview support the saving of such metadata when the format allows this. Especially in text/XML based formats, such as Postscript and SVG, you can use simple UNIX tools like grep to search the files for specific keywords.

...

Whenever you have a plot window open, you are able to export the plot into other file formats. You can either select the export button in the menu (looks like a floppy disk with a pen),

  , or by selecting select File > Export  or by using use the Ctrl+s keyboard shortcut.

...

You will be presented with a dialogue (shown below) similar to what is used by other programs to choose a location and filename for the saved output.You can select which pages you want to save (if you have a serious series of them), which format and if you want to edit any format specific options.

...

If you select the "spanner" icon , you are offered an editor to choose format specific options. The example below shows the options for the KML format.

...

  1. From an open display window, try to save your plot as a PDF.
  2. Now try to save your plot as a an SVG with and without and with fixed dimensions.
    1. Open both files in Firefox and see how the plots behave when you resize the browser window.
    2. Open one of the SVGs in inkscape and edit the images (for example add some text) and save it as a PDF.

...

You will have already seen some examples of how to save outputs in Macro in previous exercises. The following code example shows how to set multiple output formats at the same time and setting also set various parameters for the different output formats. Note that in most cases the default values are sufficient. A list of all options can found in the Magics documentation for each format at: PostScriptSVG, PNG and KML.

...

Depending on how you run your Macros you might want to specify various output formats. For example, you might sometimes open your output in the display window, while you might like to save it to a PNG file when you run your Macro in batch. The way to code run mode dependent outcomes is by using the function runmode(). It returns a string with the run mode:

...

So it is enough to check this string and to code accordingly, either using if/else conditions or the case/of condition test. To introduce the new functionality, replace the existing unconditional call to setoutput() by the following lines of code :

...

Now, depending on how you call the macro, your output will be directed to different media. Choose different options from the icon’s right-click menu to see what happens. Note that you can also simulate these actions from within the Macro editor ( Program | Run Options). The ‘prepare’ run mode is the default one when you run your macro from the Macro editor. The ‘batch’ run mode will be explained in a later paragraph.

...

  1. Run the code in the Macro Editor and see what happens it if your execute the macro.
  2. Go on the command line and change to the directory where the macro is located. Execute the macro from the command line outside Metview.

...

Some graphical formats, such as PostScript and PDF, allow multiple pages within the documents. Other formats, such as PNG, which will contain a single page at the time and therefore contain a number in their filename to indicate which page they contain. You can trigger a new page in Metview Macro with the function

...

If you have extra time

If you have time, you might want to try out opening your SVG file from the first exercise above in inkscape and alter it and save it to a PNG.

...