Source code :: home

[Return]
[Download]##!/usr/bin/python2 ## -*- coding: utf-8 -*- <%! import os, re, datetime from bottle import static_file from pygolem.modules import cat, Data, get, loadconst , emph, modified, make_zoom_image, get_page_paths from os.path import split, exists from pygolem.config import TororoidalMagneticFieldTrigger, TororoidalMagneticFieldCapacitorValue, CurrentDriveElectricFieldCapacitorValue, StabilizationCapacitorValue, BreakDownElectricFieldCapacitorValue import datetime %> <%page args="shot, page"/> <% page_path, base_path, page = get_page_paths(shot, page) def make_menu(base, levels): page_list = [] paths = sorted([ base + '/' + i for i in os.listdir(base_path + base) ]) for path in paths: if levels == 1: page_list.append([ split(path)[0] , split(path)[-1]]) elif levels == 2: for item in os.listdir(base_path + path): page_list.append([ path , item]) i = 0 for page in page_list: make_item(page[0], page[1]) i += 1 if i > 4: # split row if it is too long !!! newline() i = 0 %> <%def name="newline()"> </tr><tr> </%def> <%def name="make_item(path, item)"> <% path = path+'/'+item+'/' # remove names, dates, initials name = re.sub('(\d+)([a-zA-Z\ ]+)([_\.\w]+)', r'\2', item) name = re.sub('([\w]+)/([a-zA-Z\ ]+)', r'\2', name) %> <td valign="bottom"> <a href='${path}'> \ % if exists(base_path + path + 'icon.png'): <img src='${path}/icon.png' width="150px"/><br/>\ % else: <img src='/_static/failed.png'/><br/>\ % endif <center>${name}</center> </a> </td> </%def> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field"><th class="field-name">Date:</th><td class="field-body"> \ ${ modified(base_path + '/ShotNo') } \ - <b> ${cat(base_path + "/starttime")} </td> </tr> <tr class="field"><th class="field-name">Session:</th><td class="field-body">\ <a href='http://golem.fjfi.cvut.cz/tasks/${cat(base_path + "/SessionNameDate")}'>\ ${cat(base_path + "/SessionName")}</a> </td> </tr> <tr class="field"><th class="field-name">Comment:</th><td class="field-body"><b>\ ${ emph(cat(base_path+'wwwcomment') )}</b></td> </tr> </tbody> </table> <table > %try: <tr valign='top'> <td> <h2>&nbsp;&nbsp;&nbsp;&nbsp;Basic parameters:</h2> <ul> <li>Chamber pressure p<sub>chamber</sub> : ${ emph( get('pressure_initial', '%.2f'))}-&gt; ${ emph( get('pressure', '%.2f'))} mPa (request: ${ get('pressure_request', '%i')} mPa) </li> <li>Chamber temperature: ${get('chamber_temperature', '%.2f')} C</li> <li>C<sub>B<sub>t</sub></sub> capacitors ( ${TororoidalMagneticFieldCapacitorValue} mF) charged to: ${emph('%i V'%get('Ub'))}, \ triggered ${emph('%.1f ms'% (TororoidalMagneticFieldTrigger*1e3))}</li> <li>C<sub>BD</sub> capacitors (${BreakDownElectricFieldCapacitorValue} mF) charged to: ${emph(get('Ubd', '%i V'))}, triggered \ ${emph('%.1f ms'% ((get('Tbd'))/1e3+TororoidalMagneticFieldTrigger*1e3))}\ </li> <li>C<sub>CD</sub> capacitors (${CurrentDriveElectricFieldCapacitorValue} mF) charged to: ${emph(get('Ucd', '%i V'))}, triggered \ ${emph('%.1f ms'% ((get('Tcd'))/1e3+TororoidalMagneticFieldTrigger*1e3))}\ </li> <li>C<sub>ST</sub> capacitors (${StabilizationCapacitorValue} mF) charged to: ${emph(get('Ust', '%i V'))}, triggered \ ${ emph('%.1f ms'% ((get('Tst'))/1e3+TororoidalMagneticFieldTrigger*1e3))}\ </li> <li>Time since <a href=chamber.jpg>session</a> beginning: ${str(datetime.timedelta(seconds=int(get('time'))))} h</li> </ul> <ul> <li><a href='basicdiagn/usbscopes'>Raw data (U<sub>loop</sub>,B<sub>t</sub>,I<sub>p+ch</sub>,U<sub>PhotoC</sub>)</a></li> <li>DAS data processing evolution: <a href='basicdiagn/graphpresb.svg' rel="lightbox_home" >raw</a>-&gt; <a href='basicdiagn/graphpresi.svg' rel="lightbox_home" >integrated</a>-&gt; <a href='basicdiagn/graphpresfull.svg' rel="lightbox_home" >final</a></li> <li><a href="analysis/Basics/0411ShotHomepage.ONN/"/>Accessing data</a></li> </ul> </td> <td> % if cat(base_path+'basicdiagn/Plasma')[0] == "1": <h2>&nbsp;&nbsp;&nbsp;&nbsp;Plasma parameters:</h2> <ul> <li>Plasma life time <b> ${get('plasma_life', '%.1f')} </b> [ms] (from ${ get('plasma_start', '%.1f')} to ${get('plasma_end', '%.1f')}) </li> <li>Mean toroidal magnetic field Bt: ${get('toroidal_field_mean', '%.2f')} T</li> <li>Mean plasma current: ${ get('plasma_current_mean', '%.2f')} kA</li> <li>Mean Uloop: ${get('loop_voltage_mean', '%.2f')} V</li> <li>Break down voltage: ${get('breakdown_voltage', '%.1f') } V <li>Ohmic heating power: ${get('input_power', '%.2f')} kW</li> <li><a href='analysis/Basics/0612AdvancedAnalysis.ONN/'>Q edge: ${get('Q95_mean', '%.1f')} </a></li> <li>Central electron temperature: ${ emph( get('temperature_mean', '%.1f eV'))} </li> </ul> %endif </td> </tr> %except: <h2> Parameters loading failed </h2> %endtry </table> ${make_zoom_image(base_path, 'basicdiagn/graphpres' , "", "_home")} <h2>DAS:</h2> <table> <tr> <% make_menu('DAS', 1) %> </tr> </table> <h2>Diagnostics: <a href='http://golem.fjfi.cvut.cz/support/das.jpg'>(configuration)</a> </h2> <table> <tr> <%make_menu('diagnostics', 2) %> </tr> </table> <h2>Analysis:</h2> <table> <tr> <%make_menu('analysis', 2) %> </tr> </table> <h2> Acknowledgement: </h2> <table cellpadding="5"> <tr> <td valign='middle' align='center' > <div style="display:table-cell; vertical-align:middle"> <a href=http://www.fusenet.eu><img src=http://golem.fjfi.cvut.cz/images/fusenet_logo.png width=150px></a> </td> <td valign='middle'> <a href=http://jaderka.cz><img src=http://golem.fjfi.cvut.cz/images/fjfi_logo.thumbnail.png width=100px></a> </td> </tr> </table> <hr/> Thanks to the specific help <span style="display:inline-block; vertical-align:middle"> <a href=http://www.ni.com/><img src=http://golem.fjfi.cvut.cz/images/NIOfficialLogo.JPG width=150px></a> </span> and <span style="display:inline-block; vertical-align:middle"> <a href=http://www.pfeiffer-vacuum.com><img src=http://golem.fjfi.cvut.cz/images/800px-Pfeiffer_Vacuum_Logo.svg.png width=150px></a></span>[Return]

Navigation