Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 7 additions & 32 deletions admin/make_horace_distribution_kit.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ function make_horace_distribution_kit(varargin)
% Horace to work into single zip file
%
%Usage:
%>>make_horace_distribution_kin(['-reveal_code','-compact'])
%>>make_horace_distribution_kin(['-compact'])
%
%where optional arguments are:
%'-reveal_code' -- if present, do not request p-code Horace; default pCode
% the private Horace folders
%'-compact' -- if present, request dropping the demo and test files
% with test folders, default -- compress demo and tests
% together with main code.
%'-noherbert' -- do not pack Herbert together with Horace
%
% excludes (not copies to distribution) all files and subfolders of a folder where
% _exclude_all.txt file is found
Expand All @@ -30,8 +27,6 @@ function make_horace_distribution_kit(varargin)
% after renaming the file Horace_on.m.template to horace_on.m.
%
%
% $Revision:: 1759 ($Date:: 2020-02-10 16:06:00 +0000 (Mon, 10 Feb 2020) $)
%
%
% known keys
options = {'-reveal_code','-compact','-noherbert'};
Expand All @@ -40,7 +35,7 @@ function make_horace_distribution_kit(varargin)
error('MAKE_HORACE_DISTRIBUTION_KIT:invalid_argument',err_mess);
end% default key values
%
common_files_to_distribute = {'LICENSE','README.md','CMakeLists.txt'};
common_files_to_distribute = {'LICENSE','README.md','CMakeLists.txt','VERSION'};

pths = horace_paths;
hor_root_dir = pths.root; % MUST have rootpath so that horace_init, horace_off are included
Expand All @@ -67,16 +62,13 @@ function make_horace_distribution_kit(varargin)

% copy everything, which can be found core Horace folder
copy_files_list(fullfile(hor_root_dir,'horace_core'),fullfile(horace_targ_dir,'horace_core'),'+_');
copy_files_list(fullfile(hor_root_dir,'herbert_core'),fullfile(horace_targ_dir,'herbert_core'),'+_');
% copy source code files from system directory
copy_files_list(fullfile(hor_root_dir,'_LowLevelCode'),fullfile(horace_targ_dir,'_LowLevelCode'),...
'+_','h','cpp','c','sln','vcproj');
copy_files_list(fullfile(hor_root_dir,'admin'),fullfile(horace_targ_dir,'admin'));
copy_files_list(fullfile(hor_root_dir,'cmake'),fullfile(horace_targ_dir,'cmake'));
%
hor_on_template = fullfile(horace_targ_dir,'admin','horace_on.m.template');
copyfile(hor_on_template,fullfile(target_Dir,'horace_on.m.template'),'f');
delete(hor_on_template);
%
common_files_to_distribute = cellfun(@(x)(fullfile(hor_root_dir,x)),common_files_to_distribute,...
'UniformOutput',false);
for i=1:numel(common_files_to_distribute)
Expand All @@ -92,36 +84,19 @@ function make_horace_distribution_kit(varargin)
% if necessary, copy demo and test folders
if ~no_demo
% copy source code files from system directory
copy_files_list(fullfile(hor_root_dir,'_test'),fullfile(horace_targ_dir,'_test'),'+_')
copy_files_list(fullfile(hor_root_dir,'demo'),fullfile(horace_targ_dir,'demo'),'+_')
copy_files_list(fullfile(hor_root_dir,'_test'),fullfile(horace_targ_dir,'_test'),'+_');
copy_files_list(fullfile(hor_root_dir,'demo'),fullfile(horace_targ_dir,'demo'),'+_');
end
%
disp('! The HORACE program files collected successfully ==============!')
if(~reveal_code)
disp('! p-coding private Horace parts and deleting unnecessary folders=!')
pCode_Horace_kit(fullfile(horace_targ_dir,'horace_core'));
disp('! Horace p-coding completed =====================================!')
end

% if Herbert used, add Herbert distribution kit to the distribution
if ~no_herbert
argi{1}='-run_by_horace';
if ~no_demo
argi{2} = '-full';
end
make_herbert_distribution_kit(target_Dir,argi{:});
pref='';
else
pref='_only';
end
%
%
disp('! Start compressing all necessary files together ================!')
%
if no_demo
horace_file_name=['Horace',pref,'_nodemo.zip'];
horace_file_name='Horace_nodemo_distribution_kit.zip';
else
horace_file_name= ['horace',pref,'_distribution_kit.zip'];
horace_file_name= 'Horace_distribution_kit.zip';
end
horace_file_name=fullfile(current_dir,horace_file_name);
if(exist(horace_file_name,'file'))
Expand Down
21 changes: 12 additions & 9 deletions documentation/user_docs/docs/manual/Generic_Transformation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Generic Transformations
#######################

