Last change
on this file since 18420 was 18420, checked in by Daniela Dorner, 9 years ago |
added (script to check swift schedule for observations of our sources)
|
-
Property svn:executable
set to
*
|
File size:
1.5 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 |
|
---|
4 | sources=( "Mrk 421" "Mkn 421" "1959" "V404" "0323" "Crab" "CRAB" "Mrk 501" "Mkn 501" )
|
---|
5 |
|
---|
6 | dates=(`date +"%Y-%m-%d" --date="-12hour"` `date +%Y-%m-%d --date="+12hour"`)
|
---|
7 |
|
---|
8 | date2=`echo ${dates[0]} | sed -e 's/-/\//g'`
|
---|
9 | schedulepath=/home/factwww/scheduling/$date2
|
---|
10 | schedulefile=$schedulepath/swift.schedule
|
---|
11 | schedulefile2=$schedulepath/swift.schedule.formated
|
---|
12 | schedulefile3=$schedulepath/swift.schedule.txt
|
---|
13 |
|
---|
14 | # Get Swift Data
|
---|
15 | echo "" > $schedulefile
|
---|
16 |
|
---|
17 | #echo "Downloading the schedule for..."
|
---|
18 | for date in ${dates[@]}
|
---|
19 | do
|
---|
20 | #echo " "$date"..."
|
---|
21 | lynx -width 200 -nolist -dump https://www.swift.psu.edu/operations/obsSchedule.php?d=$date | grep $date >> $schedulefile
|
---|
22 | done
|
---|
23 |
|
---|
24 | cat $schedulefile | sed -r -e 's/[0-9]{5}\ \ \ [0-9]{1,3}\ \ \ //' | grep -o -E '^\ \ \ \ 20[1-9][0-9]-[01][0-9]-[0-3][0-9]\ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\ \ \ 20[1-9][0-9]-[01][0-9]-[0-3][0-9]\ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\ \ \ [A-Z1-4]([A-Za-z0-9][\ \.\+\-]?){3,20}' > $schedulefile2
|
---|
25 |
|
---|
26 | #echo ""
|
---|
27 | echo -n "Searched the schedule for the following source names: " >$schedulefile3
|
---|
28 | for (( i=0; i<${#sources[@]}; i++ ))
|
---|
29 | do
|
---|
30 | echo -n ${sources[$i]} >>$schedulefile3
|
---|
31 | i2=`echo " $i + 1" | bc -l`
|
---|
32 | if [ $i2 -lt ${#sources[@]} ]
|
---|
33 | then
|
---|
34 | echo -n ", " >>$schedulefile3
|
---|
35 | else
|
---|
36 | echo "" >>$schedulefile3
|
---|
37 | fi
|
---|
38 | done
|
---|
39 | for (( i=0; i<${#sources[@]}; i++ ))
|
---|
40 | do
|
---|
41 | grep "${sources[$i]}" $schedulefile2 >>$schedulefile3
|
---|
42 | done
|
---|
43 |
|
---|
44 | echo -e "\nThe full schedule can be found <a href='../scheduling/"$date2"/"`basename $schedulefile2`"'>here</a>\n" >>$schedulefile3
|
---|
45 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.