def update_nite_html_gen3(self):
     outhtml = open(
         self.output_dir + '/' + self.nite + '_gen"' + self.gen + '".html',
         'w')
     outhtml.write('<html>\n<head>\n<style>\n')
     outhtml.write(
         'table, th, td {\nborder-collapse: collapse;\nfont-size: 20pt;\n }\n'
     )
     outhtml.write('p {font-size: 20pt;\n }\n')
     outhtml.write('</style>\n')
     outhtml.write('</head>\n<body>\n')
     outhtml.write('<h1>' + self.name +
                   ' Transfer and Ingestion for Nite of ' + self.nite +
                   '</h1>')
     outhtml.write('<p>Last updated: ' + self.nowstr + '</p>\n')
     outhtml.write('<h2>Description</h2>\n')
     outhtml.write(
         '<p>"File Name" is the name of the file transferred to NCSA.<br>\n'
     )
     outhtml.write(
         '"Status" is the result of the most recent ingestion attempt.<br>\n'
     )
     outhtml.write('"File Size" is measured in bytes.<br>\n')
     outhtml.write(
         '"Transfer Path" is the path of the transferred file at NCSA with root '
         + self.storage + '.<br>\n')
     outhtml.write(
         '"Creation Time" is the UTC the file was created (based on Unix ctime).<br>\n'
     )
     outhtml.write('"Transfer Time" is the UTC the file was created.<br>\n')
     outhtml.write(
         '"Ingest Time" is the UTC of the file ingestion at NCSA.<br>\n')
     outhtml.write(
         '"Delta Time 1" is the time (in seconds) between Creation and Transfer to NCSA (approximate transfer time).<br>\n'
     )
     outhtml.write(
         '"Delta Time 2" is the time (in seconds) between Transfer and Ingestion to NCSA (approximate ingest time).<br>\n'
     )
     outhtml.write(
         '"Err Message" is the Error Message from a failed ingestion attempt (if the most recent attempt failed).<br><br>\n'
     )
     outhtml.write(
         db_to_html(self.db, [
             'select Transfer_Path, Status, File_Size, Creation_Time, Transfer_Time, Ingest_Time,  printf("%.1f",(julianday(Transfer_Time)-julianday(Creation_Time))*24*3600.) as Delta_Time_1,  printf("%.1f",(julianday(Ingest_Time)-julianday(Transfer_Time))*24*3600.) as Delta_Time_2, Err_Message from FILE_LIST_GEN"'
             + self.gen + '" where Nite = "' + self.nite +
             '" ORDER BY Creation_Time'
         ]))
     outhtml.write('</body>\n</html>')
     outhtml.close()
 def update_main_html_gen3(self):
     outhtml = open(self.output_dir + '/index_gen"' + self.gen + '".html',
                    'w')
     outhtml.write('<html>\n<head>\n<style>\n')
     outhtml.write(
         'table, th, td {\nborder-collapse: collapse;\nfont-size: 20pt;\n }\n'
     )
     outhtml.write('p {font-size: 20pt;\n }\n')
     outhtml.write('</style>\n')
     outhtml.write('</head>\n<body>\n')
     outhtml.write('<h1>' + self.name + ' Transfer and Ingestion</h1>')
     outhtml.write('<p>Last updated: ' + self.nowstr + '</p>\n')
     outhtml.write('<h2>Description</h2>\n')
     outhtml.write(
         '<p>"Nite Obs" is the observing night (tied to UTC-12).<br>\n')
     outhtml.write(
         '"Last Update" is the most recent UTC time that Nite Obs was checked.<br>\n'
     )
     outhtml.write(
         '"N Files" is the number of files received at NCSA.<br>\n')
     outhtml.write(
         '"Last Creation" is the UTC of the most recent file creation.<br>\n'
     )
     outhtml.write(
         '"Last Transfer" is the UTC of the most recent file creation.<br>\n'
     )
     outhtml.write(
         '"N Ingest" is the number of files successfully ingested at NCSA.<br>\n'
     )
     outhtml.write(
         '"N Not Fits" is the number of uningested files that don\'t end in ".fits".<br>\n'
     )
     outhtml.write(
         '"N Small" is the number of ".fits" files smaller than 10K.<br>\n')
     outhtml.write(
         '"N Error" is the number of uningested ".fits" files that are greater than 10K.<br>\n'
     )
     outhtml.write(
         '"Last Ingest" is the UTC of the most recently file ingest.<br><br>\n'
     )
     outhtml.write(
         db_to_html(self.db,
                    'select * from FILE_COUNT_GEN"' + self.gen +
                    '" ORDER by Nite_Obs DESC',
                    linkify=True,
                    modifier='_gen' + self.gen))
     outhtml.write('</body>\n</html>')
     outhtml.close()
Exemple #3
0
 def update_nite_html(self):
     outhtml = open(self.output_dir + '/' + self.nite + '.html', 'w')
     outhtml.write('<html>\n<head>\n<style>\n')
     outhtml.write(
         'table, th, td {\nborder-collapse: collapse;\nfont-size: 20pt;\n }\n'
     )
     outhtml.write('p {font-size: 20pt;\n }\n')
     outhtml.write('</style>\n')
     outhtml.write('</head>\n<body>\n')
     outhtml.write('<h1>' + self.name +
                   ' Transfer and Ingestion for Nite of ' + self.nite +
                   '</h1>')
     outhtml.write('<p>Last updated: ' + self.nowstr + '</p>\n')
     outhtml.write('<h2>Description</h2>\n')
     outhtml.write(
         '<p>"File Name" is the name of the file transferred to NCSA.<br>\n'
     )
     outhtml.write('"File Size" is measured in bytes.<br>\n')
     outhtml.write(
         '"Transfer Path" is the path of the transferred file at NCSA with root '
         + self.storage + '.<br>\n')
     outhtml.write('"Creation Time" is the UTC the file was created.<br>\n')
     outhtml.write(
         '"Ingest Path" is the path of the transferred file at NCSA with root '
         + self.repo_dir + '.<br>\n')
     outhtml.write(
         '"Ingest Time" is the UTC of the file ingestion at NCSA.<br>\n')
     outhtml.write(
         '"Delta Time" is the time (in seconds) between Creation and ingestion at NCSA (approximate transfer time).<br><br>\n'
     )
     outhtml.write(
         db_to_html(self.db, [
             'select Transfer_Path, File_Size, Creation_Time, "None" as Ingest_Path, "None" as Ingest_Time, 0.0 as Delta_Time from TRANSFER_LIST where FILENUM not in (select FILENUM from Ingest_list) and Nite_Trans = "'
             + self.nite + '" ORDER BY Creation_Time',
             'select Transfer_Path, File_Size, Creation_Time, Ingest_Path, Ingest_Time, printf("%.1f",(julianday(Ingest_Time)-julianday(Creation_Time))*24*3600.) as Delta_Time from Ingest_List i, Transfer_List t where i.FILENUM = t.FILENUM and Nite_Obs = "'
             + self.nite + '" ORDER BY Creation_time'
         ]))
     outhtml.write('</body>\n</html>')
     outhtml.close()
Exemple #4
0
outhtml.write('<html>\n<head>\n<style>\n')
outhtml.write(
    'table, th, td {\nborder-collapse: collapse;\nfont-size: 20pt;\n }\n')
outhtml.write('p {font-size: 20pt;\n }\n')
outhtml.write('</style>\n')
outhtml.write('</head>\n<body>\n')
outhtml.write('<p>Last updated: ' + nowstr + '</p>\n')
outhtml.write('<h1>NCSA/LSST Transfer/Ingestion Summary Page</h1>\n')

for indir in sys.argv[2:]:
    if indir[0] != '/':
        indir = outdir + '/' + indir
    stream = indir.split('/')[-1]
    db = indir + '/observing_monitor.sqlite3'
    outhtml.write('\n<h2><a href="' + stream + '">' + stream + '</a></h2>\n')
    outhtml.write(
        db_to_html(
            db, 'select * from FILE_COUNT where Nite_Obs >= "' + firstnite +
            '" order by Nite_Obs DESC'))

    if os.path.exists(indir + "/index_gen3.html"):
        outhtml.write('\n<h2><a href="' + stream + '/index_gen3.html">' +
                      stream + ' Gen 3</a></h2>\n')
        outhtml.write(
            db_to_html(
                db, 'select * from FILE_COUNT_GEN3 where Nite_Obs >= "' +
                firstnite + '" order by Nite_Obs DESC'))

outhtml.write('</body>\n</html>')
outhtml.close()