[Dart-dev] DART/branches Revision: 12896

dart at ucar.edu dart at ucar.edu
Mon Oct 8 15:28:02 MDT 2018


nancy at ucar.edu
2018-10-08 15:28:02 -0600 (Mon, 08 Oct 2018)
88
simple matlab scripts for plotting the output files
from the test_quad_interp program.




Added: DART/branches/roms_interpolation/developer_tests/interpolation/work/plotit_irr.m
===================================================================
--- DART/branches/roms_interpolation/developer_tests/interpolation/work/plotit_irr.m	                        (rev 0)
+++ DART/branches/roms_interpolation/developer_tests/interpolation/work/plotit_irr.m	2018-10-08 21:28:02 UTC (rev 12896)
@@ -0,0 +1,19 @@
+function plotit_irr(lon, lat, dat, msize)
+ 
+nlon = length(lon(1,:));
+nlat = length(lat(:,1));
+
+my_data = reshape(dat, nlon, nlat);
+
+% look for missing r8s
+missing_val = -888888;
+inds = find(my_data==missing_val);
+if (~isempty(inds)), my_data(inds)  = 0.; end
+%if (~isempty(inds)), my_data(inds)  = nan; end
+
+scatter(lon, lat, msize, my_data,'filled');
+%plot3(lon, lat, my_data);
+%imagesc(lon, lat, my_data);
+colorbar;
+
+end

Added: DART/branches/roms_interpolation/developer_tests/interpolation/work/plotit_reg.m
===================================================================
--- DART/branches/roms_interpolation/developer_tests/interpolation/work/plotit_reg.m	                        (rev 0)
+++ DART/branches/roms_interpolation/developer_tests/interpolation/work/plotit_reg.m	2018-10-08 21:28:02 UTC (rev 12896)
@@ -0,0 +1,22 @@
+function plotit_reg(lon, lat, dat)
+ 
+nlon = length(lon);
+nlat = length(lat);
+
+%% look for missing r8s
+missing_val = -888888;
+inds = find(dat==missing_val);
+if (~isempty(inds)), dat(inds)  = nan; end
+
+my_data = reshape(dat, nlon, nlat);
+
+whos;
+
+% plots the Y axis reversed from what we want.
+% how to fix?
+%scatter(lon, lat, 1, my_data);
+
+imagesc(lon, lat, my_data);
+colorbar;
+
+end

Added: DART/branches/roms_interpolation/developer_tests/interpolation/work/see_output.m
===================================================================
--- DART/branches/roms_interpolation/developer_tests/interpolation/work/see_output.m	                        (rev 0)
+++ DART/branches/roms_interpolation/developer_tests/interpolation/work/see_output.m	2018-10-08 21:28:02 UTC (rev 12896)
@@ -0,0 +1,69 @@
+
+% fully regular sampled data case:
+ reg1longr = load ('sampled_lon_1.txt');
+ reg1latgr = load ('sampled_lat_1.txt');
+ reg2datgr = load ('sampled_data_1.txt');
+
+figure(1);
+plotit_reg(reg1longr, reg1latgr, reg2datgr);
+
+% fully regular sampled data case:
+ reg1longr = load ('sampled_lon_2.txt');
+ reg1latgr = load ('sampled_lat_2.txt');
+ reg2datgr = load ('sampled_data_2.txt');
+
+figure(2);
+plotit_reg(reg1longr, reg1latgr, reg2datgr);
+
+% rotated sampled data case:
+ reg1longr = load ('sampled_lon_3.txt');
+ reg1latgr = load ('sampled_lat_3.txt');
+ reg2datgr = load ('sampled_data_3.txt');
+
+figure(3);
+plotit_reg(reg1longr, reg1latgr, reg2datgr);
+
+% rotated, deformed sampled data case:
+ reg1longr = load ('sampled_lon_4.txt');
+ reg1latgr = load ('sampled_lat_4.txt');
+ reg2datgr = load ('sampled_data_4.txt');
+
+figure(4);
+plotit_reg(reg1longr, reg1latgr, reg2datgr);
+
+%@% % regular case:
+%@% 
+%@% % data grid - fully regular, values output only for plotting
+%@%  reg1longr = load ('data_lons_1d_reg_test.txt');
+%@%  reg1latgr = load ('data_lats_1d_reg_test.txt');
+%@%  reg2datgr = load ('data_data_2d_reg_test.txt');
+%@% 
+%@% % sampled data - regular grid rotated by some angle
+%@% %                so considered fully irregular
+%@%  reg2lonsp = load ('sample_lons_2d_reg_test.txt');


More information about the Dart-dev mailing list