Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8403af5
Add MuRAT3 main script and input files, update structure
LucaDeSiena Jan 20, 2026
b2547cf
Update .gitignore and README, remove .gitmodules
LucaDeSiena Jan 20, 2026
3e6d7ee
Update README badges, links, and formatting
LucaDeSiena Jan 21, 2026
87b865c
Refactor Qc selection and data warning logic - solving issue with Qc …
LucaDeSiena Jan 23, 2026
a4849cf
Update input files and remove iasp91 velocity model
LucaDeSiena Jan 25, 2026
724edb0
Refactor inversion code and improve variable naming
LucaDeSiena Jan 26, 2026
ccea87c
Refactor MuRAT main script and update input parameters
LucaDeSiena Jan 26, 2026
4b7b781
Improve Utilities_Matlab path handling and filtering
LucaDeSiena Jan 27, 2026
d6a0c16
Merge branch 'master' into MuRAT4
LucaDeSiena Jan 28, 2026
dd7faba
Fix for geometric error in midpoint calculation and improved plot rep…
martinaavella Feb 14, 2026
939b9d1
Improved minimum treshold delection
LucaDeSiena Mar 5, 2026
bff5c8b
Added option to include custom 1D model
LucaDeSiena Mar 5, 2026
535672c
Add DOI badge to README
LucaDeSiena Mar 5, 2026
ca7a2e1
Update README.md
LucaDeSiena Mar 5, 2026
a82d210
Update README.md
LucaDeSiena Mar 5, 2026
fe7a041
Update README.md
LucaDeSiena Mar 5, 2026
04339e1
Update README.md
LucaDeSiena Mar 5, 2026
96ce7c5
Update README.md
LucaDeSiena Mar 5, 2026
e38b8e8
Update README for MuRAT4.0 and docs
LucaDeSiena Mar 5, 2026
f3db790
add envelope
GaiaCaporale Mar 19, 2026
bdcb107
add envelopeSmoothTime in file imput
GaiaCaporale Mar 24, 2026
79e7421
Adjust Qc defaults, uncertainty calc & weights
LucaDeSiena Mar 24, 2026
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
144 changes: 39 additions & 105 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,64 @@
# macOS
.DS_Store
sac_MSH/.DS_Store
Utilities_Matlab/.DS_Store

# MATLAB / Simulink ---------------------------------------------------------
# Temporary files and backups
*~
# MATLAB/Simulink temporary, backup, and user files
*.asv
*.bak
*.tmp
*.autosave
*~
*.bak
*.mat
*.fig
*.mltbx
*.mlsettings
.matlab/
.history

# MATLAB specific
*.mlappinstall
*.mlappinstallinfo
*.mltbx # MATLAB toolbox archive (optionally track if you want)
*.mltbxmanifest
*.mldatx # Simulink data dictionary (if you want to ignore local copies)
*.mlpkginstall
*.prj # generic project files (ignore if you keep projects in repo)
*.mlproj
matlab.prf # MATLAB preferences
*.mlpkg
*.mlapp # App Designer saved files (keep or ignore depending on policy)
# MATLAB build / generated code / caches
slprj/
codegen/
rtw/
build/
*_ert_rtw/
*/.slx-cache/
*.slxc
*.slxautosave

# Compiled and binary artifacts
# Compiled / binary / object files
*.mex*
*.mexa64
*.mexmaci64
*.mexw64
*.mexw32
*.p # protected code
*.dll
*.so
*.dylib
*.exe
*.o
*.obj
*.pdb

# Simulink generated & build files
slprj/
*_grt_rtw/
*_ert_rtw/
*_slprj/
*.slxc
*.slxp
build/
CodeGenReport/
rtwtypes.h
rtw_*.c
rtw_*.h
# Large data directories (keep out of repo)
sac_MSH/
sac_Romania/
sac_Toba/

# Simulink coverage and test artifacts
coverage/
coverage_*.xml
modelCoverageReport/
slcovreport/

