function fig = tsview() % This is the machine-generated representation of a Handle Graphics object % and its children. Note that handle values may change when these objects % are re-created. This may cause problems with any callbacks written to % depend on the value of the handle at the time the object was saved. % % To reopen this object, just type the name of the M-file at the MATLAB % prompt. The M-file and its associated MAT-file must be on your path. load tsview % Generate the list of sites that are needed. d = dir ; % % Get the names of all files in the directory dnames = {d.name}; % get all file names with mb_ in the first three characters dnames = dnames(strncmp(dnames,'mb_',3)); % Now sort the names dnames = sort(dnames)'; % Reduce the names further by getting only the site names j = 0 ; sites = []; for i = 1:length(dnames) tname = cell2struct(dnames(i),'name'); if findstr(tname.name,'.dat1') j = j + 1; st = tname.name; sites = [sites;st(4:11)]; end end % Set root units to pixels and get screen size set(0,'Units','pixels') scnsize = get(0,'ScreenSize'); % Set the border widths of the figure shell bdwidth = 5; topbdwidth = 60; % Set the size of the axis and the space in brtween axisspace = 60; axiswt = (scnsize(3) - 2*bdwidth)*0.7; axisht = (scnsize(4) - topbdwidth - bdwidth - axisspace*3)*0.3; % Compute and set the position and size of the figure shell pos = [bdwidth,... bdwidth,... scnsize(3) - 2*bdwidth,... scnsize(4) - (topbdwidth + bdwidth)]; h0 = figure('Units','pixels', ... 'Color',[0.8 0.8 0.8], ... 'Colormap',mat0, ... 'Position',pos, ... 'Tag','Fig1'); % Compute and set the position and size axis 1 (N component) pos = [bdwidth + scnsize(3)*.25,... bdwidth + axisspace*3 + (axisht)*2,... axiswt,... axisht]; h1 = axes('Parent',h0, ... 'Units','pixels', ... 'CameraUpVector',[0 1 0], ... 'Color',[1 1 1], ... 'ColorOrder',mat1, ... 'Position',pos, ... 'Tag','Axis1', ... 'XColor',[0 0 0], ... 'YColor',[0 0 0], ... 'ZColor',[0 0 0]); % Compute and set the position and size axis 2 (E component) pos = [bdwidth + scnsize(3)*.25,... bdwidth + axisspace*2 + axisht,... axiswt,... axisht]; h2 = axes('Parent',h0, ... 'Units','pixels', ... 'CameraUpVector',[0 1 0], ... 'Color',[1 1 1], ... 'ColorOrder',mat1, ... 'Position',pos, ... 'Tag','Axis2', ... 'XColor',[0 0 0], ... 'YColor',[0 0 0], ... 'ZColor',[0 0 0]); % Compute and set the position and size axis 3 (U component) pos = [bdwidth + scnsize(3)*.25,... bdwidth + axisspace,... axiswt,... axisht]; h3 = axes('Parent',h0, ... 'Units','pixels', ... 'CameraUpVector',[0 1 0], ... 'Color',[1 1 1], ... 'ColorOrder',mat1, ... 'Position',pos, ... 'Tag','Axis3', ... 'XColor',[0 0 0], ... 'YColor',[0 0 0], ... 'ZColor',[0 0 0]); % Compute and set the position and size of the site list box pos = [bdwidth*2,... bdwidth + axisspace,... (scnsize(3) - 2*bdwidth)*0.1,... (scnsize(4) - topbdwidth - bdwidth - axisspace)*0.95]; hs = uicontrol('Parent',h0, ... 'Units','pixels', ... 'BackgroundColor',[1 1 1], ... 'Position',pos, ... 'String',sites, ... 'Style','listbox', ... 'Tag','Listbox1', ... 'Value',1, ... 'UserData',sites) ; % Compute and set the position and size of the gui buttons buttonxpos = bdwidth*6 + (scnsize(3) - 2*bdwidth)*0.1 ; buttonypos = (scnsize(4) - topbdwidth - bdwidth)*0.90 ; buttonx = 80; buttony = 30; %buttonspace = (scnsize(4) - topbdwidth - bdwidth )/8; buttonspace = 30; % Load button pos = [buttonxpos,... (buttonypos),... buttonx,... buttony]; hl = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','gpsgui(''Load'')', ... 'Position',pos, ... 'String','Load', ... 'Tag','Pushbutton1', ... 'TooltipString','Load Selected Data'); % Append button pos = [buttonxpos,... (buttonypos - buttonspace - buttony),... buttonx,... buttony]; ha = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','gpsgui(''Append'')', ... 'Position',pos, ... 'String','Append', ... 'Tag','Pushbutton2', ... 'TooltipString','Append data to current'); % Detrend button pos = [buttonxpos,... (buttonypos - buttonspace*2 - buttony*2),... buttonx,... buttony]; hd = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Position',pos, ... 'Callback','gpsgui(''Detrend'')', ... 'String','Detrend', ... 'Tag','Pushbutton3', ... 'TooltipString','Show detrended data'); % Edit Button pos = [buttonxpos,... (buttonypos - buttonspace*3 - buttony*3),... buttonx,... buttony]; he = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','gpsgui(''Edit'')', ... 'Position',pos, ... 'String','Edit', ... 'Tag','Pushbutton4', ... 'TooltipString','Edit data, Right mouse button allows repeated selection'); % Block Edit button pos = [buttonxpos,... (buttonypos - buttonspace*4 - buttony*4),... buttonx,... buttony]; hb = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','gpsgui(''BlockEdit'')', ... 'Position',pos, ... 'String','Block Edit', ... 'Tag','Pushbutton6', ... 'TooltipString','Select region to edit'); % Break button pos = [buttonxpos,... (buttonypos - buttonspace*5 - buttony*5),... buttonx,... buttony]; hj = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','gpsgui(''Break'')', ... 'Position',pos, ... 'String','Break', ... 'Tag','Pushbutton5',... 'TooltipString','Insert breaks data, Right mouse button allows repeated selection'); % Zoom button pos = [buttonxpos,... buttonypos - buttonspace*6 - buttony*6,... buttonx,... buttony]; hz = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','zoom on', ... 'Position',pos, ... 'String','Zoom', ... 'Tag','ZoomButton', ... 'TooltipString','Turn Zoom on'); % Span button pos = [buttonxpos,... buttonypos - buttonspace*7 - buttony*7,... buttonx,... buttony]; hz = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','gpsgui(''Span'')', ... 'Position',pos, ... 'String','Span', ... 'Tag','Pushbutton7', ... 'TooltipString','Select region to span'); % Save button pos = [buttonxpos,... buttonypos - buttonspace*8 - buttony*8,... buttonx,... buttony]; hz = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Callback','gpsgui(''Save'')', ... 'Position',pos, ... 'String','Save', ... 'Tag','Pushbutton8', ... 'TooltipString','Save edit and break information to a file'); % Maximum size of outliers button pos = [buttonxpos,... buttonypos - buttonspace*9 - buttony*9,... buttonx,... buttony]; hz = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Position',pos, ... 'String','Max Outliers (n sigma)', ... 'Style','text', ... 'Tag','Text1'); pos = [buttonxpos,... buttonypos - buttonspace*10 - buttony*9,... buttonx,... buttony]; hz = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Position',pos, ... 'String',['1 ';'2 ';'3 ';'4 ';'5 ';'all'], ... 'Style','popupmenu', ... 'Tag','PopupMenu1', ... 'TooltipString','Select outlier editing criteria', ... 'Value',6); % Maximum sigma text box pos = [buttonxpos,... buttonypos - buttonspace*11 - buttony*10,... buttonx,... buttony]; hz = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Position',pos, ... 'String','Max Sigma (mm)', ... 'Style','text', ... 'Tag','Text2'); pos = [buttonxpos,... buttonypos - buttonspace*12 - buttony*10,... buttonx,... buttony]; hz = uicontrol('Parent',h0, ... 'Units','pixels', ... 'Position',pos, ... 'HorizontalAlignment','left', ... 'Style','edit', ... 'Tag','EditText1', ... 'TooltipString','Enter sigma editing criteria'); set(hz,'String',sprintf('%6.1f',1000.0)); %hx = uicontrol('Parent',h0, ... % 'Units','pixels', ... % 'Position',[13 16 69 21], ... % 'String',['North';'East ';'Up '], ... % 'Style','popupmenu', ... % 'Tag','PopupMenu1', ... % 'TooltipString','Select North. East or Up', ... % 'Value',1); if nargout > 0, fig = h0; end