Skip to content

Commit

Permalink
added checkpoints, optional make light curves, cleaned up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
kherner committed Oct 13, 2021
1 parent 40cef00 commit 1b7cf89
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 475 deletions.
16 changes: 1 addition & 15 deletions WholeHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ def WholeHTML(MLScoreFake,RADEC,season,masterTableInfo, outdir):
config = ConfigParser.ConfigParser()
if os.path.isfile('./postproc_'+season+'.ini'):
inifile = config.read('./postproc_'+season+'.ini')[0]
triggerid=config.get('general','triggerid')

MajorPlots=['<!DOCTYPE HTML>\n','<html>\n','<link rel="stylesheet" type="text/css" href="../masterHTMLCSS.css">','<body>','<button onclick="topFunction()" id="myBtn" title="Go to top"><img id ="button" src="Arrow.png"></button>','<h1>Season '+season+'</h1>','<p><a id = "Dillion" href="http://des-ops.fnal.gov:8080/desgw/Triggers/'+triggerid+'/'+triggerid+'_trigger.html"><p></p>LIGO GW Triggers<p>DESGW EM Followup</p></a></p>','<div id="majorPlots">','<span title="Fakes: ML Score">','<img src='+MLScoreFake+' width="583" height="350"></span>','<span title="RA and DEC Plot">','<img src ='+RADEC+' width"583" height="350"></span></div>','<ul>']
MajorPlots=['<!DOCTYPE HTML>\n','<html>\n','<link rel="stylesheet" type="text/css" href="../masterHTMLCSS.css">','<body>','<button onclick="topFunction()" id="myBtn" title="Go to top"><img id ="button" src="Arrow.png"></button>','<h1>Season '+season+'</h1>','<div id="majorPlots">','<span title="Fakes: ML Score">','<img src='+MLScoreFake+' width="583" height="350"></span>','<span title="RA and DEC Plot">','<img src ='+RADEC+' width"583" height="350"></span></div>','<ul>']
masterHTML=open('masterHTML'+season+'.html','w+')
for line in MajorPlots:
masterHTML.write(line)
Expand Down Expand Up @@ -51,7 +50,6 @@ def WholeHTML(MLScoreFake,RADEC,season,masterTableInfo, outdir):
check = 0.
check2 = 0.
check3 = 0.
print("AG OUTDIR", outdir)
for index, row in masterdf.iterrows():
check += 1.0
snid = int(row['snid'])
Expand Down Expand Up @@ -128,16 +126,4 @@ def WholeHTML(MLScoreFake,RADEC,season,masterTableInfo, outdir):
masterHTML.write(line)
masterHTML.close()

# statusLines=['<a id="status" href="statusPage'+season+'.html"><font size="10">Status Page</font></a>','</body>','</html>']
# masterHTML=open('masterHTML'+season+'.html','a')
# masterHTML.write(statusLines[0])
# masterHTML.write(statusLines[1])
# masterHTML.close()

# os.system('scp masterHTML'+season+'.html [email protected]:/des_web/www/html/desgw/post-processing-all/')
# os.system('scp PostProc_statusPage'+str(season)+'.html [email protected]:/des_web/www/html/desgw/post-processing-all/')
# os.system('scp theProtoATC_'+str(season)+'*.html [email protected]:/des_web/www/html/desgw/post-processing-all/')
print("check 1",check)
print("check 2", check2)
print("check 3", check3)
return 'Functional'
12 changes: 3 additions & 9 deletions makePlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import fnmatch
import configparser

def MakeDaPlots(season,ccddf,master,truthplus,fitsname,expnums,mjdtrigger,ml_score_cut=0.,skip=False):
def MakeDaPlots(season,master,truthplus,fitsname,expnums,mjdtrigger,ml_score_cut=0.,skip=False):

config = ConfigParser.ConfigParser()
if os.path.isfile('./postproc_'+str(season)+'.ini'):
Expand All @@ -32,7 +32,6 @@ def MakeDaPlots(season,ccddf,master,truthplus,fitsname,expnums,mjdtrigger,ml_sco
statMLS=0
statRADEC=0

#season = os.environ.get('SEASON')
season = str(season)

rootdir = os.environ.get('ROOTDIR')
Expand All @@ -50,9 +49,8 @@ def MakeDaPlots(season,ccddf,master,truthplus,fitsname,expnums,mjdtrigger,ml_sco

df1 = truthplus

outdir = os.path.join(os.environ.get('ROOTDIR2'),'plots')
if not os.path.isdir(outdir):
os.mkdir(outdir)
if not os.path.isdir(str(outdir)+'/plots'):
os.mkdir(outdir+'/plots')

rtable = fitsio.read(fitsname)
rtable = rtable.byteswap().newbyteorder()
Expand Down Expand Up @@ -214,9 +212,5 @@ def MakeDaPlots(season,ccddf,master,truthplus,fitsname,expnums,mjdtrigger,ml_sco
eff=EffName.split('/')[-1]
shutil.copy(EffName,'./'+eff)
print("You have and efficiency plot!")





return stat6,mls,radec
Loading

0 comments on commit 1b7cf89

Please sign in to comment.