Commit f4ca184c authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

change to waf

parent 968ef7dd
......@@ -13,39 +13,44 @@ described below.
* Installation
** Dependencies
The NILC tool relies on the *Healpix* C++ library
(http://healpix.jpl.nasa.gov/) and the *spherelib* library which
extends the Healpix package with needlet analysis and filtering
routines.
Those two libraries are provided and automatically installed with the
NILC source code.
Those two libraries are provided with the NILC source code but it is
possible to use a local version of the Healpix library.
** Dependencies
The NILC tool also uses the *GSL* library.
To build the binary, you will need the Scons construction tool. Get
it from your package manager or see http://www.scons.org
** Installing the NILC tool
It is also possible to use scons-local by downloading
scons-local-xxxx.tar.gz, unpacking the tar ball in the current
directory and then running:
=python scons.py -f SConstruct_local=
after the file =SConstruct_local_example= has been edited into
=SConstruct_local= to fit your system.
*** Compiling Healpix
** Installing the NILC tool
A recent version of the Healpix library is provided with the source
under the =healpix= directory.
Change directory to the NILC source code repository and run:
Change to this directory and run:
=scons=
=HEALPIX_TARGET=generic_gcc; make=
To clean up after a build:
The Healpix compilation step will be included to the main construction
script in the near future.
=scons -c=
*** Compiling the NILC binary
To install the binary:
Change directory to root and run:
=scons install --prefix=mydir=
=./waf configure --with-healpix=path/to/healpix --prefix=my/prefix/path=
=./waf build=
To clean up after a build:
=./waf clean=
To install the binary:
=./waf install=
Default prefix is '/usr/local'.
......@@ -55,7 +60,9 @@ Default prefix is '/usr/local'.
A simple test can be run using the simulated data provided with the
NILC package:
=nilc fullsky.param=
=cd nilc=
=./nilc fullsky.param=
* Pixel based ILC
......@@ -68,8 +75,7 @@ The NILC tool can be used for pixel-based analysis performed:
** Full sky analyis
In this case, input parameters are minimum as in this simple example:
[[file:./fullsky.param]]
[[file:./nilc/fullsky.param]]
** Patch analysis
......@@ -78,8 +84,8 @@ In order to exclude a zone of the analysis, one can define a binary
mask which is an Healpix map with pixel equal to 0 in the excluded
zone and 1 elsewhere:
file:./patch.param
file:./nilc/patch.param
** Localized analysis
......@@ -87,7 +93,7 @@ In order to performed a space localized ILC, this Healpix map can be
used to define more pixel zones.
In this case, each pixel is set to its zone number starting from 1:
file:./grid.param
file:./nilc/grid.param
* Needlet ILC
......@@ -98,6 +104,7 @@ statistics over both space and spectral domains.
The spectral localisation is made available through the use of spline
window functions. Window function limits are set in a vector with the
following convention:
=bands=[lmin_0 lmin_1 lmin_2...lmin_J lmin_J-1 lmax_J]=
with =lmax_j-2=lmin_j=.
......@@ -105,7 +112,7 @@ The space localisation uses the same convention as described in the
previous section, except that one has to define as many Healpix zone
maps as needlet scales (J in this example).
file:./needlet.param
file:./nilc/needlet.param
* More options
......@@ -118,6 +125,10 @@ file:./needlet.param
parameter.
+ One can use command line options instead of parameter file:
+ In the pixel based case:
=nilc -p outfile -z zonefile N infile1 coeff1 ... infileN coeffN=
+ In the needlet case:
=nilc outfile l0 J zonefile1 lmax1 ... zonefileJ lmaxJ N infile1 coeff1 ... infileN coeffN=
ifndef HEALPIX_TARGET
HEALPIX_TARGET:=$(error HEALPIX_TARGET undefined. Please see README.compilation for help)UNDEFINED
endif
ifndef TGT
TGT:=$(shell pwd)/$(HEALPIX_TARGET)
endif
default: compile_all
SRCROOT:=$(shell pwd)
......
BLDROOT = $(SRCROOT)/build.$(HEALPIX_TARGET)
PREFIX = $(SRCROOT)/$(HEALPIX_TARGET)
BLDROOT = $(TGT)/build.$(HEALPIX_TARGET)
PREFIX = $(TGT)
BINDIR = $(PREFIX)/bin
INCDIR = $(PREFIX)/include
LIBDIR = $(PREFIX)/lib
......
# -*- mode: python -*-
#from waflib.Task import Task
#class make(Task):
# def run(self):
# return self.exec_command('make HEALPIX_TARGET=spherelib' % (
# self.inputs[0].abspath(),
# self.outputs[0].abspath()))
import os.path as op
def build( bld ):
#bld(rule='make HEALPIX_TARGET=spherelib', target='spherelib')
#sources = bld.path.ant_glob('*.cpp', bld=False)
lib = bld( name = 'HEALPIX',
rule='echo ${TGT};cd ../healpix;pwd;make HEALPIX_TARGET=generic_gcc TGT=../build/${TGT}',
target = "generic_gcc",
includes = './generic_gcc/include',
export_defines = ['HEALPIXDATA="'+op.abspath('./data')+'"'],
export_includes = './generic_gcc/include',
stlibpath = ['./generic_gcc/lib'],
stlib = ['healpix_cxx', 'cxxsupport', 'psht', 'c_utils', 'fftpack', 'cfitsio'],
)
# -*- mode: python -*-
def build( bld ):
sources = bld.path.ant_glob('*.cpp', bld=False)
lib = bld.stlib( name = 'spherelib',
source = sources,
target = 'spherelib',
includes = '.',
export_includes = '.',
use = ['HEALPIX'],
vnum = '1.0' )
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<title>Needlet ILC tool</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2011-01-05 13:58:59 CET"/>
<meta name="author" content="M. Le Jeune"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.tag { background-color: #add8e6; font-weight:normal }
.target { }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
p.verse { margin-left: 3% }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
overflow:auto;
}
table { border-collapse: collapse; }
td, th { vertical-align: top; }
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
.org-info-js_info-navigation { border-style:none; }
#org-info-js_console-label { font-size:10px; font-weight:bold;
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="org.css" />
<script type="text/javascript">
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="content">
<h1 class="title">Needlet ILC tool</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Installation </a>
<ul>
<li><a href="#sec-1.1">1.1 Dependencies </a></li>
<li><a href="#sec-1.2">1.2 Installing the NILC tool </a></li>
<li><a href="#sec-1.3">1.3 Running the NILC tool </a></li>
</ul>
</li>
<li><a href="#sec-2">2 Pixel based ILC </a>
<ul>
<li><a href="#sec-2.1">2.1 Full sky analyis </a></li>
<li><a href="#sec-2.2">2.2 Patch analysis </a></li>
<li><a href="#sec-2.3">2.3 Localized analysis </a></li>
</ul>
</li>
<li><a href="#sec-3">3 Needlet ILC </a></li>
<li><a href="#sec-4">4 More options </a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Installation </h2>
<div class="outline-text-2" id="text-1">
<p>
The NILC tool relies on the <b>Healpix</b> C++ library
(<a href="http://healpix.jpl.nasa.gov/">http://healpix.jpl.nasa.gov/</a>) and the <b>spherelib</b> library which
extends the Healpix package with needlet analysis and filtering
routines.
</p>
<p>
Those two libraries are provided and automatically installed with the
NILC source code.
</p>
</div>
<div id="outline-container-1.1" class="outline-3">
<h3 id="sec-1.1"><span class="section-number-3">1.1</span> Dependencies </h3>
<div class="outline-text-3" id="text-1.1">
<p>
To build the binary, you will need the Scons construction tool. Get
it from your package manager or see <a href="http://www.scons.org">http://www.scons.org</a>
</p>
<p>
It is also possible to use scons-local by downloading
scons-local-xxxx.tar.gz, unpacking the tar ball in the current
directory and then running:
<code>python scons.py -f SConstruct_local</code>
after the file <code>SConstruct_local_example</code> has been edited into
<code>SConstruct_local</code> to fit your system.
</p>
</div>
</div>
<div id="outline-container-1.2" class="outline-3">
<h3 id="sec-1.2"><span class="section-number-3">1.2</span> Installing the NILC tool </h3>
<div class="outline-text-3" id="text-1.2">
<p>
Change directory to the NILC source code repository and run:
</p>
<p>
<code>scons</code>
</p>
<p>
To clean up after a build:
</p>
<p>
<code>scons -c</code>
</p>
<p>
To install the binary:
</p>
<p>
<code>scons install --prefix=mydir</code>
</p>
<p>
Default prefix is '/usr/local'.
</p>
</div>
</div>
<div id="outline-container-1.3" class="outline-3">
<h3 id="sec-1.3"><span class="section-number-3">1.3</span> Running the NILC tool </h3>
<div class="outline-text-3" id="text-1.3">
<p>
A simple test can be run using the simulated data provided with the
NILC package:
</p>
<p>
<code>nilc fullsky.param</code>
</p>
</div>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Pixel based ILC </h2>
<div class="outline-text-2" id="text-2">
<p>
The NILC tool can be used for pixel-based analysis performed:
</p><ul>
<li>
on the full sky;
</li>
<li>
on a patch or using a galactic mask;
</li>
<li>
on a set of pixel zones.
</li>
</ul>
</div>
<div id="outline-container-2.1" class="outline-3">
<h3 id="sec-2.1"><span class="section-number-3">2.1</span> Full sky analyis </h3>
<div class="outline-text-3" id="text-2.1">
<p>
In this case, input parameters are minimum as in this simple example:
</p>
<p>
<a href="./fullsky.param">file:./fullsky.param</a>
</p>
</div>
</div>
<div id="outline-container-2.2" class="outline-3">
<h3 id="sec-2.2"><span class="section-number-3">2.2</span> Patch analysis </h3>
<div class="outline-text-3" id="text-2.2">
<p>
In order to exclude a zone of the analysis, one can define a binary
mask which is an Healpix map with pixel equal to 0 in the excluded
zone and 1 elsewhere:
</p>
<p>
<a href="./patch.param">file:./patch.param</a>
</p>
</div>
</div>
<div id="outline-container-2.3" class="outline-3">
<h3 id="sec-2.3"><span class="section-number-3">2.3</span> Localized analysis </h3>
<div class="outline-text-3" id="text-2.3">
<p>
In order to performed a space localized ILC, this Healpix map can be
used to define more pixel zones.
In this case, each pixel is set to its zone number starting from 1:
</p>
<p>
<a href="./grid.param">file:./grid.param</a>
</p>
</div>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Needlet ILC </h2>
<div class="outline-text-2" id="text-3">
<p>
The Needlet ILC is based on the possibility to localized the
statistics over both space and spectral domains.
</p>
<p>
The spectral localisation is made available through the use of spline
window functions. Window function limits are set in a vector with the
following convention:
<code>bands=[lmin_0 lmin_1 lmin_2...lmin_J lmin_J-1 lmax_J]</code>
with <code>lmax_j-2=lmin_j</code>.
</p>
<p>
The space localisation uses the same convention as described in the
previous section, except that one has to define as many Healpix zone
maps as needlet scales (J in this example).
</p>
<p>
<a href="./needlet.param">file:./needlet.param</a>
</p>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> More options </h2>
<div class="outline-text-2" id="text-4">
<ul>
<li>
Input files are Healpix map by default. It is possible to use alm
files instead by setting the option almopt to <code>true</code>. In this case,
one has to specify which resolution will be used for the output map
with the <code>nside</code> parameter.
</li>
<li>
Spherical harmonic transforms can be tuned with the <code>n_iter</code>
parameter.
</li>
<li>
One can use command line options instead of parameter file:
<ul>
<li>
In the pixel based case:
<code>nilc -p outfile -z zonefile N infile1 coeff1 ... infileN coeffN</code>
</li>
<li>
In the needlet case:
<code>nilc outfile l0 J zonefile1 lmax1 ... zonefileJ lmaxJ N infile1 coeff1 ... infileN coeffN</code>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="postamble">
<p class="author"> Author: M. Le Jeune
<a href="mailto:lejeune@apc.univ-paris7.fr">&lt;lejeune@apc.univ-paris7.fr&gt;</a>
</p>
<p class="date"> Date: 2011-01-05 13:58:59 CET</p>
<p class="creator">HTML generated by org-mode 6.33x in emacs 23</p>
</div>
</div>
</body>
</html>
## ----------------------------------------------------------------------------
## Set your config here
LIBS = [ 'healpix_cxx' ,'cxxsupport' ,'cfitsio', 'spherelib','processoptions', 'gsl', 'gslcblas','libpsht' ,'c_utils' ,'fftpack']
SPHERELIB = '../lib/src'
SPHEREINC = '../include'
HEALPIXLIB = '../healpix/spherelib/lib'
HEALPIXINC = '../healpix/spherelib/include'
HEALPIXDATA = '\\\"../healpix/data\\\"'
CFITSIOLIB = '/usr/local/lib'
CFITSIOINC = '/usr/local/include'
CXX = 'g++'
CXXFLAGS = '-w -O3 -fPIC -ffast-math -fopenmp -g0 -s'
## ----------------------------------------------------------------------------
import glob
cfiles = glob.glob('./*.cc')
AddOption('--prefix',
dest='prefix',
type='string',
nargs=1,
action='store',
metavar='DIR',
default='/usr/local',
help='installation prefix')
opt = Environment(PREFIX = GetOption('prefix'), CXXFLAGS = CXXFLAGS,LIBS=LIBS, CXX=CXX,CPPDEFINES={'HEALPIXDATA': HEALPIXDATA}, CPPPATH = [SPHERELIB, SPHEREINC, HEALPIXINC,CFITSIOINC],LINKFLAGS=CXXFLAGS, LIBPATH=[SPHERELIB,HEALPIXLIB,CFITSIOLIB,"."] )
## Build healpix
print('building healpix (this may take a while)')
import os
target = "spherelib"
cfitsio = "/usr/local"
compil_result = os.system('cd ../healpix && '
'HEALPIX_TARGET=%s CFITSIO_EXT_PREFIX=%s make '%(target,cfitsio))
## Build the library
SConscript(SPHERELIB+'/Sconscript', exports='opt')
opt.Library('spherelib', glob.glob('../lib/src/*.cpp'))
opt.Library('processoptions', ['processoptions.cpp', 'processoptions.h'])
## Compile binaries
for p in range(len(cfiles)):
opt.Install('$PREFIX/bin',opt.Program(cfiles[p]) )
opt.Alias('install', '$PREFIX/bin')
......@@ -202,7 +202,7 @@ int main(int argc ,const char** argv)
rm_tmp_file(statfile);
rm_tmp_file(ilcfile);
if (ztorm)
rm_tmp_file(zonefile);
rm_lst_tmp(1, &zonefile);
}
else{
......
# -*- mode: python -*-
def build( bld ):
sources = bld.path.ant_glob('*.cc')+bld.path.ant_glob('*.cpp')
prog = bld.program(source = sources,
target = "nilc",
includes = [ '.', '../include', '../lib'],
use = 'HEALPIX spherelib GSL',
vnum = '1.0' )
......@@ -4,6 +4,8 @@
font-size: 11pt;
text-align: left;
line-height:1.2em;
/*max-width:50%;*/
}
h1 {font-size: 14pt;}
......@@ -147,7 +149,7 @@
.org-default {
/* default */
color: #000000;
background-color: #ffffff;
background-color: #D8D8D8;
}
.org-diary {
/* diary */
......@@ -156,6 +158,7 @@
.org-doc {
/* font-lock-doc-face */
color: #bc8f8f;
}
.org-escape-glyph {
/* escape-glyph */
......
File added
# -*- mode: python; -*-
import os
import os.path as op
import sys
APPNAME = 'spherelib'
VERSION = '1.0'
top = '.'
out = 'build'
def options( ctx ):
ctx.load('compiler_c')
ctx.load('compiler_cxx')
ctx.add_option('--with-healpix', action='store', help='Path to an existing healpix installation',default=False)