Skip to content
Snippets Groups Projects
Commit 27923bd2 authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

Bug 1251: Final update before release of version LOFAR20.1

parent 34bb2f36
No related branches found
No related tags found
No related merge requests found
...@@ -184,6 +184,7 @@ CEP/BB/MWImager/test/tmwimager.in_ms1.vds -text ...@@ -184,6 +184,7 @@ CEP/BB/MWImager/test/tmwimager.in_ms1.vds -text
CEP/BB/MWImager/test/tmwimager.in_ms2.vds -text CEP/BB/MWImager/test/tmwimager.in_ms2.vds -text
CEP/BB/MWImager/test/tmwimager.in_vd -text CEP/BB/MWImager/test/tmwimager.in_vd -text
CEP/BB/ParmDB/test/tmakesourcedb.in_2 -text CEP/BB/ParmDB/test/tmakesourcedb.in_2 -text
CEP/BB/Pipeline/library/makevds.bash -text
CEP/BB/SourceDB/bootstrap -text CEP/BB/SourceDB/bootstrap -text
/CMakeLists.txt -text /CMakeLists.txt -text
Firmware/tools/bootstrap -text Firmware/tools/bootstrap -text
......
...@@ -37,12 +37,13 @@ class DPPP(WSRTrecipe): ...@@ -37,12 +37,13 @@ class DPPP(WSRTrecipe):
compress UV-data in frequency and time.""" compress UV-data in frequency and time."""
def __init__(self): def __init__(self):
WSRTrecipe.__init__(self) WSRTrecipe.__init__(self)
self.inputs['parset-file'] = 'dppp.parset' self.inputs['parset-file'] = 'dppp.parset'
self.inputs['cluster-name'] = 'lioff' self.inputs['cluster-name'] = 'lioff'
self.inputs['observation'] = '' self.inputs['observation'] = ''
self.inputs['output-dir'] = None self.inputs['output-dir'] = None
self.inputs['vds-dir'] = None self.inputs['vds-dir'] = None
self.inputs['dryrun'] = False self.inputs['logfile'] = 'dppp.log'
self.inputs['dryrun'] = False
self.helptext = """ self.helptext = """
This function runs the distributed DPPP This function runs the distributed DPPP
Usage: DPPP [OPTION...] Usage: DPPP [OPTION...]
...@@ -57,6 +58,8 @@ class DPPP(WSRTrecipe): ...@@ -57,6 +58,8 @@ class DPPP(WSRTrecipe):
(default: '/data/${USER}/<observation>') (default: '/data/${USER}/<observation>')
--vds-dir directory where the VDS-files reside; --vds-dir directory where the VDS-files reside;
(default: '/users/${USER}/data/<observation>') (default: '/users/${USER}/data/<observation>')
--logfile root name of logfile of each subprocess
(default 'dppp.log')
--dryrun do a dry run --dryrun do a dry run
(default: no) (default: no)
""" """
...@@ -88,7 +91,7 @@ class DPPP(WSRTrecipe): ...@@ -88,7 +91,7 @@ class DPPP(WSRTrecipe):
opts += ['-nomasterhost'] opts += ['-nomasterhost']
opts += ['-dsn', dataset] opts += ['-dsn', dataset]
opts += ['-cdn', clusterdesc] opts += ['-cdn', clusterdesc]
opts += ['-logfile', 'dppp.log'] opts += ['-logfile', self.inputs['logfile']]
opts += ['-dry' if self.inputs['dryrun'] else '-nodry'] opts += ['-dry' if self.inputs['dryrun'] else '-nodry']
# program started by 'startdistproc' # program started by 'startdistproc'
opts += [os.path.join(sysconfig.lofar_root(), opts += [os.path.join(sysconfig.lofar_root(),
...@@ -104,7 +107,7 @@ class DPPP(WSRTrecipe): ...@@ -104,7 +107,7 @@ class DPPP(WSRTrecipe):
self.print_error('startdistproc failed!') self.print_error('startdistproc failed!')
return 1 return 1
# Combine the VDS-files generated by dppp_node.py into one GDS file # Combine the VDS-files generated by dppp_node.py into one GDS-file.
self.print_message('Generating gds file from vds files') self.print_message('Generating gds file from vds files')
opts = [dataset] opts = [dataset]
opts += glob.glob(os.path.join(vds_dir, '*.vds')) opts += glob.glob(os.path.join(vds_dir, '*.vds'))
......
...@@ -54,10 +54,10 @@ class MWImager(WSRTrecipe): ...@@ -54,10 +54,10 @@ class MWImager(WSRTrecipe):
(no default) (no default)
--output-dir directory where images will be stored --output-dir directory where images will be stored
(default: same directory as MS) (default: same directory as MS)
--logfile root name of logfile of each subprocess
(default 'mwimager.log')
--vds-dir directory where the VDS-files reside; --vds-dir directory where the VDS-files reside;
(default: '/users/${USER}/data/<observation>') (default: '/users/${USER}/data/<observation>')
--logfile root name of logfile of each subprocess
(default 'mwimager.log')
--dryrun do a dry run --dryrun do a dry run
(default: no) (default: no)
""" """
......
...@@ -39,22 +39,25 @@ class MakeVDSError(Exception): ...@@ -39,22 +39,25 @@ class MakeVDSError(Exception):
class MakeVDS(WSRTrecipe): class MakeVDS(WSRTrecipe):
"""Generate a VDS files for all MS-files that belong to the specified """
observation. Generate VDS files for all MS-files that belong to the specified
The argument `cluster-name' is used to locate a cluster description file, observation. The argument `cluster-name' is used to locate a cluster
which (among other information) contains a list of mount points to use description file, which (among other information) contains a list of mount
when searching for MS-files. Use the argument `directory' if the MS-files points to use when searching for MS-files. Use the argument `input-dir' if
are located in a directory below the mount points. the MS-files are located in a directory below the mount points. The
After the VDS files have been generated a GDS file (which is like a location where the VDS files will be stored can be specified using the
concatenation of all VDS files) is generated and stored in the current argument `vds-dir'; `/users/${USER}/data/<observation>' by default. When
directory.""" the VDS files have been generated, a GDS file (which is like a
concatenation of all VDS files) is generated in the same directory.
"""
def __init__(self): def __init__(self):
WSRTrecipe.__init__(self) WSRTrecipe.__init__(self)
self.inputs['cluster-name'] = 'lioff' self.inputs['cluster-name'] = 'lioff'
self.inputs['observation'] = '' self.inputs['observation'] = ''
self.inputs['directory'] = None self.inputs['input-dir'] = None
self.inputs['vds-dir'] = None self.inputs['vds-dir'] = None
self.inputs['dryrun'] = False
self.helptext = """ self.helptext = """
This function generates vds files for the MS files that comprise the This function generates vds files for the MS files that comprise the
given observation. given observation.
...@@ -64,12 +67,14 @@ class MakeVDS(WSRTrecipe): ...@@ -64,12 +67,14 @@ class MakeVDS(WSRTrecipe):
(default: 'lioff') (default: 'lioff')
--observation name of the observation (e.g. L2007_03463) --observation name of the observation (e.g. L2007_03463)
(no default) (no default)
--directory directory, relative to the mount point, where --input-dir directory, relative to the mount point, where
the input data is stored (e.g. /lifs001/pipeline); the input data is stored (e.g. /lifs001/pipeline);
if None, use directory <mount-point>/<observation> if None, use directory <mount-point>/<observation>
--vds-dir directory for the output VDS-files; --vds-dir directory for the output VDS-files;
if None, use directory if None, use directory
'/users/${USER}/data/<observation>' '/users/${USER}/data/<observation>'
--dryrun do a dry run
(default: no)
""" """
## Code to generate results ---------------------------------------- ## Code to generate results ----------------------------------------
...@@ -80,7 +85,7 @@ class MakeVDS(WSRTrecipe): ...@@ -80,7 +85,7 @@ class MakeVDS(WSRTrecipe):
clusterdesc = sysconfig.clusterdesc_file(self.inputs['cluster-name']) clusterdesc = sysconfig.clusterdesc_file(self.inputs['cluster-name'])
ms_files = Observation(self.inputs['cluster-name'], ms_files = Observation(self.inputs['cluster-name'],
self.inputs['observation'], self.inputs['observation'],
self.inputs['directory']).ms_files() self.inputs['input-dir']).ms_files()
vds_dir = self.inputs['vds-dir'] \ vds_dir = self.inputs['vds-dir'] \
if self.inputs['vds-dir'] \ if self.inputs['vds-dir'] \
else os.path.join('/users', os.environ['USER'], 'data', else os.path.join('/users', os.environ['USER'], 'data',
...@@ -98,22 +103,26 @@ class MakeVDS(WSRTrecipe): ...@@ -98,22 +103,26 @@ class MakeVDS(WSRTrecipe):
if not os.path.exists(vds_dir): if not os.path.exists(vds_dir):
os.makedirs(vds_dir) os.makedirs(vds_dir)
self.print_debug('Created directory ' + vds_dir) self.print_debug('Created directory ' + vds_dir)
# Generate the VDS-files.
fail = 0 fail = 0
for (ms, vds) in zip(ms_files, vds_files): for (ms, vds) in zip(ms_files, vds_files):
self.print_message('Processing file ' + ms) self.print_message('Processing file ' + ms)
fail += self.cook_system('makevds', [clusterdesc, ms, vds]) if not self.inputs['dryrun']:
fail += self.cook_system('makevds', [clusterdesc, ms, vds])
if fail: if fail:
self.print_error(str(fail) + ' makevds process(es) failed!') self.print_error(str(fail) + ' makevds process(es) failed!')
return 1 return 1
# Combine the VDS-files into one GDS-file.
self.print_message('Generating gds file from vds files') self.print_message('Generating gds file from vds files')
opts = [os.path.join(vds_dir, self.inputs['observation'] + '.gds')] opts = [os.path.join(vds_dir, self.inputs['observation'] + '.gds')]
opts.extend(vds_files) opts.extend(vds_files)
if self.cook_system('combinevds', opts): if not self.inputs['dryrun']:
self.print_error('combinevds failed!') if self.cook_system('combinevds', opts):
return 1 self.print_error('combinevds failed!')
return 1
return 0 return 0
......
# This will install .py files into $(bindir) with their execute bit set.
bin_SCRIPTS = dppp_node.py \
DPPP.py \
MakeVDS.py \
MWImager.py \
StandardImagingPipeline.py
# This will install .py, .pyc, and .pyo files into the site-packages directory.
pypkgdir = $(pythondir)/lofar/pipeline
pypkg_PYTHON = __init__.py \
Observation.py \
sysconfig.py
include $(top_srcdir)/Makefile.common
...@@ -24,12 +24,10 @@ ...@@ -24,12 +24,10 @@
"""Script to run the Standard Imaging Pipeline""" """Script to run the Standard Imaging Pipeline"""
from WSRTrecipe import WSRTrecipe from lofar.pipeline.WSRTrecipe import WSRTrecipe
from ingredient import WSRTingredient from lofar.pipeline.ingredient import WSRTingredient
#from dppp import DPPP from lofar.pipeline.parset import Parset
#from mwimager import MWImager from lofar.pipeline import sysconfig
from parset import Parset
import sysconfig
import os import os
import sys import sys
...@@ -45,7 +43,7 @@ class StandardImagingPipeline(WSRTrecipe): ...@@ -45,7 +43,7 @@ class StandardImagingPipeline(WSRTrecipe):
self.inputs['make-vds-files'] = True self.inputs['make-vds-files'] = True
self.inputs['input-dir'] = None self.inputs['input-dir'] = None
self.inputs['output-dir'] = None self.inputs['output-dir'] = None
self.inputs['vds-output-dir'] = None self.inputs['vds-dir'] = None
self.inputs['dryrun'] = False self.inputs['dryrun'] = False
self.helptext = """ self.helptext = """
This is the recipe for the LOFAR standard imagaging pipeline. This is the recipe for the LOFAR standard imagaging pipeline.
...@@ -60,14 +58,14 @@ class StandardImagingPipeline(WSRTrecipe): ...@@ -60,14 +58,14 @@ class StandardImagingPipeline(WSRTrecipe):
--observation name of the observation to be processed --observation name of the observation to be processed
(no default) (no default)
--make-vds-files create VDS files --make-vds-files create VDS files
(default: no) (default: yes)
--input-dir directory for the input MS-files; --input-dir directory for the input MS-files;
only needed when VDS files are missing only needed when VDS files are missing
(optional; no default) (optional; no default)
--output-dir directory for the output MS-files; --output-dir directory for the output MS-files;
only needed when VDS files are missing only needed when VDS files are missing
(optional; default: '/data/${USER}/<obs>') (optional; default: '/data/${USER}/<obs>')
--vds-output-dir directory for the output VDS-files; --vds-dir directory for the output VDS-files;
only needed until IDPPP creates these files only needed until IDPPP creates these files
(optional; default: '/users/${USER}/data/<obs>) (optional; default: '/users/${USER}/data/<obs>)
--dryrun do a dry run --dryrun do a dry run
...@@ -85,17 +83,18 @@ class StandardImagingPipeline(WSRTrecipe): ...@@ -85,17 +83,18 @@ class StandardImagingPipeline(WSRTrecipe):
self.inputs['output-dir'] = '/data/' + os.environ['USER'] + \ self.inputs['output-dir'] = '/data/' + os.environ['USER'] + \
'/' + obs '/' + obs
if self.inputs['vds-output-dir'] is None: if self.inputs['vds-dir'] is None:
self.inputs['vds-output-dir'] = '/users/' + os.environ['USER'] + \ self.inputs['vds-dir'] = '/users/' + os.environ['USER'] + \
'/data/' + obs '/data/' + obs
# Create VDS files for the MS-files in the observation, if requested. # Create VDS files for the MS-files in the observation, if requested.
if self.inputs['make-vds-files']: if self.inputs['make-vds-files']:
inputs = WSRTingredient() inputs = WSRTingredient()
outputs = WSRTingredient() outputs = WSRTingredient()
inputs['cluster-name'] = self.inputs['cluster-name'] inputs['cluster-name'] = self.inputs['cluster-name']
inputs['observation'] = self.inputs['observation'] inputs['observation'] = self.inputs['observation']
inputs['directory'] = self.inputs['input-dir'] inputs['input-dir'] = self.inputs['input-dir']
inputs['dryrun'] = self.inputs['dryrun']
sts = self.cook_recipe('MakeVDS', inputs, outputs) sts = self.cook_recipe('MakeVDS', inputs, outputs)
if sts: if sts:
print "MakeVDS returned with status", sts print "MakeVDS returned with status", sts
...@@ -106,7 +105,7 @@ class StandardImagingPipeline(WSRTrecipe): ...@@ -106,7 +105,7 @@ class StandardImagingPipeline(WSRTrecipe):
inputs['cluster-name'] = self.inputs['cluster-name'] inputs['cluster-name'] = self.inputs['cluster-name']
inputs['observation'] = self.inputs['observation'] inputs['observation'] = self.inputs['observation']
inputs['output-dir'] = self.inputs['output-dir'] inputs['output-dir'] = self.inputs['output-dir']
inputs['vds-output-dir'] = self.inputs['vds-output-dir'] inputs['vds-dir'] = self.inputs['vds-dir']
inputs['dryrun'] = self.inputs['dryrun'] inputs['dryrun'] = self.inputs['dryrun']
outputs = WSRTingredient() outputs = WSRTingredient()
sts = self.cook_recipe('DPPP', inputs, outputs) sts = self.cook_recipe('DPPP', inputs, outputs)
...@@ -122,6 +121,9 @@ class StandardImagingPipeline(WSRTrecipe): ...@@ -122,6 +121,9 @@ class StandardImagingPipeline(WSRTrecipe):
inputs['cluster-name'] = self.inputs['cluster-name'] inputs['cluster-name'] = self.inputs['cluster-name']
inputs['observation'] = self.inputs['observation'] inputs['observation'] = self.inputs['observation']
inputs['output-dir'] = self.inputs['output-dir'] inputs['output-dir'] = self.inputs['output-dir']
inputs['vds-dir'] = self.inputs['vds-dir']
inputs['dryrun'] = self.inputs['dryrun']
outputs = WSRTingredient() outputs = WSRTingredient()
sts = self.cook_recipe('MWImager', inputs, outputs) sts = self.cook_recipe('MWImager', inputs, outputs)
if sts: if sts:
......
#!/usr/bin/env python
#
# __init__.py: module initialization file
#
# Copyright (C) 2002-2008
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"""Module initialization file"""
#!/usr/bin/env python #!/usr/bin/env python
#
# dppp_node.py: script to run DPPP on a single node
#
# Copyright (C) 2002-2008
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"""Script to run DPPP on a single node"""
import os, sys, logging, socket import os, sys, logging, socket
...@@ -64,10 +88,14 @@ if msin == msout: ...@@ -64,10 +88,14 @@ if msin == msout:
vds = vdsdir + '/' + os.path.basename(msout) + '.vds' vds = vdsdir + '/' + os.path.basename(msout) + '.vds'
logging.info('Output VDS: %s', vds) logging.info('Output VDS: %s', vds)
# Create working dir if it doesn't exist and change to it. # Create working dir if it doesn't exist and change to it. Working directory
# `wd' may already have been created by another instance of dppp_node.py. So
# wrap os.makedirs() in a try-except block.
if wd: if wd:
if not os.path.exists(wd): try:
os.makedirs(wd) os.makedirs(wd)
except OSError, e:
logging.info(e)
os.chdir(wd) os.chdir(wd)
wd = os.getcwd() wd = os.getcwd()
logging.info('Current working directory: %s', wd) logging.info('Current working directory: %s', wd)
......
#!/usr/bin/env glish
include 'viewer.g'
dp:=dv.newdisplaypanel();
for(i in 3:len(argv))
{
path:=split(argv[i],'/');
imfile:=path[len(path)];
print paste(argv[i], "->", spaste(imfile, ".ps"));
dd:=dv.loaddata(argv[i],'raster');
dp.register(dd);
dd.setoptions([titletext=[value=imfile]]);
dd.setoptions([axislabelswitch=[value=T],xgridtype=[value='Full grid'],ygridtype=[value='Full grid']]);
#dd.setoptions([colormode=[value=colormap]]); <-- seems to screw things up, cannot do 'Adjust' in the GUI after this.
dd.setoptions([colormap=[value='Hot Metal 2']]);
dd.setoptions([wedge=[value=T]]);
man:=dp.canvasprintmanager();
man.writeps(spaste(imfile, ".ps"), 'a4', F, 300);
dp.unregister(dd);
}
dp.done();
exit;
#!/bin/bash
source /users/loose/mwimager/LOFAR/installed/gnu_opt/lofarinit.sh
for (( i=0; i<3; i++ ))
do
for (( j=0; j<12; j++ ))
do
ms=$(printf "/lifs%03d/pipeline/L2007_03463_SB%d.MS" \
$(expr $j + 1) $(expr 12 "*" $i + $j))
echo "Processing $(basename $ms)"
makevds $HOME/lioff.clusterdesc $ms $(basename $ms).vds
done
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment