def MakeGRBIndex(collected_grb_dict, html_path='/home/amorgan/www/swift'): '''Takes a collected dictionary from CollectGRBInfo and creates an index html page for all the GRBs ''' update_time = time.ctime(time.time()) html_block = MakeGRBTable(collected_grb_dict, incl_files=['reg_path', 'fc_path'], incl_keys=['z_man_best', 'Q_hat'], table_columns=('GRB', 'Region File', 'Finding Chart', 'z', 'Q_hat')) # set create_folder to false since we want this remaining in the base directory grbind = qHTML.qHTML("Swift GRB Pages", html_path, create_folder=False) grbind.sidebar = '' grbind.create_header(title="Swift GRB Pages") footer_content = ''' This page is updated automatically as more information arrives.<br> Last Updated: %s <P> <ADDRESS> Adam N. Morgan ([email protected])</ADDRESS> </center> </html> ''' % (update_time) grbind.create_footer(footer_content) grbind.add_plain_html(html_block) grbind.export_html()
def RemakeIndex(self): title = "RATE GRB-z" sidetitle = "Random forest Automated Triage Estimator for GRB Redshifts" logopath = "rategrbzlogoc_300.png" inst = qHTML.qHTML("rategrbz", self.basedir, create_folder=True, linklist=self.linklist) inst.create_header(title=title) inst.create_sidebar(logo_url=logopath) inst.create_footer() introcontent = ''' <p> As the discovery rate of potentially interesting transients dwarfs the available resources with which to perform follow-up observations, it becomes necessary to have tools to inform whether or not to spend resources on each new event. </p> <p> We have developed the Random forest Automated Triage Estimator for GRB redshifts (RATE GRB-z) to assist in rapidly identifying high-redshift (<i>z</i> > 4) candidates using early-time metrics from the three telescopes onboard <i>Swift</i>. </p> <p> <strong>The method reduces this decision of whether or not to follow-up a new GRB to a single parameter: <i>Q</i>_hat. If a user wishes to devote 20% of telescope observing time to chasing high-<i>z</i> GRB candidates, then we recommend follow-up for all events with <i>Q</i>_hat < 0.2. </p></strong> <p> See <a class="page_link" href="./howitworks.html"><span>How it Works</span></a> for more information on the methodology and expected performance metrics, or read <a class="page_link" href="http://arxiv.org/abs/1112.3654"><span>the paper</span></a> for the full details. The latest available predictions are shown below, and real-time alerts are available by subscribing to our <a class="page_link" href="http://swift.qmorgan.com/rss.xml"><span>RSS Feed</span></a>. We also provide our data products for all past <a class="page_link" href="http://swift.qmorgan.com"><i>Swift</i> GRBs</a>. We welcome questions/comments/suggestions: please <a class="page_link" href="./ratecontact.html"><span>contact us</span></a>. </p> ''' inst.add_post(title="Introduction", content=introcontent) db = LoadDB.LoadDB("GRB_full") GRB_table_html = GRBHTML.MakeGRBTable(db.dict, base_path="../swift/", maxlength=15) inst.add_post(title="Predictions for Latest GRBs", content=GRB_table_html) update_time = time.ctime(time.time()) footer_content = ''' This page is updated automatically as more information arrives.<br> Last Updated: %s <P> <ADDRESS> Adam N. Morgan ([email protected])</ADDRESS> </center> </html> ''' % (update_time) inst.create_footer(footer_content) inst.export_html()
def __init__(self,triggerid,base_dir): self.base_dir = base_dir if not os.path.exists(base_dir): print "Output Directory %s does not exist. Exiting" % (base_dir) sys.exit(1) self.qHTML = qHTML.qHTML(triggerid,base_dir) self.triggerid = triggerid self.qHTML.create_folder() title = "Swift Trigger %s" % str(self.triggerid) self.qHTML.create_header(title=title) self.successful_export = False
def __init__(self, triggerid, base_dir): self.base_dir = base_dir if not os.path.exists(base_dir): print "Output Directory %s does not exist. Exiting" % (base_dir) sys.exit(1) self.qHTML = qHTML.qHTML(triggerid, base_dir) self.triggerid = triggerid self.qHTML.create_folder() title = "Swift Trigger %s" % str(self.triggerid) self.qHTML.create_header(title=title) self.successful_export = False
def RemakeIndex(self): title = "RATE GRB-z" sidetitle = "Random forest Automated Triage Estimator for GRB Redshifts" logopath = "rategrbzlogoc_300.png" inst = qHTML.qHTML("rategrbz",self.basedir,create_folder=True,linklist=self.linklist) inst.create_header(title=title) inst.create_sidebar(logo_url=logopath) inst.create_footer() introcontent = ''' <p> As the discovery rate of potentially interesting transients dwarfs the available resources with which to perform follow-up observations, it becomes necessary to have tools to inform whether or not to spend resources on each new event. </p> <p> We have developed the Random forest Automated Triage Estimator for GRB redshifts (RATE GRB-z) to assist in rapidly identifying high-redshift (<i>z</i> > 4) candidates using early-time metrics from the three telescopes onboard <i>Swift</i>. </p> <p> <strong>The method reduces this decision of whether or not to follow-up a new GRB to a single parameter: <i>Q</i>_hat. If a user wishes to devote 20% of telescope observing time to chasing high-<i>z</i> GRB candidates, then we recommend follow-up for all events with <i>Q</i>_hat < 0.2. </p></strong> <p> See <a class="page_link" href="./howitworks.html"><span>How it Works</span></a> for more information on the methodology and expected performance metrics, or read <a class="page_link" href="http://arxiv.org/abs/1112.3654"><span>the paper</span></a> for the full details. The latest available predictions are shown below, and real-time alerts are available by subscribing to our <a class="page_link" href="http://swift.qmorgan.com/rss.xml"><span>RSS Feed</span></a>. We also provide our data products for all past <a class="page_link" href="http://swift.qmorgan.com"><i>Swift</i> GRBs</a>. We welcome questions/comments/suggestions: please <a class="page_link" href="./ratecontact.html"><span>contact us</span></a>. </p> ''' inst.add_post(title="Introduction",content=introcontent) db = LoadDB.LoadDB("GRB_full") GRB_table_html = GRBHTML.MakeGRBTable(db.dict,base_path="../swift/",maxlength=15) inst.add_post(title="Predictions for Latest GRBs",content = GRB_table_html) update_time = time.ctime(time.time()) footer_content = ''' This page is updated automatically as more information arrives.<br> Last Updated: %s <P> <ADDRESS> Adam N. Morgan ([email protected])</ADDRESS> </center> </html> ''' % (update_time) inst.create_footer(footer_content) inst.export_html()
def MakeGRBIndex(collected_grb_dict,html_path='/home/amorgan/www/swift'): '''Takes a collected dictionary from CollectGRBInfo and creates an index html page for all the GRBs ''' update_time = time.ctime(time.time()) html_block = MakeGRBTable(collected_grb_dict,incl_files=['reg_path','fc_path'], incl_keys=['z_man_best','Q_hat'],table_columns=('GRB','Region File','Finding Chart','z','Q_hat')) # set create_folder to false since we want this remaining in the base directory grbind = qHTML.qHTML("Swift GRB Pages",html_path,create_folder=False) grbind.sidebar = '' grbind.create_header(title="Swift GRB Pages") footer_content = ''' This page is updated automatically as more information arrives.<br> Last Updated: %s <P> <ADDRESS> Adam N. Morgan ([email protected])</ADDRESS> </center> </html> ''' % (update_time) grbind.create_footer(footer_content) grbind.add_plain_html(html_block) grbind.export_html()