source: MML/trunk/mml/getao.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 896 bytes
Line 
1function  AO = getao(FileName)
2%GETAO - returns the AcceleratorObject (AO)
3%  AO = getao(FileName)
4%
5%  If FileName = 'Archive', then the AO and AD are saved to the
6%                default directory under the data root
7%  If FileName = a string beside 'Archive', then the AO and AD are saved 
8%                to that string name
9
10AO = getappdata(0, 'AcceleratorObjects');
11
12% if isempty(AO)
13%     warning('AcceleratorObject not initialized');
14%     return;
15% end
16
17
18% Archive data structure
19if nargin >= 1
20    if strcmpi(FileName,'archive')
21        AD = getad;
22        DirStart = pwd;
23        FileName = appendtimestamp('AO', clock);
24        DirectoryName = fullfile(getfamilydata('Directory','DataRoot'),'AO\');
25        [DirectoryName, ErrorFlag] = gotodirectory(DirectoryName);
26        save(FileName, 'AO', 'AD');
27        cd(DirStart);
28    else
29        save(FileName, 'AO', 'AD');
30    end
31end
Note: See TracBrowser for help on using the repository browser.