forked from dgary50/eovsa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaily_xsp_batch.py
More file actions
50 lines (45 loc) · 1.47 KB
/
Copy pathdaily_xsp_batch.py
File metadata and controls
50 lines (45 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Name:
# DAILY_XSP_BATCH
# Create daily "all_day" dynamic spectrum plots of EOVSA solar
# cross-correlation data
#
# 2019-02-19 DG
# Batch version written
#
if __name__ == "__main__":
import matplotlib
matplotlib.use("Agg")
import os
try:
user_paths = os.environ['PYTHONPATH'].split(os.pathsep)
except:
user_paths = []
print user_paths
def last_date():
import glob
from util import Time
files = glob.glob('/common/webplots/flaremon/daily/2018/*.png')
files.sort()
date = '2017-12-31 20:00:00'
if files != []:
datstr = files[-1].split('XSP')[1]
date = datstr[:4]+'-'+datstr[4:6]+'-'+datstr[6:8]
return Time(date)
if __name__ == "__main__":
''' For non-interactive use, use a backend that does not require a display
Usage python /common/python/current/daily_xsp.py <date>
If optional argument date is given (as YYYY-MM-DD), data are processed for
that date only.
If the date is omitted, data are processed for the previous two UT days
(yesterday and day-before-yesterday)
'''
import glob, sys
import daily_xsp
from util import Time
t = last_date()
blah = {}
while blah == {}:
mjd = t.mjd
t = Time(mjd+1,format='mjd')
print 'Working on:',t.iso[:19]
blah = daily_xsp.allday_udb(t=t, savfig=True, savfits=True) # Process time t