#!/usr/bin/ksh
#
## list_probe_l0.ksh
##
## Make file lists of probe l0 files.
##

## Set the environment variables
#
  if [[ -z $THMSOC ]]
  then
    THMSOC=/disks/socware/thmsoc_dp_current
    export THMSOC
  fi
. /home/thmsoc/gaia2_test/soc_it_to_me.config
#  . ${THMSOC}/src/config/soc_it_to_me.config

## Process sites
#
	for probe in $(cat ${CONFIGDIR}/probe_list.txt)
	do
		for apid in $(cat ${CONFIGDIR}/probe_apid_list.txt)
		do
			rm -f ${LOCAL}/${probe}_l0_list_${apid}.txt
			find /disks/themisdata/${probe}/l0/20* -name ${probe}_l0_${apid}_\*pkt -exec /bin/basename {} \; |sort >> ${LOCAL}/${probe}_l0_list_${apid}.txt
			mv -f ${LOCAL}/${probe}_l0_list_${apid}.txt ${FILELISTS}/${probe}_l0_list_${apid}.txt
		done
	done

exit 0