The previous chapters describe how one may do various
:doc:`unary </manual/Unary_operations>` or :doc:`binary operations </manual/Binary_operations>` over your data or build analytical model and :doc:`simulate it over whole sqw file </manual/Simulation>`.
:doc:`unary </manual/Unary_operations>` or :doc:`binary operations </manual/Binary_operations>` over your data, apply :doc:`symmetry operations </manual/Symmetrising_etc>` or build analytical model and :doc:`simulate it over whole sqw file </manual/Simulation>`.
As whole ``sqw`` file can not be generally placed in memory, all these operations are
based on special ``PageOp`` family of algorithms, which operate loading a page of data in memory
and applying various operations to these data. For :doc:`unary </manual/Unary_operations>` and :doc:`binary </manual/Binary_operations>` operations we wrote these transformations for users and the ``sqw_eval`` algorithm from :doc:`Simulation </manual/Simulation>` section
and applying various operations to these data. For :doc:`unary </manual/Unary_operations>`, :doc:`binary </manual/Binary_operations>` and :doc:`symmetry operations </manual/Symmetrising_etc>` we wrote these transformations for users and the ``sqw_eval`` algorithm from :doc:`Simulation </manual/Simulation>` section
gives user a set of rules to write his own model in `hklE` coordinate system and apply it to whole ``sqw`` object.

Introduction
Expand Down Expand Up @@ -106,9 +106,9 @@ This is simple code, but if your objects are filebased, this will requests two s
function output_sig_err = sqw_op_unary(in_page_op,varargin)
% Apply two simple transformations of signal of an sqw object in one go.

data = in_page_op.data; % get access to page of pixel data
data(8,:) = 2*data-1; % change pixel data signal by multiplying it by 2 and extracting 1
output_sig_err = data(8:9,:); % combine signal and unchanged error into form, requested by algorithm
data = in_page_op.data; % get access to page of pixel data
data(8,:) = 2*data(8,:)-1; % change pixel data signal by multiplying it by 2 and extracting 1
output_sig_err = data(8:9,:); % extract signal and unchanged error into form, requested by algorithm
end

and apply ``sqw_op`` algorithm:
Expand Down Expand Up @@ -184,7 +184,8 @@ The page-function with actually used to remove background in the code above is:
% As this is special projection, it needs 5 rows of pixel data (needs run_id)
% rather then the standard projection, which takes 4 rows.
pix = bg_data.proj.transform_pix_to_img(data(1:5,:)); % you may define your own
% complex transformation to convert pixels in Cry
% complex transformation to convert pixels from Crystal Cartesian coordinates to
% image coordinates, but here you have your projection already defined to do that.

% interpolate background signal on the pixels coordinates expressed
% in instrument coordinate system.
Expand Down Expand Up @@ -221,7 +222,7 @@ Let's assume you are interested in magnetic signal which is present at relativel
:alt: Sample differential cross-section measured on MAPS

Sample differential cross-section measured on MAPS and showing
magnetic signal within read-cycle surrounded area and background signal (phonons)
magnetic signal within red-cycle surrounded area and background signal (phonons)
inside and outside of this area. Yellow box represents double-size Brillouin zone where
data moved using shift operation and its top right quadrant -- the area where data should
be finally moved using folding and reflection.
Expand Down Expand Up @@ -404,7 +405,8 @@ The similarities and differences between these two algorithms are summarized in
| | | operations | |
+---------+--------------------------+------------------------------+-------------------------------------------+
| 2 | Multiple transformations | Not allowed | simple modifications to standard script |
| | applied to single data | | |
| | applied to symmetrized | | |
| | data | | |
+---------+--------------------------+------------------------------+-------------------------------------------+
| 3 | Include same pixels from | No. Efficient exclusion | request complex coding. Probably |
| | multiple symmetry op. | algorithm | not very efficient but possible. |
Expand Down Expand Up @@ -484,7 +486,8 @@ Simplest form of the function, which allows combining multiple cuts into single
% into coordinate system, related to target projection
for i=1:numel(proj_array)
% input projections used for cut do not have lattice set up for them.
% They need lattice so let's set it up here.
% They need lattice to be fully defined and use projection methods so let's set it up here.
% may be taken out of loop for performance though it is fast anyway.
proj_array(i).alatt = targ_proj.alatt;
proj_array(i).angdeg = targ_proj.angdeg;
% transform momentum transfer values from current page of data into
Expand Down