Source code :: Basic Diagnostics
[Return]
[Download]##!/usr/bin/python2
## -*- coding: utf-8 -*-
<%page args="shot, page"/>
<% base = 'http://golem.fjfi.cvut.cz/operation/shots/'
from pygolem import Shot, set_backend, change_data_root
from pygolem.config import TororoidalMagneticFieldTrigger, TororoidalMagneticFieldCapacitorValue, CurrentDriveElectricFieldCapacitorValue, StabilizationCapacitorValue, BreakDownElectricFieldCapacitorValue
from pygolem.modules import loadconst, get , emph, cat, Data
import datetime, cStringIO
from pygolem.modules import cat, emph, get_page_paths, make_zoom_image
page_path, base_path, page = get_page_paths(shot, page)
%>
<table >
%try:
<tr valign='top'>
<td>
<h2> Basic parameters:</h2>
<ul>
<li>Chamber pressure p<sub>chamber</sub> : ${ emph( get('pressure_initial', '%.2f'))}-> ${ 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>->
<a href='basicdiagn/graphpresi.svg' rel="lightbox_home" >integrated</a>->
<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> 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")}
${make_zoom_image(".", '/'+base_path + 'basicdiagn/graphpresb' , "", "_home")}
${make_zoom_image(".", '/'+base_path + 'basicdiagn/graphpresi' , "", "_home")}
${make_zoom_image(".", '/'+base_path + 'basicdiagn/graphpresfull' , "", "_home")}
<h3>Diagnostics:</h3><ul>
<li>Raw data (U<sub>loop</sub>,B<sub>t</sub>,I<sub>p+ch</sub>,U<sub>PhotoC</sub>)<br/>
<a href="${base}${shot}/basicdiagn/usbscopes">${base}${shot}/basicdiagn/usbscopes</a> (tabs & decimal point format)<br/>
<a href="${base}${shot}/basicdiagn/usbscopes_dc">${base}${shot}/basicdiagn/usbscopes_dc</a> (tabs & decimal comma format ... available from No:3553)</li>
<li>Figures:<br/>
raw data: <a href='${base}${shot}/basicdiagn/graphpresb.png'>${base}${shot}/basicdiagn/graphpresb.png</a><br/>
integrated data (I<sub>ch+p</sub>): <a href='${base}${shot}/basicdiagn/graphpresi.png'>${base}${shot}/basicdiagn/graphpresi.png</a><br/>
integrated data (I<sub>p</sub>): <a href='${base}${shot}/basicdiagn/graphpresfull.png'>${base}${shot}/basicdiagn/graphpresb.png</a><br/>
zoomed data: <a href='${base}${shot}/basicdiagn/graphpres.png'>${base}${shot}/basicdiagn/graphpresb.png</a></li>
<li>Extracts (decimal point/comma point format): <br/>
Loop voltage: <t,U<sub>loop</sub>>:${base}${shot}/basicdiagn/(<a href='${base}${shot}/basicdiagn/Uloop_dp.csv'>Uloop_dp.csv</a>/<a href='${base}${shot}/basicdiagn/Uloop_cp.csv'>Uloop_cp.csv</a>)
<br/>
B coil: <t,B<sub>t</sub>>:${base}${shot}/basicdiagn/(<a href='${base}${shot}/basicdiagn/Btoroidal_dp.csv'>Btoroidal_dp.csv</a>/<a href='${base}${shot}/basicdiagn/Btoroidal_cp.csv'>Btoroidal_cp.csv</a>)
<br/>
Rogowski coil: <t,I<sub>ch+p</sub>>:${base}${shot}/basicdiagn/(<a href='${base}${shot}/basicdiagn/Irogowski_dp.csv'>Irogowski_dp.csv</a>/<a href='${base}${shot}/basicdiagn/Irogowski_cp.csv'>Irogowski_cp.csv</a>)
<br/>
Rogowski coil: <t,I<sub>p</sub>>:${base}${shot}/basicdiagn/(<a href='${base}${shot}/basicdiagn/Iplasma_dp.csv'>Iplasma_dp.csv</a>/<a href='${base}${shot}/basicdiagn/Iplasma_cp.csv'>Iplasma_cp.csv</a>)
<br/>
Photocell: <t,I<sub>rad</sub>>:${base}${shot}/basicdiagn/(<a href='${base}${shot}/basicdiagn/Photod_dp.csv'>Photod_dp.csv</a>/<a href='${base}${shot}/basicdiagn/Photod_cp.csv'>Photod_cp.csv</a>)
</li></ul>
</ul>
<%
from pygolem.modules import cat, Data
def get_max_width(table, index):
"""Get the maximum width of the given column index"""
return max([len(str(row[index])) for row in table])
def pprint_table(out, table):
"""Prints out a table of data, padded for alignment
@param out: Output stream (file-like object)
@param table: The table to print. A list of lists.
Each row must have the same number of columns. """
col_paddings = []
for i in range(len(table[0])):
col_paddings.append(get_max_width(table, i))
for row in table:
# left col
print >> out, "<td>", row[0].ljust(col_paddings[0] + 1),"</td>"
# rest of the cols
for i in range(1, len(row)):
col = str(row[i]).ljust(col_paddings[i] + 2)
print >> out,"<td>", col,"</td>"
print >> out,'</tr><tr>'
def get_pygolem_list():
Data.data_types
table = []
for i in Data.data_types:
try:
table.append( [Data.data_types[i]['identifier'], Data.data_types[i]['name']])
except:
pass
#out = sys.stdout
out = cStringIO.StringIO()
pprint_table(out, (table))
return out.getvalue()
%>
<h2> List of available data in <a href="http://sourceforge.net/p/pygolem/home/Home/">${emph('Pygolem')}</a> <a href="${base_path}/data_configuration.cfg">[data_configuration.cfg]</a> </h2>
<table>
<tr><td><h4>Identifier</h4></td><td><h4>Description</h4></td></tr>
<tr>
${get_pygolem_list()}
</tr>
</table>[Return]