Top Banner
Tamasis Pierre Chanial & Pasquale Panuzzo 1/ 37
37

Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Feb 28, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Tamasis

Pierre Chanial & Pasquale Panuzzo

1/ 37

Page 2: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

The Tamasis project

• Tools for Advanced Map-making, Analysis and SImulationsof Submillimeter surveys.

• ASTRONET-funded project, P.I: Marc Sauvage• Collaboration between 4 institutes:

• Garching-ESO: cosmological light cones simulations• IAS: SPIRE advanced map-making (next talk)• Saclay: PACS advanced map-making• Leiden: stacking

• massively parallel + super-resolution• Tools are publicly available to the community:

• http://pchanial.github.com/pyoperators• http://pchanial.github.com/tamasis-pacs

2/ 37

Page 3: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

The Tamasis project

3/ 37

Page 4: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

A generic pipeline for PACS

• Preprocessing1. Baseline removal2. Jump detection3. Second-level deglitching

• Map reconstruction by inversion1. Instrument model2. Objective function3. Minimisation

4/ 37

Page 5: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Baseline Removal, part 1

Inspired by the SPIRE destriper.

• Remove median over time for each bolometer and each observation⇒ y0,

• Repeat 3 times, starting with iteration i = 0:

1. Backproject yi into a map xi = PT(yi )PT(1)

2. Compute projection yi = P(xi )3. Compute drift zi,group = 〈yi − yi〉group4. Compute 1st-order polynomial fit zi,group to zi,group5. yi+1 = yi − zi,group6. i = i + 1

5/ 37

Page 6: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Baseline Removal, part 1

6/ 37

Page 7: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Baseline Removal, part 2

To remove non-linear drifts

1. Backproject yi into a map xi =PT(yi )

PT(1)

2. Compute projection yi = P(xi)

3. Compute drift zi,group = 〈yi − yi〉group4. Compute spline fit zi,group to zi,group

5. yi+1 = yi − zi,group

6. i = i + 1

7/ 37

Page 8: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Baseline Removal, part 3

To remove non-correlated drifts

1. Backproject yi into a map xi =PT(yi )

PT(1)

2. Compute projection yi = P(xi)

3. Compute drift zi,detector = yi − yi

4. Compute linear fit zi,detector to zi,detector

5. yi+1 = yi − zi,detector

6. i = i + 1

Final residuals.

Final map after baseline removal.

8/ 37

Page 9: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Glitch zoo

(N. Billot)

9/ 37

Page 10: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Glitch zoo

(P. Panuzzo)

10/ 37

Page 11: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Glitch zoo

(P. Panuzzo)

11/ 37

Page 12: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Glitch zoo

(P. Panuzzo)

12/ 37

Page 13: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Glitch zoo

(P. Panuzzo)

13/ 37

Page 14: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Long glitch removal: Jump detection

• Inspired by SPIRE preprocessing, but with Ω being agroup, a line or a single bolometer:

1. xΩ = PT(y−yΩ)PT(1−1Ω)

2. yΩ = P(xΩ)3. Detect jumps in 〈yΩ − yΩ〉Ω using Haar transform

14/ 37

Page 15: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Short glitch removal: Spatial method (2nd leveldeglitching)

(N. Billot)

15/ 37

Page 16: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

A generic pipeline for PACS

• Preprocessing1. Baseline removal2. Jump detection3. Second-level deglitching

• Map reconstruction by inversion1. Instrument model2. Objective function3. Minimisation

16/ 37

Page 17: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

17/ 37

Page 18: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Doing any science with any observation is attemptingto solve an inverse problem

y = Hx + n, n ∼ N (0,N)

y

H

x

x = argminx

||y −Hx||2N−1 + Ψ(x)

This method requires ≈100× more compute power.

⇒ Acquisition model H must be very fast

18/ 37

Page 19: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Optimisations

Speed is one of Tamasis main drivers.⇒ gain ×180 (standard PACS pipeline, Java)

⇒ gain ×2,4 (MADmap v1, pure C, scalar)

19/ 37

Page 20: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Optimisations

• As much preparation as possible before iterations• Algebraic rule simplifications• Pool-based Memory manager: no creation of array

temporaries during iterations. Hand buffers to operatorsaccording to requirements (contiguity, alignment)

• In-place/out-of-place operators• In-place reductions• Block partition: crucial to take advantage of the cache

20/ 37

Page 21: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

