source: MML/trunk/machine/THOMX/common/archiving/arplot.m @ 5

Last change on this file since 5 was 5, checked in by zhangj, 10 years ago

ThomX MML version on the LAL server @ 17/12/2013

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1function arplot(varargin)
2%ARPLOT - Read data from archiving database
3%
4%  INPUTS
5%  1. attribute name
6%  2. starting date {now - 1 hour}
7%  3. endind date {now}
8%  4. {'HDB'} or 'TDB' : select database
9%
10%  EXAMPLES
11%
12%  1. read and plot all dose for the 10 hours
13%      arplot('CIGdose')
14%  2. read and plot all dose between two dates
15%     arplot('CIGrate', [], '30-09-2005 03:21:02', '30-09-2005 9:21:00')
16%  3. read and plot for moniteur 1 and 4 in list see afterwards
17%     arplot('CIGrate', [1;4], '30-09-2005 03:21:02', '30-09-2005 9:21:00')
18%
19% See also arread
20
21% LIN/RP/CIG.001
22% LT1/RP/CIG.002
23% BOO-C21/RP/CIG.003
24% BOO-C04/RP/CIG.004
25% BOO-C16/RP/CIG.007
26% BOO-C13/RP/CIG.009
27% BOO-C16/RP/CIG.010
28% BOO-C16/RP/CIG.011
29% BOO-C01/RP/CIG.012
30% BOO-C12/RP/CIG.026
31% BOO-C13/RP/CIG.027
32% BOO-C14/RP/CIG.028
33% BOO-C15/RP/CIG.029
34% BOO-C16/RP/CIG.030
35%
36
37
38% TODO: convertion to Physics units in 'Physics' asked
39%       extract the attribute display units       
40%  To be used
41%  rep = uigetdate
42%  datestr(rep, 'dd-mm-yyyy HH:MM:SS')
43
44%
45% Written by Laurent S. Nadolski
46
47%% Ask for data
48if nargin == 0
49    fprintf('Provide input argument')
50    help arplot; return;
51end
52
53Data = arread(varargin{:});
54
55if (isnumeric(Data.ardata) && Data == -1) || (~isstruct(Data.ardata) && Data == -1) ...
56        || isempty(Data.ardata(1).dvalue)
57    disp('No data available')
58    return;
59end
60
61% Format for time conversion
62%formatstr0 = 'yyyy-mm-dd HH:MM:SS';
63% formatstr0 = 'dd-mm-yyyy HH:MM:SS';
64%formatstr0 = 'dd-mmm-yyyy HH:MM:SS';
65formatstr = 'HH:MM';
66
67figure
68h = newplot;
69% set size
70set(gcf,'Position',[80 320 1200 620])
71xlabel('Time')
72ylabel('Attribut [Harware unit]');
73hold on;
74grid on;
75
76for ik = 1:length(Data.TangoNames)
77    % Time conversion
78%      val_date = datenum(datestr(Data.ardata(ik).svalue), formatstr0);
79     val_date = Data.ardata(ik).svalue;
80     plot(h,val_date,Data.ardata(ik).dvalue,'.-','Color',nxtcolor);
81     datetick('x',formatstr);
82end
83
84datalabel on;
85
86title(['Data extracted from ', Data.database, ' database']);
87legend(Data.TangoNames,'Location','EastOutside');
88addlabel(1,0,['Starting Date : ',datestr(val_date(1),21),'  Ending Date : ', datestr(val_date(end),21)]);
89   
Note: See TracBrowser for help on using the repository browser.