Return to LAS FAQ

Scripts and templates


Can I modify the scripts Ferret uses to generate output?


Here an alternate visualization script was used that plots data sampling locations over a data product generated by objective analysis.

[Output Graphic]


LAS data providers can associate custom scripts with a dataset or variable by adding properties to the XML configuration file. Two script related properties include the init_script property and the script_prefix property.


Script related properties are specified in the .xml files in the same manner as other properties:


The initialization script, define_aco2.jnl in this case, should reside in the server/jnls directory and can be used to create virtual variables from other variables in the dataset.

The script prefix, "co2_survey_" above, is prepended to the "std_" template or journal files when LAS requests output. In our case, a request for a plot will use the template file co2_survey_std_gif.tmpl to generate a sequence of commands to Ferret. A request for data would call co2_survey_std_list.jnl.

The server code (server/ uses the following algorithm to decide which script to use:

# 1) look for template file with script prefix
# 2) look for template file without script prefix
# 3) look for journal file with script prefix
# 4) look for journal file without script prefix

For plots not using templates, <view>ref is tacked on to maintain backwards compatibility.

So, if you request an XY plot of a variable with a script_prefix named "foo_", the server would look for:

  1. foo_std_gif.tmpl
  2. std_gif.tmpl
  3. foo_std_gif_xyref.jnl
  4. std_gif_xyref.jnl

Jonathan Callahan:
Last modified: September 19, 2000