PACS artifacts

• Telescope PSF

• Distortion

• Projection

detector i

sky pixel jPij

• Bolometer response

• Bolometer gain

• On-board Compression

21/ 37

Page 22: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

PACS artifacts

• Offset drifts⇔ 1/f noise

22/ 37

Page 23: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Step 1: build instrument model

obs = PacsObservation(['myobs1.fits', 'myobs2.fits'])

O = ConvolutionOperator(obs.get_psf(...))

P = ProjectionOperator(obs.get_pointing_matrix())

R = ConvolutionTruncatedExponentialOperator(...)

C = CompressionAverageOperator(8)

G = DiagonalOperator(..., broadcast='rightward')

M = MaskOperator(...)

H = M * G * C * R * P * O

23/ 37

Page 24: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Step 1: build instrument model

Tamasis can do plain HIPE’s MADmap, too:

P = ProjectionOperator(obs.get_pointing_matrix(method='nearest',

downsampling=True))

M = MaskOperator(...)

H = M * P

24/ 37

Page 25: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Step 1: build instrument model

Tamasis can do vanila HIPE’s Photproject, too:

obs = PacsObservation(['myobs1.fits', 'myobs2.fits'])

y = obs.get_tod()

y = filter_median(y, 100)

P = ProjectionOperator(downsampling=True)

M = MaskOperator(y.mask)

H = M * P

m = H.T(y) / H.T(ones(y.shape))

25/ 37

Page 26: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Step 2: Objective Function

f(x) = Φ(y −Hx) + Ψ(x)

• Likelihood (with inv. covariance matrix N−1 as an operator)• prior: regularisation

• smoothness: Ψ(x) = λ ||Dα(x) + Dβ(x)||22• sparseness: Ψ(x) = λ |w(x)|1• positivity constraint

• norms: L1, L2, Lp, LHuber

For a linear model, it can be equivalent to solving Ax=b• least-square:

A = H.T * invNtt * H, b = H.T * invNtt * y

• least-square + prior:A = H.T * invNtt * H + h * D.T * D, b = H.T * invNtt * y

26/ 37

Page 27: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Step 3: Minimisation

• PCG (MPI)• non-linear PCG (MPI)• scipy.sparse.linalg (CG, CGS, BICG, BICGSTAB, GMRES,

LGMRES, ...)

• scipy.optimize (fmin_bfgs, ...)• FISTA• soon: PETSc

27/ 37

Page 28: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

High frequency reconstruction

Red channel PACS PSF

28/ 37

Page 29: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Low frequency reconstruction

“Pipeline” without hpf Tamasis RLS

• Removed artifacts

• Real structures

29/ 37

Page 30: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Flat reconstruction

simulation vs observation Resulting flatfield

30/ 37

Page 31: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Parallelisation OpenMP

31/ 37

Page 32: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Parallelisation MPI: Distributed TOD

HD ⇒DTHTN−1HDx = DTHTN−1y

H =

H1 0 · · · 00 H2 · · · 0...

. . ....

0 0 · · · Hp

D =

II...I

32/ 37

Page 33: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Parallelisation MPI: Distributed TOD and map

HD ⇒DTHTN−1HDx = DTHTN−1y

33/ 37

Page 34: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Parallelisation MPI: Distributed TOD and map

34/ 37

Page 35: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Tamasis: large dataset (LMC)

• Map: 9.2×9.0 ≈ 3 GB (4 108 unknowns)• TOD: 161h, 2048 detectors, 5.2 109 samples at 5 Hz, 4.2 1010 at 40 Hz.• Pointing matrix: 3.3 TB (1 detector intersects 10 sky pixels)• Hardware: 50min, CCRT/Curie, 2432 cores, 152 processors

35/ 37

Page 36: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Future work

• With decent pointing reconstruction:• Include telescope PSF Rightarraow deconvolution• Fix cross-artifacts in a natural way

• Integrate Panuzzo’s preprocessing treatment• Implement SUPREME’s hyperparameter handling (next

talk). For the workshop, a single value has been chosen forall observations.

• Ease installation

36/ 37

Page 37: Pierre Chanial Pasquale Panuzzo - Herschel - Cosmosherschel.esac.esa.int/2013MapmakingWorkshop/...scipy.optimize (fmin_bfgs, ...) FISTA soon: PETSc 27/ 37. High frequency reconstruction

Outstanding issue: pointing reconstruction

37/ 37