Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PSF content and structure #25

Merged
merged 13 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ dependencies:
- matplotlib
- numpy
- scipy
- galsim
- pip:
- jupyter-book
160 changes: 160 additions & 0 deletions shearbook/_bibliography/z_psf_models.bib

Large diffs are not rendered by default.

Binary file added shearbook/_static/psf-HST-obscurations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-HST-surface-errors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-atmospheric-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-dome-seeing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-misalignments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-pixelation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-scatter-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf-typical-aberrations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shearbook/_static/psf_wavefron_aberrations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions shearbook/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
- file: intro/about
- file: intro/run_code

- part: Point Spread Function
chapters:
- file: psf/psf-intro
sections:
- file: psf/psf-origins-nb
- file: psf/psf-modelling
sections:
- file: psf/non-parametric-model
- file: psf/parametric-model
- file: psf/psf-models-ref

- part: Shape Measurement
chapters:
- file: moments/moments-intro
Expand Down
15 changes: 15 additions & 0 deletions shearbook/psf/non-parametric-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Non-parametric

```{warning}
In progress!
```

Describe the PSF modelling problem. Use stars to build a model and try to recover the PSF at galaxy positions.

Describe the main idea of a non-parametric model of the PSF.

Give an example, PSFEx (and MCCD maybe?).

_(Note) Should I give a more mathematical description of how one of the models (PSFEx for example) is build?_

_Maybe I can add some figures from the MCCD paper. Showing some of the eigenPSFs learned. Also, some observed CFIS star and the estimated PSF model._
13 changes: 13 additions & 0 deletions shearbook/psf/parametric-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Parametric

```{warning}
In progress!
```

Describe the PSF modelling problem. Characterise the model as much as possible and try to fit the reduced number of parameters with observed stars. Then use the model to recover PSFs at galaxy positions.

Describe the main idea of a parametric model of the PSF.

Give an example, TinyTim.

_(Note) Should I give an example like of how the PSF is generated following an optic model? _
8 changes: 8 additions & 0 deletions shearbook/psf/psf-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Introduction to the PSF

In this section we will..

**Contents**

```{tableofcontents}
```
8 changes: 8 additions & 0 deletions shearbook/psf/psf-modelling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PSF Modelling

In this section we will go through the two main families of Point Spread Function modelling methods.

**Contents**

```{tableofcontents}
```
5 changes: 5 additions & 0 deletions shearbook/psf/psf-models-ref.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# References

```{bibliography} ../_bibliography/z_psf_models.bib
:all:
```
460 changes: 460 additions & 0 deletions shearbook/psf/psf-origins-nb.ipynb

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions shrbk/plot_psfs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable

def plot_psf(psf_img, cmap='gist_stern'):
fig = plt.figure(figsize=(18,4))

ax = fig.add_subplot(131)
im = ax.imshow(psf_img, interpolation='none', origin='lower', cmap=cmap)
ax.set_xlabel('x [pixels]')
ax.set_ylabel('y [pixels]')
divider = make_axes_locatable(ax)
cax = divider.append_axes('right', size='5%', pad=0.05)
fig.colorbar(im, cax=cax, orientation='vertical')
ax.set_title('PSF')


ax = fig.add_subplot(132)
im = ax.imshow(np.log(abs(psf_img)), interpolation='none', origin='lower', cmap=cmap)
ax.set_xlabel('x [pixels]')
ax.set_ylabel('y [pixels]')
divider = make_axes_locatable(ax)
cax = divider.append_axes('right', size='5%', pad=0.05)
fig.colorbar(im, cax=cax, orientation='vertical')
ax.set_title('log(PSF)')

ax = fig.add_subplot(133)
im = ax.imshow(abs(np.fft.fftshift(np.fft.fft2(psf_img))), interpolation='none', origin='lower', cmap=cmap)
ax.set_xlabel('x [freq]')
ax.set_ylabel('y [freq]')
divider = make_axes_locatable(ax)
cax = divider.append_axes('right', size='5%', pad=0.05)
fig.colorbar(im, cax=cax, orientation='vertical')
ax.set_title('abs(FFT(PSF))')

plt.show()