CoastColour BEAM Workshop Lisbon October 21 2011 Use BEAMs commandline tools from a commandline shell from shell scripts from Python IDL MATLAB using dedicated system Use the BEAM Java API to call BEAM functions ID: 171977
Download Presentation The PPT/PDF document "BEAM in Batch-Mode" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
BEAM in Batch-Mode
CoastColourBEAM WorkshopLisbon, October 21, 2011Slide2
Use BEAM’s command-line tools
from a command-line shellfrom shell scriptsfrom Python, IDL, MATLAB, ... using dedicated systemUse the BEAM Java API to call BEAM functions
from your Java program
from your Phython program
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,
2
Options Slide3
Have a look into the ${BEAM-HOME}/bin directorygpt
–Used to execute various “BEAM operators” and chains of operators.pconvert – Used to convert product files into other data and images formats (will become a gpt opertaor)binning meris-smac – Envisat MERIS smile correction
meris
-cloud – Envisat MERIS cloud screeningflhmci – Envisat MERIS/AATSR FLH/MCI processorsaatsr-sst – ATSR/AATSR SST processor
mosaic – deprecated, use gpt
Reprojectmapproj – deprecated, use
gpt Mosaic
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,
3
BEAM Command-Line ToolsSlide4
Most important BEAM batch-mode toolOther command-line tools will become BEAM operators in the futureUsage
gpt <op>|<graph-file> [options] [<source-file-1> <source-file-2> ...]Which operators are available?gpt –hNote
that
list of operators may vary depending on the installed BEAM plug-ins
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,
4
BEAM
gptSlide5
Refer to gpt documentation in BEAM VISAT help
Operator index lists only standard operatorsSept. 27, 2011WaterRadiance, Progress Meeting 6,
5
BEAM gpt Operator IndexSlide6
Many of the BEAM gpt operators and command-line tools have a counterpart in the VISAT tools menu
You can save a parameter file from an operator’s GUI in VISAT and use it with BEAM gpt on the command-lineSept. 27, 2011
WaterRadiance, Progress Meeting 6,
6BEAM gpt
ParameterisationSlide7
input-path='~/
eodata/MER_RR__1P.N1'
gpt.sh
Reproject -Pcrs
=AUTO:42001 -f NetCDF
$input-path
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,
7
Calling BEAM
gpt
from Shell ScriptsSlide8
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,8Calling BEAM gpt from Python
import
subprocess
gpt
= '~/software/beam-4.9/bin/gpt.sh'
operator = '
Reproject
'
parameters = '-
Pcrs
=AUTO:42001 -f
NetCDF
'
input_path
= '~/
eodata
/MER_RR__1P.N1'
process =
subprocess.Popen
(
gpt
+ ' ' + operator \
+ ' ' + parameters + ' '+
input_path
,\
shell=True, \
bufsize
=1 ,\
stdout
=
subprocess.PIPE
, \
stderr
=
subprocess.STDOUT
)
trace = open('
gpt.stdout
', 'w')
for line in
process.stdout
:
trace.write
(line)
trace.flush
()
trace.close
()
process.stdout.close
()
code =
process.wait
()Slide9
Advantages: no intermediate files written, no I/O overhead
reusability of processing chainssimple and comprehensive operator configurationreusability of operator configurations Usage examplegpt iop-graph.xml
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,9
Processing chains: Using gpt GraphsSlide10
Single operator = single node:
Sept. 27, 2011WaterRadiance, Progress Meeting 6,10
BEAM
gpt Graph XML Example 1Slide11
Two operator chain: (1) IOP, (2) subset
Sept. 27, 2011WaterRadiance, Progress Meeting 6,11
BEAM
gpt Graph XML Example 2Slide12
Using gptgpt
–hIn BEAM VISAT Help Topics: Graph Processing Framework (GPF)Setting up a gpt processing chain:http://www.brockmann-consult.de/beam-wiki/display/BEAM/Creating+a+GPF+Graph
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,12
Getting Help – Command-lineSlide13
BEAM Java API Documentation:http://www.brockmann-consult.de/beam/doc/apidocs/index.html
BEAM home page / downloadsBEAM Java Programming:http://www.brockmann-consult.de/beam-wiki/display/BEAM/Development Sept. 27, 2011WaterRadiance, Progress Meeting 6,
13
Getting Help - JavaSlide14
Call the BEAM API from C-Python
with JPipe:http://jpype.sourceforge.net/Use the BEAM API with Jython:http://www.jython.org/
Sept. 27, 2011
WaterRadiance, Progress Meeting 6,14
Integrating BEAM code in Python