/
demo3.yaml
187 lines (164 loc) · 7.71 KB
/
demo3.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions, and the disclaimer given in the accompanying LICENSE
# file.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions, and the disclaimer given in the documentation
# and/or other materials provided with the distribution.
#
#
# Demo #3
#
# The third YAML configuration file in our tutorial about using Galsim config files
# (This file is designed to be viewed in a window 100 characters wide.)
#
# This script gets reasonably close to including all the principal features of an image
# from a ground-based telescope. The galaxy is represented as the sum of a bulge and a disk,
# where each component is represented by a sheared Sersic profile (with different Sersic
# indices). The PSF has both atmospheric and optical components. The atmospheric
# component is a Kolmogorov turbulent spectrum. The optical component includes defocus,
# coma and astigmatism, as well as obscuration from a secondary mirror. The noise model
# includes both a gain and read noise. And finally, we include the effect of a slight
# telescope distortion.
#
# New features introduced in this demo:
#
# - obj type : Sum (items)
# - obj type : Convolve (items)
# - obj type : Sersic (flux, n, half_light_radius)
# - obj type : Sersic (flux, n, scale_radius)
# - obj type : Kolmogorov (fwhm)
# - obj type : OpticalPSF (lam_over_diam, defocus, coma1, coma2, astig1, astig2, obscuration)
# - obj : ellip
# - shear type : QBeta (q, beta) -- including how to specify an angle
# - shear type : EBeta (e, beta)
# - noise type : CCD (sky_level, gain, read_noise)
# - image : size
# - image : wcs
# - wcs type : Shear
# - output : psf
# Define the galaxy profile
gal :
# This galaxy will be the sum of a bulge component and a disk component
type : Sum
# Any number of items may be added together, so we specify them in a list.
# Use one bullet for each item.
# Note: Each item in the Sum can have its own separate shear. See demo4 for an example.
items :
# Note the notation here for a list of items rather than a dict of key:value pairs.
# Each item is specified by an indented -. Then another layer of indentation is
# required for the key:value pairs for each item.
- # First the bulge:
type : Sersic
n : 3.5
half_light_radius : 2.3 # arcsec
flux : 0.3 # flux here is used to mean "fractional flux"
- # Now the disk:
type : Sersic
n : 1.5
# Normally Sersic profiles are specified by half-light radius, the radius that
# encloses half of the total flux. However, for some purposes, it can be
# preferable to instead specify the scale radius, where the surface brightness
# drops to 1/e of the central peak value.
scale_radius : 0.85 # arcsec (corresponds to half_light_radius of ~3.7 arcsec)
flux : 0.7
# A shear at this level applies to the summed profile
shear :
# QBeta means to use the axis ratio (q = b/a) and a position angle.
type : QBeta
q : 0.73
# For angles, you must let GalSim know which units you intend.
# So the number must be followed by either degrees or radians
# (or arcminutes or arcseconds if you prefer).
# These may be abbreviated to deg and rad (and arcmin, arcsec).
beta : 23 degrees
# The flux here also applies to the full galaxy object.
flux : 1.e6 # ADU ("Analog-to-digital units", the units of the numbers on a CCD)
# Define the PSF profile
psf :
# This PSF will be the convolution of an atmospheric component and an optical component.
type : Convolution
# Any number of items may be convolved together, so just like for Sum,
# we specify them in a list.
items :
-
# For the atmospheric component, we use a Kolmogorov spectrum
type : Kolmogorov
fwhm : 2.1 # arcsec
# An ellip at this level just applies to this component.
ellip:
type : EBeta
e : 0.13
beta : 0.81 radians
-
# For the optical component, GalSim provides an OpticalPSF class that
# implements the PSF pattern from various telescope aberrations.
type : OpticalPSF
# Use value for lambda = 800 nm, D = 4 m
# lam_over_diam = (800 nm) * 1.e-9 (m/nm) / (4m) * (206265 arcsec/radian)
# = 0.041253 arcsec
# You can have python do the arithmetic for you using the Eval type.
# The string given by str will be evaluated using the Python eval(str) function.
lam_over_diam :
type : Eval
str : '800 * 1.e-9 / 4 * 206265'
#lam_over_diam : 0.041253 # arcsec
# The rest of these values are given in units of lambda
defocus : 0.53
astig1 : -0.29
astig2 : 0.12
coma1 : 0.64
coma2 : -0.33
# The linear scale of the secondary mirror obstruction
# as a fraction of the primary mirror size.
obscuration : 0.3
# Define some other information about the images
image :
pixel_scale : 0.23 # arcsec / pixel
size : 64 # pixels in each direction
# (You can also specify xsize and ysize separately for non-square images.)
# You may provide a World Coordinate System (WCS) transformation to be applied
# to the image. In this case, we simply have a constant telescope distortion
# over the image. See the config wiki page for a list of all the allowed WCS
# types and their parameters. (We'll use two others in demo9 and demo11.)
wcs :
type : Shear
shear :
type : G1G2
g1 : -0.02
g2 : 0.01
noise :
# The CCD noise type has the potential to be more sophisticated than just a
# simple Poisson noise according to the flux of sky + object.
# You can also specify a gain and a read_noise for the CCD.
# The gain indicates how many photons (or electrons, technically) correspond
# to each final ADU. And the read_noise is an additional Gaussian noise
# (specified as the sigma or rms value) also in unit of electrons.
type : CCD
sky_level : 2.5e4 # ADU / arcsec^2
gain : 1.7 # e- / ADU
read_noise : 0.3 # e- / pixel
# If you want the random values used to be deterministic, you can provide an initial seed.
# If this isn't set, then it will use the current time to create an initial seed.
random_seed : 1314662
# Define the name and format of the output file
output :
dir : output_yaml
file_name : demo3.fits
# Sometimes it is useful to have the PSF image also written to a file.
# The PSF image will always have the same pixel centering as the galaxy, and if there
# was any random component to the PSF generation, then this will be the exact same PSF
# that was used for the galaxy. Plus, there is no noise in the PSF image.
psf :
# You may either specify a new file_name as we do here, or you can specify
# 'hdu' to put the PSF image in the same fits file, but in another HDU.
file_name : demo3_epsf.fits