-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome.py
More file actions
115 lines (86 loc) · 4.36 KB
/
welcome.py
File metadata and controls
115 lines (86 loc) · 4.36 KB
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
import autogalaxy as ag
input(
"############################################\n"
"### WELCOME TO THE AUTOGALAXY WORKSPACE ###\n"
"############################################\n\n"
"This script runs a few checks to ensure PyAutoGalaxy is set up correctly.\n"
""
"Once they pass, you should read through the autogalaxy_workspace/start_here.ipynb notebook "
"(or autogalaxy_workspace/start_here.py script if you prefer Python scripts) to get a full overview of PyAutoGalaxy.\n\n"
"\n"
"############################################\n"
"### AUTOGALAXY WORKSPACE WORKING DIRECTORY ###\n"
"############################################\n\n"
"""
PyAutoGalaxy assumes that the `autogalaxy_workspace` directory is the Python working directory.
This means that, when you run an example script, you should run it from the `autogalaxy_workspace`
as follows:
cd path/to/autogalaxy_workspace (if you are not already in the autogalaxy_workspace).
python3 scripts/modeling/imaging/light_parametric.py
The reasons for this are so that PyAutoGalaxy can:
- Load configuration settings from config files in the `autogalaxy_workspace/config` folder.
- Load example data from the `autogalaxy_workspace/dataset` folder.
- Output the results of models fits to your hard-disk to the `autogalaxy/output` folder.
If you have any errors relating to importing modules, loading data or outputting results it is likely because you
are not running the script with the `autogalaxy_workspace` as the working directory!
[Press Enter to continue]"""
)
input(
"\n"
"###############################\n"
"##### MATPLOTLIB BACKEND ######\n"
"###############################\n\n"
"""
We`re now going to plot an image in PyAutoGalaxy using Matplotlib, using the backend specified in the following
config file (the backend tells Matplotlib where to render the plot)"
autogalaxy_workspace/config/visualize/generag.yaml -> [general] -> `backend`
The default entry for this is `default` (check the config file now). This uses the default Matplotlib backend
on your computer. For most users, pushing Enter now will show the figure without error.
However, we have had reports that if the backend is set up incorrectly on your system this plot can either
raise an error or cause the `welcome.py` script to crash without a message. If this occurs after you
push Enter, the error is because the Matplotlib backend on your computer is set up incorrectly.
To fix this in PyAutoGalaxy, try changing the backend entry in the config file to one of the following values:"
backend=TKAgg
backend=Qt5Agg
backeknd=Qt4Agg
NOTE: If a matplotlib figure window appears, you may need to close it via the X button and then press
enter to continue the script.
[Press Enter to continue]
"""
)
import autogalaxy as ag
import autogalaxy.plot as aplt
grid = ag.Grid2D.uniform(
shape_native=(50, 50),
pixel_scales=0.1, # <- The pixel-scale describes the conversion from pixel units to arc-seconds.
)
sersic_light_profile = ag.lp.Exponential(
centre=(0.3, 0.2), ell_comps=(0.2, 0.0), intensity=0.05, effective_radius=1.0
)
aplt.plot_array(array=sersic_light_profile.image_2d_from(grid=grid), title="Image")
input(
"\n"
"#####################\n"
"## LIGHT PROFILES ###\n"
"#####################\n\n"
"""
The image displayed on your screen shows a `LightProfile`, the object PyAutoGalaxy uses to represent the
luminous emission of galaxies.
[Press Enter to continue]
"""
)
input(
"\n"
"###########################\n"
"##### WORKSPACE TOUR ######\n"
"###########################\n\n"
"""
PyAutoGalaxy is now set up and you can begin exploring the workspace.
We recommend new users begin by following the 'start_here.ipynb' notebook, which gives an overview
of **PyAutoGalaxy** and the workspace.
This will also guide you through where to go next in the workspace depending on your scientific interests.
A full description of the workspace can be found in the `autogalaxy_workspace/README.md` file and on the
PyAutoGalaxy readthedocs website.
[Press Enter to continue]
"""
)