Project

General

Profile

Bug #5641

Some MINOS RawData files are declared to SAM with bad Start/End times

Added by Robert Hatcher over 5 years ago.

Status:
New
Priority:
Low
Assignee:
-
Start date:
03/12/2014
Due date:
% Done:

0%

Estimated time:
Duration:

Description

At this time (2014-03-12) 14 NearDet and 261 FarDet files are declared to SAM with timestamps for Start or End that are nonsensical (predate MINOS construction). From context many actually date from 2002 or 2004. It would be good to clean these up.

unset PRODUCTS
source /grid/fermiapp/products/common/etc/setup
setup sam_web_client

BOT="1970-01-01 00:00:00" 
UNIXT=`date +%s -d "${BOT} UTC"`

# SAM times want a "%" in the space between date and time
EARLYT="1990-01-01T00:00:00" 
LATET="2015-01-01T00:00:00" 

let ntot=0
for TIER in raw-beam raw-near raw-far 
do
  # we need explicit "'s around time strings so they're seen as strings
  # and not weird numbers
  SAMWEBFILE=`samweb -e minos list-files "data_tier $TIER and (start_time <= \"${EARLYT}\" or end_time <= \"${EARLYT}\" )"`

  echo "=== TIER $TIER ================================" 
  let n=0
  for AFILE in $SAMWEBFILE
  do
    IFS=@
    META=`samweb -e minos get-metadata $AFILE`
    unset IFS
    ALOT=`echo "$META" | grep "Start Time"  | tr -d ' ' | cut -d: -f2- | tr 'T' ' ' `
    AHIT=`echo "$META" | grep   "End Time"  | tr -d ' ' | cut -d: -f2- | tr 'T' ' ' `
    #enstoreloc=`samweb -e minos locate-file $afile | grep enstore:`
    echo "$AFILE Start $ALOT End $AHIT" 
    let n=${n}+1
  done
  echo "found $n files in this tier" 
  let ntot=${ntot}+${n}
done

echo ===========================================
echo found $n files total



Also available in: Atom PDF