From 4b2aca97800b3f25738a1f3659f1c8739e34a884 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 25 Aug 2024 10:06:07 -0600 Subject: [PATCH 1/8] Updates --- src/matlab/plotframe2.m | 3 ++- src/matlab/read_gauge_data.m | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/matlab/plotframe2.m b/src/matlab/plotframe2.m index 08da92e..01b9f4e 100644 --- a/src/matlab/plotframe2.m +++ b/src/matlab/plotframe2.m @@ -254,7 +254,8 @@ if (UserVariable == 1) % User has supplied a function to convert original q variables to % the variable which is to be plotted, e.g. Mach number, entropy. - qdata = feval(UserVariableFile,data); + + qdata = feval(UserVariableFile,data,x,y); q = reshape(qdata,mx,my); else q = reshape(data(:,mq),mx,my); diff --git a/src/matlab/read_gauge_data.m b/src/matlab/read_gauge_data.m index 2ecb7f1..58fbd4f 100644 --- a/src/matlab/read_gauge_data.m +++ b/src/matlab/read_gauge_data.m @@ -1,8 +1,5 @@ function gauges = read_gauge_data() % -% read_gauge_data reads data in 'gauges.data' file and returns data in a -% struct. -% % read_gauge_data() reads data in a file 'gauges.data'. Data is assumed to % be in the current directory. % @@ -13,7 +10,7 @@ return end -gtype = struct('id',[],'longitude',[],'latitude',[],'t0',[],'t1',[]); +gtype = struct('id',[],'x',[],'y',[],'t0',[],'t1',[]); fid = fopen('gauges.data','r'); for i = 1:5 @@ -30,8 +27,8 @@ data = sscanf(l,'%d %e %e %e %d',Inf); g = gtype; g.id = data(1); - g.longitude = data(2); - g.latitude = data(3); + g.x = data(2); + g.y = data(3); g.t0 = data(4); g.t1 = data(5); gauges(n) = g; From f1ec4c82f4413471fe0c936ab9c6729960a95e0f Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 20 Oct 2025 11:56:27 -0400 Subject: [PATCH 2/8] Add time variable to map2d --- src/matlab/map1d.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/matlab/map1d.m b/src/matlab/map1d.m index 0c0c1b4..3180e37 100644 --- a/src/matlab/map1d.m +++ b/src/matlab/map1d.m @@ -45,3 +45,5 @@ % % % See also SETPLOTSTYLE, PLOTFRAME1EZ, GETLEGENDINFO, SETPLOT. + + From e0bd7950a8257ed5ea29de7d12992cf19414086a Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sat, 21 Feb 2026 06:34:27 +0300 Subject: [PATCH 3/8] Allow for solution plot on top of background processor colors --- src/matlab/set_colors.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matlab/set_colors.m b/src/matlab/set_colors.m index 3092658..d5d0225 100644 --- a/src/matlab/set_colors.m +++ b/src/matlab/set_colors.m @@ -161,8 +161,8 @@ function set_colors(p,x,y,z,q,colormapping) else qmin = pp.qmin; qmax = pp.qmax; - m_proc_color = qmin <= qm & qm <= qmax; - m_q = qm < qmin | qm > qmax; + m_q = qmin <= qm & qm <= qmax; + m_proc_color = qm < qmin | qm > qmax; end % Indices that should use proc colormap From afa52c8bfb6245f2e81344f9bf9f4eea2217f155 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sat, 21 Feb 2026 06:37:18 +0300 Subject: [PATCH 4/8] Read 3d gauge data --- src/matlab/read_gauge_data.m | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/matlab/read_gauge_data.m b/src/matlab/read_gauge_data.m index 58fbd4f..03730b9 100644 --- a/src/matlab/read_gauge_data.m +++ b/src/matlab/read_gauge_data.m @@ -3,35 +3,45 @@ % read_gauge_data() reads data in a file 'gauges.data'. Data is assumed to % be in the current directory. % -% See also add_gauges, add_regions. +% See also track_gauges, add_gauges, add_regions. if (~exist('gauges.data','file')) fprintf('File gauges.data does not exist. No gauges will be plotted.\n'); + gauges = []; return end -gtype = struct('id',[],'x',[],'y',[],'t0',[],'t1',[]); - fid = fopen('gauges.data','r'); for i = 1:5 % Read first five lines of comments fgetl(fid); end -fgetl(fid); % blank line +gtype = struct('id',[],'x',[],'y',[],'t0',[],'t1',[]); + +fgetl(fid); % blank line +l = fgetl(fid); % Dimension +dim = sscanf(l,'%d',1); l = fgetl(fid); % Get number of gauges num_gauges = sscanf(l,'%d',1); gauges(1:num_gauges) = gtype; -for n = 1:num_gauges +for n = 1:num_gauges l = fgetl(fid); data = sscanf(l,'%d %e %e %e %d',Inf); g = gtype; g.id = data(1); g.x = data(2); g.y = data(3); - g.t0 = data(4); - g.t1 = data(5); + if dim == 2 + g.t0 = data(4); + g.t1 = data(5); + else + g.z = data(4); + g.t0 = data(5); + g.t1 = data(6); + end + gauges(n) = g; end -end \ No newline at end of file +end From a385791b60ef5c53306c60be2bbb166ab8acb879 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sat, 21 Feb 2026 06:37:52 +0300 Subject: [PATCH 5/8] Kick out some ugly colors --- src/matlab/ppcolors.m | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/matlab/ppcolors.m b/src/matlab/ppcolors.m index ba521a6..ec21188 100644 --- a/src/matlab/ppcolors.m +++ b/src/matlab/ppcolors.m @@ -13,6 +13,7 @@ % % See also ppcolors_colorbar to create a colorbar for this colormap. +% Choose colors : chex = {... '#000000','#FFFF00','#1CE6FF','#FF34FF','#FF4A46','#008941','#006FA6','#A30059',... @@ -23,6 +24,7 @@ '#372101','#FFB500','#C2FFED','#A079BF','#CC0744','#C0B9B2','#C2FF99','#001E09',... '#00489C','#6F0062','#0CBD66','#EEC3FF','#456D75','#B77B68','#7A87A1','#788D66',... '#885578','#FAD09F','#FF8A9A','#D157A0','#BEC459','#456648','#0086ED','#886F4C',... +... '#34362D','#B4A8BD','#00A6AA','#452C2C','#636375','#A3C8C9','#FF913F','#938A81',... '#575329','#00FECF','#B05B6F','#8CD0FF','#3B9700','#04F757','#C8A1A1','#1E6E00',... '#7900D7','#A77500','#6367A9','#A05837','#6B002C','#772600','#D790FF','#9B9700',... @@ -31,6 +33,7 @@ '#83AB58','#001C1E','#D1F7CE','#004B28','#C8D0F6','#A3A489','#806C66','#222800',... '#BF5650','#E83000','#66796D','#DA007C','#FF1A59','#8ADBB4','#1E0200','#5B4E51',... '#C895C5','#320033','#FF6832','#66E1D3','#CFCDAC','#D0AC94','#7ED379','#012C58',... +... '#7A7BFF','#D68E01','#353339','#78AFA1','#FEB2C6','#75797C','#837393','#943A4D',... '#B5F4FF','#D2DCD5','#9556BD','#6A714A','#001325','#02525F','#0AA3F7','#E98176',... '#DBD5DD','#5EBCD1','#3D4F44','#7E6405','#02684E','#962B75','#8D8546','#9695C5',... @@ -39,6 +42,7 @@ '#6B94AA','#51A058','#A45B02','#1D1702','#E20027','#E7AB63','#4C6001','#9C6966',... '#64547B','#97979E','#006A66','#391406','#F4D749','#0045D2','#006C31','#DDB6D0',... '#7C6571','#9FB2A4','#00D891','#15A08A','#BC65E9','#FFFFFE','#C6DC99','#203B3C',... +... '#671190','#6B3A64','#F5E1FF','#FFA0F2','#CCAA35','#374527','#8BB400','#797868',... '#C6005A','#3B000A','#C86240','#29607C','#402334','#7D5A44','#CCB87C','#B88183',... '#AA5199','#B5D6C3','#A38469','#9F94F0','#A74571','#B894A6','#71BB8C','#00B433',... @@ -47,8 +51,28 @@ '#1A3A2A','#494B5A','#A88C85','#F4ABAA','#A3F3AB','#00C6C8','#EA8B66','#958A9F',... '#BDC9D2','#9FA064','#BE4700','#658188','#83A485','#453C23','#47675D','#3A3F00',... '#061203','#DFFB71','#868E7E','#98D058','#6C8F7D','#D7BFC2','#3C3E6E','#D83D66',... +... '#2F5D9B','#6C5E46','#D25B88','#5B656C','#00B57F','#545C46','#866097','#365D25',... -'#252F99','#00CCFF','#674E60','#FC009C','#92896B'}; +'#252F99','#00CCFF','#674E60','#FC009C','#92896B','#000000','#000000','#000000',... +'#000000','#000000','#000000','#000000','#000000','#000000','#000000','#000000',... +'#000000','#000000','#000000','#000000','#000000','#000000','#000000','#000000',... +'#000000','#000000','#000000','#000000','#000000','#000000','#000000','#000000',... +'#000000','#000000','#000000','#000000','#000000','#000000','#000000','#000000',... +'#000000','#000000','#000000','#000000','#000000','#000000','#000000','#000000',... +'#000000','#000000','#000000','#000000','#000000','#000000','#000000','#000000'}; + + +% Colors to kick out +I1 = [1,7,8,10,11,14,17,18,20,23,25,26,27,34,35,37,39,41,48,49,50,53,55,57,62,64]; +I2 = [1,4,5,9,16,21,22,27,28,31,32,33,35,36,39,40,42,44,47,48,49,51,52,55,56,58,64]; +I3 = [3,6,7,8,12,13,14,19,20,21,22,29,30,33,35,36,39,40,44,47,48,49,51,52,55,57,64]; +I4 = [1,2,6,10,13,14,15,27,28,33,37,38,40,41,42,52,53,54,55,56,57,60,63]; +I5 = [1,2,4,6,8,9,11,14:64]; + +I = [I1, I2+64, I3+2*64, I4+3*64, I5+4*64]; + +% Remove darker colors +chex(I) = []; m = length(chex); r = zeros(m,1); From 655cb73e42c919aed0c17aa9568046a2abcae6cb Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sat, 21 Feb 2026 06:38:45 +0300 Subject: [PATCH 6/8] Add t as argument to map1d routines --- src/matlab/plotframe2.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matlab/plotframe2.m b/src/matlab/plotframe2.m index 01b9f4e..19107f8 100644 --- a/src/matlab/plotframe2.m +++ b/src/matlab/plotframe2.m @@ -318,7 +318,7 @@ if (usermap1d == 1) % Users should call mapc2p from inside of map1d. - [rvec,qvec] = map1d(xcm,ycm,qmesh); + [rvec,qvec] = map1d(xcm,ycm,qmesh,t); [rs,cs] = size(rvec); [rq,cq] = size(qvec); if (cs > 1 || cq > 1) From 22c355655a5720947d4a66a68105c69c86e9f81d Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sat, 21 Feb 2026 06:39:45 +0300 Subject: [PATCH 7/8] Read dimension argument to add 3d capabilities --- src/matlab/add_regions.m | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/matlab/add_regions.m b/src/matlab/add_regions.m index f717b00..793a850 100644 --- a/src/matlab/add_regions.m +++ b/src/matlab/add_regions.m @@ -1,4 +1,4 @@ -function rhout = add_regions(t,format) +function rhout = add_regions(t,read_dim,format) % % add_regions plots regions from file 'regions.data' % @@ -15,8 +15,11 @@ % See also add_gauges, plot_gauges. -if (nargin < 2) +if (nargin < 3) format = 'ForestClaw'; + if (nargin < 2) + read_dim = true; + end end use_forestclaw = strcmpi(format,'forestclaw'); @@ -40,7 +43,15 @@ fgetl(fid); end fgetl(fid); % blank line -l = fgetl(fid); % Get number of gauges +if read_dim + l = fgetl(fid); % Get dimension of region + dim = sscanf(l,'%d',1); + if (dim ~= 2) + error('afterframe : Region file must be a 2d file') + end +end + +l = fgetl(fid); % Get number of regions num_regions = sscanf(l,'%d',1); c = {'w','w','w','w','w','w','w'}; % Colors for each region @@ -58,8 +69,8 @@ for n = 1:num_regions l = fgetl(fid); data = sscanf(l,'%d %d %e %e %e %e %e %e',Inf); - minlevel = data(1); - maxlevel = data(2); + % minlevel = data(1); + % maxlevel = data(2); t0 = data(3); t1 = data(4); x0 = data(5); @@ -79,6 +90,7 @@ else set(gca,'zlim',[0,max(zl)]); end + region_handles(n) = hg; hold on; end From 2fcacc3d189aec48aa9c231e5974e42656a9d1ac Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sat, 21 Feb 2026 06:41:00 +0300 Subject: [PATCH 8/8] don't assume lat/long coordinate --- src/matlab/add_gauges.m | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/matlab/add_gauges.m b/src/matlab/add_gauges.m index 553bc47..d62ba34 100644 --- a/src/matlab/add_gauges.m +++ b/src/matlab/add_gauges.m @@ -15,7 +15,7 @@ % See also add_regions, plot_gauges. -if (nargin < 1) +if nargin < 1 format = 'ForestClaw'; end @@ -48,13 +48,13 @@ for n = 1:num_gauges g = gauges(n); zp = zmax; - hg = plot3(g.longitude,g.latitude,zp,'m.','linewidth',3,'markersize',95); + hg = plot3(g.x,g.y,zp,'m.','linewidth',3,'markersize',75); set(gca,'zlim',zl); view(2); % set(gca,'zlimmode','auto'); set(hg,'Tag','gauge'); set(hg,'userdata',g); - h = text(g.longitude,g.latitude,zp,sprintf('%d',g.id),'fontsize',11,'color','k'); + h = text(g.x,g.y,zp,sprintf('%d',g.id),'fontsize',11,'color','k','fontweight','bold'); set(h,'HorizontalAlignment','center'); % set(h,'backgroundcolor','none'); gauge_handles(n) = hg; @@ -92,9 +92,11 @@ fgetl(fid); end -gtype = struct('id',[],'longitude',[],'latitude',[],'t0',[],'t1',[]); +gtype = struct('id',[],'x',[],'y',[],'t0',[],'t1',[]); fgetl(fid); % blank line +l = fgetl(fid); % Dimension +dim = sscanf(l,'%d',1); l = fgetl(fid); % Get number of gauges num_gauges = sscanf(l,'%d',1); gauges(1:num_gauges) = gtype; @@ -103,10 +105,17 @@ data = sscanf(l,'%d %e %e %e %d',Inf); g = gtype; g.id = data(1); - g.longitude = data(2); - g.latitude = data(3); - g.t0 = data(4); - g.t1 = data(5); + g.x = data(2); + g.y = data(3); + if dim == 2 + g.t0 = data(4); + g.t1 = data(5); + else + g.z = data(4); + g.t0 = data(5); + g.t1 = data(6); + end + gauges(n) = g; end