-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgemini-iraf_stack_install.sh
executable file
·158 lines (122 loc) · 3.51 KB
/
gemini-iraf_stack_install.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
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
#!/bin/bash
#
# STACK_INSTALL.SH -- Install the GEMINI software using Anaconda as a base
# system plus additional packages.
export SHELL=/bin/bash
ver="2023.03" # Anaconda Py3.10 base version
base_url="https://repo.anaconda.com/archive/" # Anaconda download repo
function usage {
echo "Usage:"
echo " $(basename $0) [options...]"
echo ""
echo "Options:"
echo " [-h|-?|--help] Display a usage summary"
echo " [--debug] Enable debug output"
echo " [--verbose] Enable verbose output"
exit
}
# =======================================================================
# ----------
# Initialize
# ----------
prefix=`pwd -L`
platform=`uname -m`
os=`uname -s`
if [ "$os" == "Linux" ]; then
arch="Linux"
elif [ "$os" == "Darwin" ]; then
arch="MacOSX"
else
arch="none"
fi
# --------------------
# Process script args.
# --------------------
version=''
_debug=0
_verbose=0
root_dir='/data0'
declare -a userargs skiplist
while [ "$#" -gt 0 ]; do
case $1 in
-h|-\?|--help) usage;;
--debug) _debug=1;;
--verbose) _verbose=1;;
*) userargs=("${userargs[@]}" "${1}");;
esac; shift
done
# ------------------------------------------------------------------------
echo ""
echo "----------------------------------------------"
echo " Downloading base Anaconda3 $ver system ...."
echo "----------------------------------------------"
fname="Anaconda3-${ver}-${arch}-${platform}.sh"
url=${base_url}${fname}
if [ ! -f ./$fname ]; then
curl -o $fname $url
fi
if [ ! -d $prefix/anaconda3 ]; then
mkdir $prefix/anaconda3
fi
chmod 755 $fname
export PWD=$prefix && sh $fname -b -u -p $prefix/anaconda3
# Set the PATH to pick up the new conda install directory.
export PATH=$prefix/anaconda3/bin:$path:/bin:/usr/bin
# Download the latest PIP installer.
#curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
#anaconda3/bin/python get-pip.py
# Update conda and install configs
conda upgrade -n base -c defaults --override-channels -y conda
/bin/rm -f $HOME/.condarc
conda config --add channels conda-forge
conda config --add channels astropy
conda config --add channels http://ssb.stsci.edu/astroconda
conda config --add channels http://astroconda.gemini.edu/public
# ============================================================================
echo "" && echo ""
echo -n "Start: "
/bin/date
echo ""
# ======================
# Anaconda Python 3.10.9
# ======================
echo ""
echo "----------------------------------------------"
echo " Installing Python3 packages ...."
echo "----------------------------------------------"
# ===============
# Conda Installs
# ===============
# ===============
# PIP Installs
# ===============
#pip install --upgrade pip
#pip install setuptools_scm
#pip install numpy
#pip install matplotlib
#pip install healpy
#pip install pandas
#pip install palpy
#pip install scipy
#pip install astropy
#pip install pytables
#pip install h5py
#pip install scikit-learn
#pip install ipython==7.12.0
#pip install jupyterlab==3.1.11
# ------------------------------------------------------------------------
# Install the Pyraf package(s)
conda create -n geminiconda -y python=2.7 gemini stsci iraf-all pyraf-all
# ------------------------------------------------------------------------
# Clean up
if [ ! -d downloads ]; then
mkdir downloads
fi
#mv -f Anaconda*.sh get-pip.py downloads
conda clean -y -a
# Create the local manifest file.
conda list >& MANIFEST
echo "" && echo ""
echo -n "End: "
/bin/date
echo ""