Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.mrao.cam.ac.uk/~bn204/publications/2010/2010-09-OOFSoftware.pdf
Дата изменения: Fri Aug 10 20:18:02 2012
Дата индексирования: Tue Oct 2 15:41:47 2012
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п
OOF Software Its Structure and How to Extend It
B. Nikolic
MRAO, Cavendish Laborator y/Kavli Institute for Cosmplogy University of Cambridge

September 2010

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

1 / 18


Software structure

Outline

1

Software structure Extending OOF software for application at a new telescope Interpreting the results

2

3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

2 / 18


Software structure

Mixed C++/Python architecture

Outline

1

Software structure Mixed C++/Python architecture Modular approach Extending OOF software for application at a new telescope Preparing the input files Calculation of the effect of de-focus Interpreting the results

2

3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

3 / 18


Software structure

Mixed C++/Python architecture

Mixing C++ and Python
In C++
1 2

All of the algorithms Definitions of all data structures

In Python
1 2

Top level flow control Some Input/Output

Python C++: SWIG
1 2

The binding is automatically generated by SWIG Standard way of doing this!

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

4 / 18


Software structure

Mixed C++/Python architecture

Motivation for mixed C++ and Python

Python is interactive:
1 2 3

4

Can easily inspect or change the data structures at any time Easy and flexible control of algorithm parameters Can build more complex algorithms from routines available in C++ code Excellent environment to interactively test C++ code

Good Input/Output suppor t (including FITS and HDF5) Good plotting (matplotlib and PyX) This combination is now becoming the standard in astronomy....

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

5 / 18


Software structure

Modular approach

Outline

1

Software structure Mixed C++/Python architecture Modular approach Extending OOF software for application at a new telescope Preparing the input files Calculation of the effect of de-focus Interpreting the results

2

3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

6 / 18


Software structure

Modular approach

Modules
BNMin1: generalised minimisation and inference
1 2 3

Non-linear least-squares fitting (primarily Levenberg-Marquardt) Markov Chain Monte Carlo (Metropolis algorithm) Nested Sampling

AstroMap: Suppor t for two-dimensional astronomical maps
1 2 3

Coordinate systems Re-gridding data FFTs, convolution

OOF: The application module which brings everything together
1 2

Description of the effect of defocus ...
OOF Holography September 2010 7 / 18

B. Nikolic (University of Cambridge)


Software structure

Modular approach

Auxiliary modules

BNFits: FITS file handling BNLib: General utility routines

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

8 / 18


Extending OOF software for application at a new telescope

Outline

1

Software structure Extending OOF software for application at a new telescope Interpreting the results

2

3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

9 / 18


Extending OOF software for application at a new telescope

Preparing the input files

Outline

1

Software structure Mixed C++/Python architecture Modular approach Extending OOF software for application at a new telescope Preparing the input files Calculation of the effect of de-focus Interpreting the results

2

3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

10 / 18


Extending OOF software for application at a new telescope

Preparing the input files

OOF Input Tasks

1 2

Read data from the telescope specific format Compute the offset from the centre of source of each sample of the beam (antenna coordinate system of course!) Remove atmospheric signal and any obvious instrumental effects, e.g., by:
Fitting a linear trend to end of scans Using a line-free channels when doing spectral line

3

4 5

Compute noise estimate for each sample Do not regrid the data!

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

11 / 18


Extending OOF software for application at a new telescope

Preparing the input files

OOF Input format
Standard FITS file format

Primary header No data: just keywords specifying basic parameters (telescope name, observing wavelength, etc) 1st Extension HDU: Binary table Data for in-focus map: Dx Dy ... ... Fnu ... dFNu ... Time (Not used)

2nd Extension HDU: Binary table Data for first out-of focus map Dx Dy Fnu ... ... ...
B. Nikolic (University of Cambridge) OOF Holography

dFNu ...

Time ...
September 2010 12 / 18


Extending OOF software for application at a new telescope

Preparing the input files

Available scripts

1

Python fragments to write the FITS file with binary tables using the PyFITS librar y Fitting to linear trend to end-of-scan (T. Hunter) Creating of simulated time series and corresponding FITS files

2 3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

13 / 18


Extending OOF software for application at a new telescope

Calculation of the effect of de-focus

Outline

1

Software structure Mixed C++/Python architecture Modular approach Extending OOF software for application at a new telescope Preparing the input files Calculation of the effect of de-focus Interpreting the results

2

3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

14 / 18


Extending OOF software for application at a new telescope

Calculation of the effect of de-focus

Calculation of the effect of de-focus
I.e.: How does the aper ture plane phase change when the sub-reflector is move? Offset Gregorian Simple Cassegrain

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

15 / 18


Extending OOF software for application at a new telescope

Calculation of the effect of de-focus

How to implement

Current implementations are all in C++ See oof/src/telgeo/cassegrain.hxx and oof/src/telgeo/gbtgeo.hxx Correct routine chosen on basis of telescope name in oof/src/telgeo/telswitch.hxx (Add the new telescope here!) A prime focus also exists (oof/src/telgeo/primefoc.hxx) but so far only used for simulation/testing

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

16 / 18


Interpreting the results

Outline

1

Software structure Extending OOF software for application at a new telescope Interpreting the results

2

3

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

17 / 18


Interpreting the results

Interpreting the results

1

Look to see if the best-fit model beams look like the observed beams (plots are automatically generated) Look at the 2 value and compare to number of input data points Look at the correlation matrix (cvmatrix.csv) ­ are any of the parameters ver y degenerate? Look at the retrieved surface Repeat this process star ting with maximum Zernike order one (i.e., just pointing) and up to 5 or 6 for typical applications

2 3

4 5

B. Nikolic (University of Cambridge)

OOF Holography

September 2010

18 / 18