Commit eb3a8433 authored by Alexander Dietz's avatar Alexander Dietz
Browse files

Merge branch 'master' of git+ssh://alexander.dietz@ligo-vcs.phys.uwm.edu/usr/local/git/lalsuite

Original: e4887291120033b6709fbf35b53e168fff1db71e
parents 73d36d59 e0221f3e
......@@ -661,13 +661,6 @@ int MAIN( int argc, char *argv[]) {
LAL_CALL( SetUpSFTs( &status, &stackMultiSFT, &stackMultiNoiseWeights, &stackMultiDetStates, &usefulParams), &status);
LogPrintfVerbatim ( LOG_NORMAL, " done.\n");
/* free segment list */
if ( usefulParams.segmentList )
if ( XLALSegListClear( usefulParams.segmentList ) != XLAL_SUCCESS )
XLAL_ERROR ( fn, XLAL_EFUNC );
XLALFree ( usefulParams.segmentList );
usefulParams.segmentList = NULL;
/* some useful params computed by SetUpSFTs */
tStack = usefulParams.tStack;
tObs = usefulParams.tObs;
......@@ -683,15 +676,38 @@ int MAIN( int argc, char *argv[]) {
firstSFT = &(stackMultiSFT.data[0]->data[0]->data[0]); /* use first SFT from first detector */
Tsft = 1.0 / firstSFT->deltaF; /* define the length of an SFT (assuming 1/Tsft resolution) */
/* count the total number of SFTs used */
/* count the total and per-segment number of SFTs used */
UINT4 iTS, nSFTs = 0;
for ( iTS = 0; iTS < nStacks; iTS ++ )
{
UINT4 X;
UINT4 nSFTsInSeg = 0;
for ( X=0; X < stackMultiSFT.data[iTS]->length; X ++ )
nSFTs += stackMultiSFT.data[iTS]->data[X]->length;
nSFTsInSeg += stackMultiSFT.data[iTS]->data[X]->length;
nSFTs += nSFTsInSeg;
/* if we have a segment-list: double-check number of SFTs */
if ( usefulParams.segmentList )
{
/* check the number of SFTs we found in this segment against the nominal value,
* stored in the segment list field 'id' */
UINT4 nSFTsExpected = usefulParams.segmentList->segs[iTS].id;
if ( nSFTsInSeg != nSFTsExpected ) {
XLALPrintError ("%s: Segment list seems inconsistent with data read: segment %d contains %d SFTs, should hold %d SFTs\n", fn, iTS, nSFTsInSeg, nSFTsExpected );
XLAL_ERROR ( fn, XLAL_EDOM );
}
} /* if have segmentList */
} /* for iTS < nStacks */
/* free segment list */
if ( usefulParams.segmentList )
if ( XLALSegListClear( usefulParams.segmentList ) != XLAL_SUCCESS )
XLAL_ERROR ( fn, XLAL_EFUNC );
XLALFree ( usefulParams.segmentList );
usefulParams.segmentList = NULL;
/* special treatment of SFTs if upsampling is used */
if ( uvar_sftUpsampling > 1 )
{
......@@ -2626,13 +2642,7 @@ XLALSetUpStacksFromSegmentList ( const SFTCatalog *catalog, /**< complete list o
} /* while true */
/* check the number of SFTs we found in this segment against the nominal value,
* stored in the segment list field 'id' */
INT4 numSFTsInSeg = iSFT1 - iSFT0 + 1;
if ( numSFTsInSeg != thisSeg->id ) {
XLALPrintError ("%s: Segment list seems inconsistent with data read: segment %d contains %d SFTs, should hold %d SFTs\n", fn, iSeg, numSFTsInSeg, thisSeg->id );
XLAL_ERROR_NULL ( fn, XLAL_EDOM );
}
/* ----- allocate and copy this range of SFTs into the segmented catalog */
stacks->data[iSeg].length = (UINT4)numSFTsInSeg;
......
......@@ -30,7 +30,7 @@ else
fi
SFTdir="TestSFTs"
SFTfiles="$SFTdir${dirsep}*"
SFTfiles="$SFTdir${dirsep}*.sft"
# test if LAL_DATA_PATH has been set ... needed to locate ephemeris-files
if [ -z "$LAL_DATA_PATH" ]; then
......@@ -67,8 +67,9 @@ DeltaSearch=$Delta
skygridfile="tmpskygridfile.dat"
echo $AlphaSearch" "$DeltaSearch > $skygridfile
mfd_FreqBand="2.0"
mfd_fmin=$(echo $Freq $mfd_FreqBand | awk '{printf "%g", $1 - $2 / 2.0}');
mfd_FreqBand=0.20;
mfd_fmin=100;
numFreqBands=4; ## produce 'frequency-split' SFTs used in E@H
gct_FreqBand="0.01"
gct_F1dotBand="2.0e-10"
......@@ -143,33 +144,40 @@ else
rm -f $SFTdir/*;
fi
# construct MFD cmd for H1:
mfd_CL=" --fmin=$mfd_fmin --Band=$mfd_FreqBand --Freq=$Freq --outSFTbname=$SFTdir --f1dot=$f1dot --Alpha=$Alpha --Delta=$Delta --psi=$psi --phi0=$phi0 --h0=$h0 --cosi=$cosi --ephemYear=05-09 --generationMode=1 --timestampsFile=$tsfile --IFO=H1 --refTime=$refTime --Tsft=$Tsft --randSeed=1000"
FreqStep=`echo $mfd_FreqBand $numFreqBands | LC_ALL=C awk '{print $1 / $2}'`
mfd_fBand=`echo $FreqStep $Tsft | LC_ALL=C awk '{print ($1 - 1.5 / $2)}'` ## reduce by 1/2 a bin to avoid including last freq-bins
iFreq=1
while [ "$iFreq" -le "$numFreqBands" ]; do
mfd_fi=`echo $mfd_fmin $iFreq $FreqStep | LC_ALL=C awk '{print $1 + ($2 - 1) * $3}'`
if [ "$haveNoise" = true ]; then
mfd_CL="$mfd_CL --noiseSqrtSh=$sqrtSh";
fi
# construct common MFD cmd
mfd_CL_common=" --fmin=$mfd_fi --Band=${mfd_fBand} --Freq=$Freq --f1dot=$f1dot --Alpha=$Alpha --Delta=$Delta --psi=$psi --phi0=$phi0 --h0=$h0 --cosi=$cosi --ephemYear=05-09 --generationMode=1 --timestampsFile=$tsfile --refTime=$refTime --Tsft=$Tsft --randSeed=1000 --outSingleSFT"
cmdline="$mfd_code $mfd_CL";
echo $cmdline;
if ! eval $cmdline; then
echo "Error.. something failed when running '$mfd_code' ..."
exit 1
fi
if [ "$haveNoise" = true ]; then
mfd_CL_common="$mfd_CL_common --noiseSqrtSh=$sqrtSh";
fi
# construct MFD cmd for L1:
mfd_CL=" --fmin=$mfd_fmin --Band=$mfd_FreqBand --Freq=$Freq --outSFTbname=$SFTdir --f1dot=$f1dot --Alpha=$Alpha --Delta=$Delta --psi=$psi --phi0=$phi0 --h0=$h0 --cosi=$cosi --ephemYear=05-09 --generationMode=1 --timestampsFile=$tsfile --IFO=L1 --refTime=$refTime --Tsft=$Tsft --randSeed=1001"
# for H1:
outName="${SFTdir}${dirsep}H1-${mfd_fi}_${FreqStep}.sft";
cmdline="$mfd_code $mfd_CL_common --IFO=H1 --outSFTbname=${outName}";
echo $cmdline;
if ! eval $cmdline; then
echo "Error.. something failed when running '$mfd_code' ..."
exit 1
fi
if [ "$haveNoise" = true ]; then
mfd_CL="$mfd_CL --noiseSqrtSh=$sqrtSh";
fi
# for L1:
outName="${SFTdir}${dirsep}L1-${mfd_fi}_${FreqStep}.sft";
cmdline="$mfd_code $mfd_CL_common --IFO=L1 --outSFTbname=${outName}";
echo $cmdline;
if ! eval $cmdline; then
echo "Error.. something failed when running '$mfd_code' ..."
exit 1
fi
cmdline="$mfd_code $mfd_CL";
echo $cmdline;
if ! eval $cmdline; then
echo "Error.. something failed when running '$mfd_code' ..."
exit 1
fi
iFreq=$(( $iFreq + 1 ))
done
echo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment