function [ids_equilibrium,ids_equilibrium_description,varargout] = get_ids_equilibrium_fixed_boundary(shot,varargin);
%
%  [ids_equilibrium,ids_equilibrium_description,varargout] = get_ids_equilibrium_fixed_boundary(shot,varargin);
% 
%

ids_equilibrium = struct([]);
ids_equilibrium_description = struct([]);

% initialize input parser
p = inputParser;
% no required inputs here so one can call with empty args and get defaults parameters
% effectively required inputs should have defaults as empty
p.addOptional('shot', [], @(x) isempty(x) || (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer
p.addOptional('empty_struct', -1, @(x) isstruct(x));
p.addOptional('comment', 'default comment', @(x) isempty(x) || ischar(x)); % char

p.parse;
defaults_equilibrium = p.Results; % to keep track of defaults

if nargin==1
  p.parse(shot);
  params = p.Results;
elseif nargin>=2
  p.parse(shot,varargin{:});
  params = p.Results;
else
  p.parse;
  if nargout>=3; varargout{1} = rmfield(p.Results,'shot'); end
  return
end
% replace empty inputs with defaults
names = fieldnames(params);
mask = structfun(@isempty,params);
if any(mask),
  params = rmfield(params,unique([names(mask); p.UsingDefaults.']));
  if ~isfield(params, 'shot') || isnan(params.shot)
    warning('No shot entered');
    return
  end
  p.parse(params.shot,rmfield(params,'shot'));
  params = p.Results;
end
if nargout>=3; varargout{1} = rmfield(p.Results,'shot'); end

params_equilibrium = params;

ids_equilibrium = params_equilibrium.empty_struct;

%
% ids_properties
%
ids_properties.comment = params_equilibrium.comment;
ids_properties.homogeneous_time = 1;
ids_properties.source = ['TCV mds for shot = ' num2str(params_equilibrium.shot)];
ids_properties.provider = 'get_ids_equilibrium_fixed_boundary';
ids_properties.creation_date = date;

ids_equilibrium.ids_properties = ids_properties;

%
% vacuum_toroidal_field and time, using homogeneous
%
b0=gdat(params_equilibrium.shot,'b0','source','liuqe'); % to get on liuqe time array
vacuum_toroidal_field.r0 = b0.r0;
vacuum_toroidal_field.b0 = b0.data;

ids_equilibrium.vacuum_toroidal_field = vacuum_toroidal_field;
ids_equilibrium.time = b0.t;

time_slice(1:length(ids_equilibrium.time)) = ids_equilibrium.time_slice(1);
