-
Notifications
You must be signed in to change notification settings - Fork 2
/
diffimg_setup.sh
executable file
·135 lines (115 loc) · 5.69 KB
/
diffimg_setup.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
##### edit these lines before running the code:
export ROOTDIR=/pnfs/des/persistent/gw
export ROOTDIR2=$(pwd) #This should just be where you are running /data/des40.b/data/nsherman/postprocBig
#export SEASON=416
#####
source /cvmfs/des.opensciencegrid.org/eeups/startupcachejob31i.sh
#source /cvmfs/des.opensciencegrid.org/ncsa/centos7/finalcut/Y6A1+2/eups/desdm_eups_setup.sh
#for IFDH
export EXPERIMENT=des
#export PATH=${PATH}:/cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/cpn/v1_7/NULL/bin:/cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/ifdhc/v2_1_0/Linux64bit-2-6-2-12/bin
#export PYTHONPATH=/cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/ifdhc/v2_0_8/Linux64bit-2-6-2-12/lib/python:${PYTHONPATH}
export IFDH_NO_PROXY=1
#export IFDHC_LIB=/cvmfs/fermilab.opensciencegrid.org/products/common/prd/ifdhc/v2_1_0/Linux64bit-2-6-2-12/lib
export IFDH_CP_MAXRETRIES=2
#/cvmfs/grid.cern.ch/util/cvmfs-uptodate /cvmfs/des.opensciencegrid.org
#source /cvmfs/des.opensciencegrid.org/2015_Q2/eeups/SL6/eups/desdm_eups_setup.sh
#source /cvmfs/des.opensciencegrid.org/eeups/startup.sh
export EUPS_PATH=/cvmfs/des.opensciencegrid.org/eeups/fnaleups:$EUPS_PATH
#other setups
setup perl 5.18.1+6 # || exit 134
setup finalcut Y6A1+2
#setup Y2Nstack 1.0.6+18
setup diffimg gw8
setup ftools v6.17
export HEADAS=$FTOOLS_DIR
setup autoscan
setup easyaccess
setup extralibs 1.1
setup astropy 0.4.2+6
setup psycopg2 2.4.6+8
setup -j healpy 1.8.1+3
setup -j pandas 0.15.2+3
#setup html
#echo "EUPS setup complete"
export DES_SERVICES=${HOME}/.desservices.ini
export DES_DB_SECTION=db-sn-test
export DIFFIMG_HOST=FNAL
export SCAMP_CATALOG_DIR=$PWD/SNscampCatalog
export AUTOSCAN_PYTHON=$PYTHON_DIR/bin/python
export DES_ROOT=/data/des41.b/data/SNDATA_ROOT/INTERNAL/DES
#export DES_ROOT=/data/des20.b/data/SNDATA_ROOT/INTERNAL/DES
### Add for multi-season processing ###
ARRAY=($(ls postproc_*.ini)) #list of postproc_SEASON.ini files
ELEMENTS=${#ARRAY[@]}
#echo $ELEMENTS
for ((count=0;count<$ELEMENTS;count++))
do
INI=${ARRAY[${count}]}
python getSeason.py --ini $INI
SEASON=`cat getSeason.txt`
export SEASON
export TOPDIR_SNFORCEPHOTO_IMAGES=${ROOTDIR2}/forcephoto/images/dp${SEASON}
export TOPDIR_SNFORCEPHOTO_OUTPUT=${ROOTDIR2}/forcephoto/output/dp${SEASON}
if [ ! -d $TOPDIR_SNFORCEPHOTO_OUTPUT ]; then mkdir -p $TOPDIR_SNFORCEPHOTO_OUTPUT ; fi
###
if [ ! -d $TOPDIR_SNFORCEPHOTO_IMAGES ]; then
mkdir -p $TOPDIR_SNFORCEPHOTO_IMAGES
if [ -d $(echo $ROOTDIR/forcephoto/images/dp${SEASON}) ]; then
for nite in $(ls $ROOTDIR/forcephoto/images/dp${SEASON})
do
mkdir ${TOPDIR_SNFORCEPHOTO_IMAGES}/$(basename $nite)
ln -sf $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*/*.fits $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*/*.psf ${TOPDIR_SNFORCEPHOTO_IMAGES}/$(basename $nite)/
done
fi
fi
done
###----------------------------------------------------------------------###
export TOPDIR_DATAFILES_PUBLIC=${ROOTDIR}/DESSN_PIPELINE/SNFORCE/DATAFILES_TEST
export TOPDIR_WSTEMPLATES=${ROOTDIR}/WSTemplates
export TOPDIR_TEMPLATES=${ROOTDIR}/WSTemplates
export TOPDIR_SNTEMPLATES=${ROOTDIR}/SNTemplates
export TOPDIR_WSRUNS=${ROOTDIR}/data/WSruns
export TOPDIR_SNRUNS=${ROOTDIR}/data/SNruns
# these vars are for the make pair function that we pulled out of makeWSTemplates.sh
TOPDIR_WSDIFF=${TOPDIR_WSTEMPLATES}
DATADIR=${TOPDIR_WSDIFF}/data # DECam_XXXXXX directories
CORNERDIR=${TOPDIR_WSDIFF}/pairs # output XXXXXX.out and XXXXXX-YYYYYY.out
ETCDIR=${DIFFIMG_DIR}/etc # parameter files
CALDIR=${TOPDIR_WSDIFF}/relativeZP # relative zeropoints
MAKETEMPLDIR=${TOPDIR_WSDIFF}/makeTempl # templates are made in here
XY2SKY=${WCSTOOLS_DIR}/bin/xy2sky
AWK=/bin/awk
export PFILES=${PWD}/syspfiles
##mkdir -p $TOPDIR_SNFORCEPHOTO_IMAGES $DES_ROOT $TOPDIR_SNFORCEPHOTO_OUTPUT $TOPDIR_DATAFILES_PUBLIC
export SNANA_DIR=/data/des41.b/data/kessler/snana/snana
export SNDATA_ROOT=/data/des41.b/data/SNDATA_ROOT
## use Ken's development version of the diffimg code:
export DIFFIMG_DIR=/data/des40.b/data/kherner/Diffimg-devel_Sep2021/trunk
#export DIFFIMG_DIR=/data/des40.b/data/kherner/Diffimg-devel/diffimg-trunk/
export PATH=$DIFFIMG_DIR/bin:$PATH
#4-5-18 -- update for database access
if [ -f /home/s1/desgw/connectionInfo.sh ]; then
source /home/s1/desgw/connectionInfo.sh
else
echo `No connectionInfo.sh in home dir. Will not be able to access database`
fi
######ACTUALLY, UNLESS SOMETHING RELATING TO SYMLINKS DOES NOT WORK, IGNORE THIS
###The following should be removed once Adam is fuctional
#if [ ! -d $TOPDIR_SNFORCEPHOTO_OUTPUT ]; then mkdir -p $TOPDIR_SNFORCEPHOTO_OUTPUT ; fi
###
##FORCE PHOTO GOODNESS TO BE UNCOMMENTED WHEN NECESSARY
#if [ ! -d $TOPDIR_SNFORCEPHOTO_IMAGES ]; then
# mkdir -p $TOPDIR_SNFORCEPHOTO_IMAGES
# if [ -d $(echo $ROOTDIR/forcephoto/images/dp${SEASON}) ]; then
# for nite in $(ls $ROOTDIR/forcephoto/images/dp${SEASON})
# do
# mkdir ${TOPDIR_SNFORCEPHOTO_IMAGES}/$(basename $nite)}
# #Backtothebeginning
# THIS IS THE DROID YOU ARE LOOKING FOR (IGNORE THE OTHER 2) #ln -sf $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*/*.fits $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*/*.psf ${TOPDIR_SNFORCEPHOTO_IMAGES}/$(basename $nite)/
# ln -sf $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*.fits $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*.psf ${TOPDIR_SNFORCEPHOTO_IMAGES}/$(basename $nite)/
#
## ln -sf $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*.fits $ROOTDIR/forcephoto/images/dp${SEASON}/${nite}/*.psf ${TOPDIR_SNFORCEPHOTO_IMAGES}/$(basename $nite)/
# done
# fi%%%
# fi