# Auto-generated files (Simulink Designer/Requirements)
requirements/
reqs/
TraceabilityReports/
*.reqs
# Binaries, archives, generated distributions
bin/
*.zip
*.tar
*.tar.gz
*.tgz

# Test results and logs
TestResults/
tests_results/
*.tap
*.trx
*.junit.xml
# Logs, test results, coverage
*.log
*.out

# Documentation build artifacts
docs/_build/
doc/build/
html/
*.pdf
*.chm

# MATLAB toolbox packaging / installation artifacts
*.mltbx
*.mlappinstall
TestResults/
coverage/

# Editor / IDE
# IDE / editor
.vscode/
.idea/
*.sublime-workspace
*.sublime-project
*.swp

# OS files
.DS_Store
Thumbs.db
desktop.ini
# Git metadata / lock files
.gitattributes.lock

# Python interop (if used)
# Python cache (if any)
__pycache__/
*.pyc
*.pyo
env/
venv/
.venv/

# Node / web tooling (if used in docs)
node_modules/
dist/
build/

# Containers / CI
*.tgz
*.tar.gz

# MATLAB Online specific
.matlab_history
.matlab_crash_dump_*

# Optional: user-specific MATLAB files
history.m
preferences.mat

# Optional: large data files (enable if you don't want data in repo)
# data/
# datasets/
# *.mat

# Keep Git from trying to track generated files from builds
# (uncomment and adapt if you build artifacts locally)
# /bin/
# /lib/
# /build/
7 changes: 0 additions & 7 deletions .gitmodules

This file was deleted.

