forked from marti-vidal-i/PolConvert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
executable file
·145 lines (73 loc) · 3.57 KB
/
INSTALL
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
INSTRUCTION FOR THE INSTALLATION OF THE STANDALONE POLCONVERT INTERFACE
AND THE CASA 6 INTERFACE.
NOTICE THAT THE USE OF CASA CALIBRATION TABLES ONLY WORKS IN THE CASA
INTERFACE.
STEPS TO INSTALL THE POLCONVERT PACKAGE:
###############################################################
##
0.- Download PolConvert from GitHub:
0.a- Install GIT (e.g., using yum):
yum install git
0.b- Download PolConvert (you may need a GitHub user account):
git clone [email protected]:marti-vidal-i/PolConvert
- ALTERNATIVE: Just go to the GitHub website and download the tarball.
1.- Install the non-standard packages needed for compilation.
These are:
- CFITSIO-DEVEL
- FFTW3-DEVEL
- PYTHON-DEVEL
For instance use yum or apt-get. Example commands:
yum install python3-devel (or "python3-dev")
yum install cfitsio cfitsio-devel (or "libcfitsio-dev")
yum install fftw-devel fftw-doc (or "libfftw-dev" or "libfftw3-dev")
###############
NOTE: STEPS 2 AND 3 ARE NEEDED FOR THE STANDALONE VERSION:
2.- Install miniconda:
2.a- Download the shell installer from
https://docs.conda.io/en/latest/miniconda.html#linux-installers
and follow the instructions (run as YOUR USER; NOT WITH SUDO!).
2.b- Add the conda-forge channel. Just run the command:
conda config --add channels conda-forge
3.- Create a conda environment for polconvert. Run the command:
conda create --name PCONV python=3.9 scipy=1.6.3 numpy=1.20.2 matplotlib=3.4.1
conda activate PCONV
pip install pyfits==3.5 [THIS MAY BE NEEDED IF YOU WANT TO CONVERT FITS-IDI]
###############
4.- Copy the "PolConvert" directory into your favorite program path.
E.g.:
cp -r PolConvert $HOME/MyPrograms/.
(let us suppose that PolConvert is stored in $HOME/MyPrograms)
5.- Add the following lines to your bash profile (or equivalent TC shell):
export PYTHONPATH=$HOME/MyPrograms
export PYTHONPATH=${PYTHONPATH}:${PYTHONPATH}/PolConvert/EU-VGOS
(these lines should come BEFORE any other line involving PYTHONPATH
in your ".bashrc" profile).
Don't forget to run these bash lines before you move to next step.
6.- Compile the program:
6.a- Take a look at the "setup.py" script in the PolConvert directory.
You may need to change the "cfitsio" path defined there.
6.b- Delete any pre-existing *.so files in the PolConvert directory.
6.c- [STANDALONE VERSION] Load the conda environment and compile, i.e.:
conda activate PCONV
python3 setup.py build_ext --inplace
6.d- [CASA VERSION] Compile using the CASA python binary:
export CASABASE=/YOUR/CASA/INSTALLATION/DIRECOTY
$CASABASE/bin/python3 setup.py build_ext --inplace
7.- Import the PolConvert module (either in your script or in the prompt):
7.1- [CASA Interface]:
from PolConvert import polconvert_CASA as PCONV
PCONV.polconvert(IDI="mydata", ...)
7.2- [Standalone Interface (i.e., under the conda environment)]:
from PolConvert import polconvert_standalone as PCONV
PCONV.polconvert(IDI="mydata", ...)
########################
## EU-VGOS CALIBRATION:
8.- Copy the "master_*python3.py" script, located in
PolConvert/EU-VGOS, into a directory where you want to
produce the polconverted data of a given session.
Read the instructions in the script header and good luck.
IMPORTANT NOTES:
1.- You want to use the standalone version for the EU-VGOS
calibration.
2.- You will ALWAYS have to load the PCONV conda
environment before you run PolConvert.