Пример #1
0
 def sollon_formatter(self, a, b):
     """
     a: ordinal datetime
     b: tick nr 
     Usage: ax.xaxis.set_major_formatter(pylab.FuncFormatter(sollon_formatter)) 
     """
     
     
     # 10 days
     if self._timespan > 10*24*3600:
         fmt = "%.1f"
     # 1 day
     elif self._timespan > 24*3600:
         fmt = "%.2f"
     else:
         fmt = "%.3f"
     
     d = datetime.datetime.fromordinal(int(a))+datetime.timedelta(a-int(a))
     return fmt % common.sollon(d)
Пример #2
0
 def getFluxTable(self, format="html"):
     bins = self._fluxdata.getBins()
     if len(bins) == 0:
         html = "<div>No bins found</div>"
     else:
         """ Take a list of flux bins and produce a nice HTML table """
         html = "<table>\n"
         html += "\t<thead><th>Time<br/>[UT]</th><th>Solarlon<br/>[deg]</th><th>Teff<br/>[h]</th><th>ECA<br/>[10<sup>3</sup>&#183;km<sup>2</sup>&#183;h]</th>"
         html += "<th>n%s</th><th>Flux<br/>[10<sup>-3</sup>&#183;km<sup>-2</sup>&#183;h<sup>-1</sup>]</th><th>ZHR<sup>*</sup></th></thead>\n" % bins['shower']
         for i in range(len(bins['time'])):
             html += "\t<tr>"
             html += "<td>%s</td><td>%.3f</td><td>%.1f</td><td>%.1f</td><td>%d</td><td>%.1f &plusmn; %.1f</td><td>%.0f</td>" \
                 % ( str(bins['time'][i])[0:16], common.sollon(bins['time'][i]), bins['teff'][i]/60.0, bins['eca'][i]/1000.0, bins['met'][i], bins['flux'][i], bins['e_flux'][i], self.flux2zhr(bins['flux'][i], self._fluxdata._popindex) )
             html += "</tr>\n"
         html += "</table>"
         html += "<p style='text-align:center;'>(*) ZHR estimate derived following (<a href='http://adsabs.harvard.edu/abs/1990JIMO...18..119K'>Koschack &amp; Rendtel 1990b, Eqn. 41</a>)</p>"
     
     
     return html