Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:3a35cdb24ad67a89d2a1abf099040aff3c71b7b4
  • Code
  • Branches (1)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • a850fae
  • /
  • examples
  • /
  • buildFarFieldCovMatrix
  • /
  • farFieldCov.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
content badge
swh:1:cnt:88f9cb289ab2fc884074681aa08404ae2ca109c1
directory badge
swh:1:dir:c19189f2494666f00ba473eb43bb39b3e8ee0a3a
revision badge
swh:1:rev:c4ecf78f32558cba5e45ab0c43a0995a20f2c85b
snapshot badge
swh:1:snp:3a35cdb24ad67a89d2a1abf099040aff3c71b7b4

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: c4ecf78f32558cba5e45ab0c43a0995a20f2c85b authored by igkiou on 05 September 2019, 11:00:35 UTC
first commit
Tip revision: c4ecf78
farFieldCov.m
%% Build far field covariance matrix

% Build the target area
boxTargetArea = boxArea( ...
    1 ,       ... wavelength
    10,       ... MFP (O.D. = 2)
    [-10,10], ... z
    [-10,10]  ... x
);

% views config, define by angles
viewsDirections = 0:1:359;
views = farFieldSource(deg2rad(viewsDirections),0);

% lights config, lighting in some directions
lightsDirections = [0, 1, 4, 20];
lights = farFieldSource(deg2rad(lightsDirections),0);

% scatter config
% load measured amplitude (generated by mu-diff far field)
load('scatteringAmplitude.mat', 'theta', 'farField')
scatter = tabulatedAmplitudeScatter( ...
    theta,   ... diirections
    farField ... measured amplitude
);

% Show the scattering function
figure
polarplot(theta, abs(farField).^2);
title('Scattering function of single particle')

%% Sovle scmc with CBS
tic
CBSres = scmc(boxTargetArea,views,lights,scatter,1e3,'CBS',true,'parforIters',12);
toc

%% Sovle scmc without CBS
tic
NCBSres = scmc(boxTargetArea,views,lights,scatter,1e3,'CBS',false,'parforIters',12);
toc

%% Compare cov matrix
f = figure;
f.Position = [0,0,1200,700];
maxval = max(abs([CBSres.C(:);NCBSres.C(:)]));

subplot(2,4,1);
imagesc(viewsDirections,viewsDirections,abs(CBSres.C(:,:,1,1)),[0,maxval]);
xlabel('view[deg]');
ylabel({'CBS','view[deg]'});
title(['(',num2str(lightsDirections(1)),'\circ,',num2str(lightsDirections(1)),'\circ)']);

subplot(2,4,2);
imagesc(viewsDirections,viewsDirections,abs(CBSres.C(:,:,1,2)),[0,maxval]);
xlabel('view[deg]');
ylabel('view[deg]');
title(['(',num2str(lightsDirections(1)),'\circ,',num2str(lightsDirections(2)),'\circ)']);

subplot(2,4,3);
imagesc(viewsDirections,viewsDirections,abs(CBSres.C(:,:,1,3)),[0,maxval]);
xlabel('view[deg]');
ylabel('view[deg]');
title(['(',num2str(lightsDirections(1)),'\circ,',num2str(lightsDirections(3)),'\circ)']);

subplot(2,4,4);
imagesc(viewsDirections,viewsDirections,abs(CBSres.C(:,:,1,4)),[0,maxval]);
xlabel('view[deg]');
ylabel('view[deg]');
title(['(',num2str(lightsDirections(1)),'\circ,',num2str(lightsDirections(4)),'\circ)']);

subplot(2,4,5);
imagesc(viewsDirections,viewsDirections,abs(NCBSres.C(:,:,1,1)),[0,maxval]);
xlabel('view[deg]');
ylabel({'Without CBS','view[deg]'});

subplot(2,4,6);
imagesc(viewsDirections,viewsDirections,abs(NCBSres.C(:,:,1,2)),[0,maxval]);
xlabel('view[deg]');
ylabel('view[deg]');

subplot(2,4,7);
imagesc(viewsDirections,viewsDirections,abs(NCBSres.C(:,:,1,3)),[0,maxval]);
xlabel('view[deg]');
ylabel('view[deg]');

subplot(2,4,8);
imagesc(viewsDirections,viewsDirections,abs(NCBSres.C(:,:,1,4)),[0,maxval]);
xlabel('view[deg]');
ylabel('view[deg]');

%% Compare diagonals
figure

hold on
plot(viewsDirections,diag(abs(CBSres.C(:,:,1,1))), 'lineWidth', 2);
plot(viewsDirections,diag(abs(NCBSres.C(:,:,1,1))), 'lineWidth', 2);

xlabel('view[deg]');
ylabel('intensity');

legend('With CBS','Without CBS')

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API