-
Notifications
You must be signed in to change notification settings - Fork 6
/
install-SIA-dependencies.sh
64 lines (47 loc) · 1.7 KB
/
install-SIA-dependencies.sh
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
#!/bin/bash
# Make sure python3 is installed
if ! command -v python3 &> /dev/null
then
echo -e "\e[1;31minstallation failed: python3 could not be found."
echo -e "Make sure python3 is installed and in your PATH.\e[0m"
exit
fi
# Make sure pip3 is installed
if ! command -v pip3 &> /dev/null
then
echo -e "\e[1;31minstallation failed: pip3 could not be found."
echo -e "Make sure pip3 is installed.\e[0m"
exit
fi
# Pip install the necessary python python3 packages
pip3 install matplotlib numpy astropy photutils scipy
# Install wcstools 3.9.6 if not already installed
if [ ! -d "/usr/local/wcstools-3.9.6" ]
then
# Download wcstools 3.9.6 from the internet
sudo curl http://tdc-www.harvard.edu/software/wcstools/wcstools-3.9.6.tar.gz -o /usr/local/wcstools-3.9.6.tar.gz
cd /usr/local/
# Expand the download
sudo tar -xf wcstools-3.9.6.tar.gz -C /usr/local/
# Remove the archived version of wcstools
sudo rm wcstools-3.9.6.tar.gz
cd wcstools-3.9.6/
# Compile the wcstools stuff
sudo make all
fi
# Add wcstools to PATH if not already there
if ! grep -c "export PATH=\$PATH:/usr/local/wcstools-3.9.6/bin" ~/.bashrc
then
echo "export PATH=\$PATH:/usr/local/wcstools-3.9.6/bin" >> ~/.bashrc
fi
if ! grep -c "export PATH=\$PATH:/usr/local/wcstools-3.9.6/bin" ~/.zshrc
then
echo "export PATH=\$PATH:/usr/local/wcstools-3.9.6/bin" >> ~/.zshrc
fi
echo -e "\e[1;31m"
echo "RESTART YOUR TERMINAL/SHELL BEFORE RUNNING SIA!"
echo "If you do not restart your terminal before running, SIA will not work"
echo "If you still have issues after restarting, enter"
echo "'source ~/.bashrc' or 'source ~/.zshrc' depending on your shell."
echo "Then try to run SIA again."
echo -e "\e[0m"