Binary file removed IRtools.zip
Binary file not shown.
159 changes: 159 additions & 0 deletions MuRAT.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
%[text] # MuRAT Multi-Resolution (seismic) Attenuation Tomography
%[text] **SCOPE**: **A code for 3D attenuation-scattering-absorption tomography**
%[text] SYSTEM: The program works on all Mac, Windows and Linux computers where it has been tried.
%[text] MATLAB Version: Matlab 2025b
%[text] TOOLBOXES:
%[text] - Curve Fitting Toolbox
%[text] - Mapping Toolbox
%[text] - Optimization and Global Optimization Toolboxes
%[text] - Signal Processing Toolbox.
%[text] - Parallel Computing Toolbox is highly recommended for speed. \
%[text] TEMPLATES: Three sample datasets (Mount St. Helens, Romania and Toba) and corresponding inputs are available in the root MuRAT folder.
%[text] INSTRUCTIONS: The current release (4.0) works following these steps:
%[text] 1. Download or branch the package at [https://github.com/LucaDeSiena/MuRAT](https://github.com/LucaDeSiena/MuRAT).
%[text] 2. Build your own input file (.m or .mlx) - each field is described in the attached Documentation.pdf and README.txt.
%[text] 3. Create your *sac\_data* folder. The codes in the *Utilities\_Matlab* folder, especially those in the *PrePostProcessing* subfolder, can be useful to check data and outputs, especially the necessary parameters are in the headers of the SAC files.
%[text] 4. Run this file and select the name of the input file you created beforhand. \
%[text] Author: L. De Siena, January 2026
%[text] ## INPUTS AND CHECKS
addpath(fullfile(pwd,'bin'));

r = fullfile(pwd,'Utilities_Matlab');

% Split genpath into cell array of full folder paths
parts = strsplit(genpath(r), pathsep);
parts = parts(~cellfun(@isempty, parts));

% Filters: exclude .git, hidden folders (start with .), and 'private'
isBad = @(p) contains(p, [filesep '.git' filesep], 'IgnoreCase', true) ...
| contains(p, [filesep '.svn' filesep], 'IgnoreCase', true) ...
| contains(p, [filesep 'private' filesep], 'IgnoreCase', true) ...
| any( startsWith( split(p, filesep), '.' ) );

% Keep folders that pass filter and contain at least one .m file
keepMask = false(size(parts));
for k = 1:numel(parts)
p = parts{k};
if ~isBad(p)
% fast check for .m files (not recursive)
if ~isempty(dir(fullfile(p,'*.m')))
keepMask(k) = true;
end
end
end

addList = parts(keepMask);
if ~isempty(addList)
addpath(strjoin(addList, pathsep), '-end');
end

% Ask user for input file
[file, path]= uigetfile({'*.m;*.mlx','MuRAT input files (*.m, *.mlx)'; '*.*','All Files'});
if isequal(file,0)
error('No input file selected.');
end
inputFile = fullfile(path, file);
fprintf('Using input file %s\n', inputFile);

% Run or load input file safely
[~,~,ext] = fileparts(file);
switch lower(ext)
case '.mlx'
run(inputFile);
case '.m'
run(inputFile);
otherwise
error('Unsupported input file extension: %s', ext);
end
tStart = tic;

% --- Validation and ordering ---
Murat = Murat_checks(Murat);
Murat.input = orderfields(Murat.input);

% --- Ensure temp folder exists ---
tempFolder = fullfile(pwd,'temp');
if ~exist(tempFolder,'dir'), mkdir(tempFolder); end
save(fullfile(tempFolder,'Murat_checks.mat'), 'Murat','-v7');

tCheck = toc(tStart);
fprintf('Time spent on checks: %.2f s\n', tCheck);
%%
%[text] ## SEISMIC DATA PROCESSING AND FORWARD MODELLING
load(fullfile(tempFolder,'Murat_checks.mat'),'Murat');

% Ask user
useParallel = Murat.input.workers;

% Try to prepare parallel pool only if requested
if ~isempty(useParallel)
% Check for Parallel Computing Toolbox
hasPCT = license('test','Distrib_Computing_Toolbox') || license('test','Parallel_Computing_Toolbox');
if ~hasPCT
warning('Parallel Computing Toolbox not available. Falling back to sequential.');
useParallel = false;
else
% Start pool if none exists
pool = gcp('nocreate');
if isempty(pool)
try
pool= useParallel; % optionally specify NumWorkers
catch ME
warning('Failed to start parpool: %s. Falling back to sequential.');
useParallel = false;
end
end
end
end

tDataStart = tic;

if useParallel
Murat = Murat_dataParallelized(Murat);
else
Murat = Murat_data(Murat);
end
save(fullfile(tempFolder,'Murat_forward.mat'), 'Murat','-v7');
tData = toc(tDataStart);
fprintf('Time spent on data processing: %.2f s\n', tData);
%%
%[text] ## TOMOGRAPHIC INVERSIONS
tInvStart = tic;
load(fullfile(tempFolder,'Murat_forward.mat'),'Murat');
Murat = Murat_inversion(Murat);
% Save with -v7.3 if large
info = whos('Murat');
if info.bytes > 2e9
save(fullfile(tempFolder,'Murat_inverse.mat'),'Murat','-v7.3');
else
save(fullfile(tempFolder,'Murat_inverse.mat'),'Murat','-v7');
end
tInv = toc(tInvStart);
fprintf('Inversion completed (%.2f s)\n', tInv);
%%
%[text] ## PLOTTING and CLEANING UP
tPlotStart = tic;
Murat = Murat_plot(Murat);

outFolder = Murat.input.label;

info = whos('Murat'); % re-check size
if info.bytes > 2e9
save(fullfile(outFolder,'Murat.mat'),'Murat','-v7.3');
else
save(fullfile(outFolder,'Murat.mat'),'Murat','-v7');
end

tPlot = toc(tPlotStart);
fprintf('Plotting completed (%.2f s)\n', tPlot);

totalTime = toc(tStart);
fprintf('Total run time: %.2f s\n', totalTime);

clearvars -except Murat tCheck tData tInv tPlot totalTime

%[appendix]{"version":"1.0"}
%---
%[metadata:view]
% data: {"layout":"inline","rightPanelPercent":40}
%---
Binary file removed MuRAT3.mlx
Binary file not shown.
Loading
Loading