#!/bin/bash

export rootdir=${HOME}/spitzer/swire/swire-sdss/hsc/sql-queries/

echo "-- HSC PDR1 UDEEP query --" > ${rootdir}/hsc-pdr1-udeep.sql

echo "-- HSC PDR1 DEEP query --" > ${rootdir}/hsc-pdr1-deep.sql

echo "-- HSC PDR1 WIDE query --" > ${rootdir}//hsc-pdr1-wide.sql
  
for i in cosmos sxds elais_n1 xmm_lss deep2_3 aegis gama09h gama15h wide12h hectomap vvds

do

case "$i" in
'cosmos')
    survey=( udeep deep );	
    ;;
'sxds')
    survey=( udeep deep );
    ;;
'elais_n1')
    survey=( deep );
    ;;
'xmm_lss')
    survey=( deep wide );
    ;;
'deep2_3')
    survey=( wide );
    ;;
'eigis')
    survey=( wide );
    ;;
'gama09h')
    survey=( wide );
    ;;
'gama15h')
    survey=( wide );
    ;;
'wide12h')
    survey=( wide );
    ;;
'hectomap')
    survey=( wide );
    ;;
'vvds')
    survey=( wide );
    ;;
esac
echo ${i} ${survey[@]} 

source make-hsc-pdr1-udeep-query.bash;
source make-hsc-pdr1-deep-query.bash;
source make-hsc-pdr1-wide-query.bash


done
