Select Git revision
test_fsig.py
Forked from
finesse / pykat
Source project has a limited visibility.
-
Daniel Brown authored
adding in fsig command (not parsing yet). See example test_fsig.py in bin folder. Also made component variable an optional argument for xaxis and x2axis which will break previous scripts. Did this as when setting the parameter to tune, the Param object contains whatever component owns that parameter so no need to pass it twice. Also stops someone passing a parameter not for the component stated.
Daniel Brown authoredadding in fsig command (not parsing yet). See example test_fsig.py in bin folder. Also made component variable an optional argument for xaxis and x2axis which will break previous scripts. Did this as when setting the parameter to tune, the Param object contains whatever component owns that parameter so no need to pass it twice. Also stops someone passing a parameter not for the component stated.
FT_example2.m 1.29 KiB
clear all;
% name of kat file which contains 'blocks'
inname='testblock.kat';
% name of file that we will create now from this script
katname='mytest.kat';
% read in block from testblock.kat
block=FT_read_blocks_from_file(inname);
% now selectively copy some blocks from the list 'block' over
% into the list 'outbl'.
% we can access the block usually by name or by index:
outbl(1)=FT_copy_block(block,2); %second block is the 'laser'
outbl(2)=FT_copy_block(block,'cavity');
outbl(3)=FT_copy_block(block,'detection');
% create a new block by hand, containing just an xaxis command
outbl(4)=FT_create_new_block('command1');
outbl(4)=FT_add_line_to_block(outbl(4),'xaxis m1 phi lin 0 10 100');
% write all blocks from list 'outbl' to file 'mytest.kat'
FT_write_blocks_into_file(outbl,katname);
% BTW we can also delete from the block
% e.g. this finds all lines containing an 'm'
xxx=FT_find_text_in_block(outbl(2),'m');
% and now we delete them
outbl(2)=FT_remove_lines_from_block(outbl(2),xxx);
% the following is the same as in FT_example1.m
% initialise Finesse
FT=FT_create_new_FT();
FT=FT_check_for_kat_binary(FT);
% run Finese and read data
Run1=FT_create_new_kat_run();
Run1.filename=katname;
Run1=FT_run_kat_simulation(FT,Run1);
% plot data
plot(Run1.x,Run1.y)
% clean directory again
%FT_kat_clean(Run1);