Пример #1
0
 def testReadConfig(self):
     """Check that new config is added but old retained"""
     # check that unlisted device is not in config
     self.assertFalse(pyfusion.config.pf_has_section('Device', self.unlisted_device))
     self.assertTrue(pyfusion.config.pf_has_section('Device', self.listed_device))
     # create a simple file in memory
     tmp_config = StringIO.StringIO("[Device:%s]\n"
                                    %(self.unlisted_device))
     pyfusion.read_config(tmp_config)
     self.assertTrue(pyfusion.config.pf_has_section('Device', self.unlisted_device))
     self.assertTrue(pyfusion.config.pf_has_section('Device', self.listed_device))
Пример #2
0
 def testReadConfig(self):
     """Check that new config is added but old retained"""
     # check that unlisted device is not in config
     self.assertFalse(
         pyfusion.config.pf_has_section('Device', self.unlisted_device))
     self.assertTrue(
         pyfusion.config.pf_has_section('Device', self.listed_device))
     # create a simple file in memory
     tmp_config = StringIO.StringIO("[Device:%s]\n" %
                                    (self.unlisted_device))
     pyfusion.read_config(tmp_config)
     self.assertTrue(
         pyfusion.config.pf_has_section('Device', self.unlisted_device))
     self.assertTrue(
         pyfusion.config.pf_has_section('Device', self.listed_device))
Пример #3
0
import pyfusion as pf

pf.config.get('global','database')  #  'sqlite:///sqlite.txt'
pf.read_config('shaun_feb_2010.cfg')

from pyfusion.conf.utils import get_config_as_dict
get_config_as_dict('Device','H1')

get_config_as_dict('Diagnostic','H1PoloidalAll')


import pyfusion as pf
h1=pf.getDevice("H1")
data=h1.acq.getdata(70071,'H1ToroidalAxial')
data.meta.keys()
data.plot_signals()

# overlay fs on spectrum
run examples/plot_specgram.py dev_name='LHD' shot_number=27233 hold=0 time_range=[.35,.5] NFFT=256 noverlap=220
run examples/plot_text_pyfusion.py filename='PF2_120229_MP_27233_27233_1_256.dat' hold=1 min_e=0.8 freq_scale=1e3
colorbar();xlim(0.35,.5);ylim(0,150000)

# mode identification overlaid on spectrum - used in LHD report Feb 2012
run examples/plot_specgram.py dev_name='LHD' shot_number=27233 hold=0 time_range=[.35,1.5] NFFT=256 noverlap=220 
clim(-210,-40)
run examples/mode_identify_example_2012.py hold=1 fsfile='PF2_120229_MP_27233_27233_1_256.dat'
xlim(0.35,.5);ylim(0,150000)
xlabel('Time (s)'); ylabel('Frequency (kHz)')

# chirp following example
run examples/plot_text_pyfusion.py filename='PF2_120229_MP_27233_27233_1_256.dat' hold=1 min_e=0.8 freq_scale=1e3 plot=1 time_range=[0.35,.4]