Skip to content

Commit 934e2e7

Browse files
committed
updated quickstart guide and added option to install polaristools only (compile script)
1 parent aae3e04 commit 934e2e7

File tree

3 files changed

+44
-23
lines changed

3 files changed

+44
-23
lines changed

QUICKSTART.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ These files can be opened with, for example, [SAOImageDS9](https://sites.google.
8383
Simulations are performed similarly for thermal emission (`dust`) and stellar scattered radiation (`dust_mc`).
8484
Please refer to the [command list](projects/CommandList.cmd) in the `projects` folder or the [manual](manual.pdf) (Table 2.4 - 2.10) for available options of the command file.
8585

86-
**HINT**: For thermal emission simulations, a temperature simulation has to be performed first.
86+
**HINT**: For thermal emission simulations, a temperature simulation (`temp`) has to be performed first.
87+
88+
**HINT**: To include self-scattering, `<source_dust nr_photons = "Nph">` (`Nph` is the number of photon packages) and `<path_grid>` with the path to the grid file of the temperature simulation (e.g. "projects/disk/example/temp/grid_temp.dat") have to be provided in the command file (`dust_mc`).
89+
90+
**HINT**: `dust` simulations only include directly emitted radiation of the dust.
91+
`dust_mc` simulations include directly emitted and scattered stellar radiation, scattered radiation thermally emitted by dust, but **not** directly emitted radiation of the dust.
92+
Thus, the user has to combine the results of `dust` and `dust_mc` simulations to obtain a complete spectrum.
8793

8894
**HINT**: The previous results will be overwritten, if the same command file is used. Please change `<path_out>` in the command file to use a new directory for the new results.
8995

@@ -165,9 +171,13 @@ $$
165171

166172
Additional parameter values to modify the model can be defined in the function `update_parameter` in the file `tools/polaris_tools_modules/model.py`.
167173

168-
**Hint**: For any changes in the files, the user has to recompile with:
174+
**Hint**: For any changes in the files, the user has to recompile PolarisTools with:
169175
```bash
170-
./compile.sh -u
176+
./compile.sh -t
177+
```
178+
or if compiled without the script:
179+
```
180+
python3 tools/setup.py install --user &>/dev/null
171181
```
172182

173183

@@ -181,9 +191,13 @@ polaris-gen model_name grid_filename.dat
181191
```
182192
where `model_name` is the name of the model in the dictionary of `model.py`.
183193

184-
**Hint**: For any changes in the files, the user has to recompile with:
194+
**Hint**: For any changes in the files, the user has to recompile PolarisTools with:
185195
```bash
186-
./compile.sh -u
196+
./compile.sh -t
197+
```
198+
or if compiled without the script:
199+
```
200+
python3 tools/setup.py install --user &>/dev/null
187201
```
188202

189203

compile.sh

+25-18
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,26 @@ function update_installation()
288288
fi
289289
cd ".."
290290

291+
install_polaristools
292+
293+
source ${HOME}/.bashrc
294+
295+
exit
296+
}
297+
298+
299+
function install_polaristools()
300+
{
291301
# compile and install PolarisTools if available
292-
# PolarisTools is no longer maintained and is not shipped with POLARIS anymore
293302
if [[ -d "tools" ]]; then
294303
cd "tools/"
295304
python3 setup.py install --user &>/dev/null \
296305
&& { echo -e "Compile and installing PolarisTools [${GREEN}done${NC}]"; echo ""; } \
297306
|| { echo -e "Compile and installing PolarisTools [${RED}Error${NC}]"; exit 1; }
298307
cd ".."
308+
else
309+
echo -e "Compile and installing PolarisTools [${RED}Error${NC}]"; exit 1;
299310
fi
300-
301-
source ${HOME}/.bashrc
302-
303-
exit
304311
}
305312

306313

@@ -313,15 +320,16 @@ function usage() {
313320
echo ""
314321
echo "usage: compile.sh [-h] [-frdu] [-c CXX_COMPILER] [-g CMAKE_GENERATOR]"
315322
echo ""
316-
echo "Install and compile POLARIS"
323+
echo "Install POLARIS, PolarisTools, and optionally the cfitsio and CCfits libraries"
317324
echo -e "${YELLOW}HINT:${NC} For first installation, use option -f"
318325
echo ""
319326
echo "optional arguments:"
320327
echo "-h show this help message and exit"
321-
echo "-f first installation (compile POLARIS and install the cfitsio and CCfits libraries)"
322-
echo "-r clear and compile POLARIS (release mode) (default)"
323-
echo "-d clear and compile POLARIS (debug mode)"
324-
echo "-u re-compile POLARIS if necessary with last configuration (update)"
328+
echo "-f first installation (compile POLARIS, PolarisTools, and the cfitsio and CCfits libraries)"
329+
echo "-r clear and compile POLARIS and PolarisTools (release mode) (default)"
330+
echo "-d clear and compile POLARIS and PolarisTools (debug mode)"
331+
echo "-u re-compile POLARIS and PolarisTools if necessary with last configuration (update)"
332+
echo "-t (re-)compile PolarisTools only"
325333
echo "-c CXX_compiler"
326334
echo " choose the c++ compiler you want to use:"
327335
echo " - gcc (default)"
@@ -338,7 +346,7 @@ function usage() {
338346
release=false
339347
debug=false
340348

341-
while getopts "hfrduc:g:D" opt; do
349+
while getopts "hfrdutc:g:D" opt; do
342350
case $opt in
343351
h)
344352
usage
@@ -360,6 +368,11 @@ while getopts "hfrduc:g:D" opt; do
360368
f)
361369
DO_FITS=true
362370
;;
371+
t)
372+
install_polaristools
373+
source ${HOME}/.bashrc
374+
exit
375+
;;
363376
c)
364377
if [[ ${OPTARG,,} = "gcc" ]]; then
365378
CXX="g++"
@@ -626,13 +639,7 @@ install_polaris
626639

627640
# compile and install PolarisTools if available
628641
if [[ -d "tools" ]]; then
629-
# go to PolarisTools dir
630-
cd "tools/"
631-
632-
# compile and install PolarisTools
633-
python3 setup.py install --user &>/dev/null \
634-
&& { echo -e "Compile and installing PolarisTools [${GREEN}done${NC}]"; echo ""; } \
635-
|| { echo -e "Compile and installing PolarisTools [${RED}Error${NC}]"; exit 1; }
642+
install_polaristools
636643

637644
# set POLARISTOOLS_PATH as environment variable
638645
set_envvar_TOOLS_str="export POLARISTOOLS_PATH=\"$HOME/.local/bin\""

quickstart.pdf

2.06 KB
Binary file not shown.

0 commit comments

Comments
 (0)