Commit 7738440a authored by Elie Dumas-Lefebvre's avatar Elie Dumas-Lefebvre

Ajout de documentation dans g_res_field et changements legers dans g_vis_field...

Ajout de documentation dans g_res_field et changements legers dans g_vis_field pour permettre son utilisation peu importe la version de matlab
parent e70023e3
function delta = g_res_field(LAT, LON)
function res = g_res_field(LAT, LON, varargin)
% g_res_field - Function calculating the loss of resolution with de distance
% from the camera
%
% Inputs:
%
% LAT : Latitude matrix obtained from g_rect
%
% LON : Longitude matrix obtained from g_rect
%
% Outputs:
%
% res : The field of resolution which is degrading with distance from
% the camera
%
%
% Author: Daniel Bourgault
% Institut des sciences de la mer de Rimouski
%
% email: daniel_bourgault@uqar.ca
% Website: http://demeter.uqar.ca/g_rect/
% February 2013
%
% Author: Elie Dumas-Lefebvre
% Institut des Science de la Mer de Rimouski
%
% Note: Matricial formulation of the calculation for a faster execution
%
% email: elie.dumas-lefebvre@uqar.ca
% March 2019
%
% LAT and LON difference in the x-axis
dLATi = diff(LAT, 1, 2);
......@@ -17,6 +47,7 @@ meterPerDegLat = 1852*60.0;
meterPerDegLoni = meterPerDegLat .* cosd(LAT_meani);
meterPerDegLonj = meterPerDegLat .* cosd(LAT_meanj);
% Conversion from degrees to meters
dxi = dLONi.*meterPerDegLoni;
dxj = dLONj.*meterPerDegLonj;
......@@ -27,8 +58,13 @@ dyj = dLATj.*meterPerDegLat;
deltai = sqrt(dxi.^2 + dyi.^2);
deltaj = sqrt(dxj.^2 + dyj.^2);
% Overall distance
delta = sqrt(deltai.^2 + deltaj.^2);
% Adjusting the shape for plotting
deltai = deltai(1:end-1, :);
deltaj = deltaj(:, 1:end-1);
% field of resolution
res = sqrt(deltai.^2 + deltaj.^2);
end
......@@ -9,7 +9,7 @@ function [h_figure,h_pcolor,h_datetext] = g_viz_field(imgFname,rectFile,varargin
% showTime, Default 0, if 1, displays the timestamp of the
% image in the figure's title
% showLand, Default 0, if 'f' or 'h', displays the land contour
% with m_gshhs_f or m_gshhs_f
% with m_gshhs_f or m_gshhs_h
% landcolor, Default [241 235 144]/255, Color of the land on the
% map
%
......@@ -72,8 +72,7 @@ int = int';
int = int - nanmean(nanmean(int));
figure('Renderer', 'painters', 'Position', [100 100 900 700])
m_proj('mercator','longitudes',[lon_min lon_max],'latitudes',[lat_min lat_max]);
hold on;
......@@ -84,9 +83,11 @@ h = pcolor(X,Y,int);
shading('interp');
% Uncomment one of these lines if you want the coastline to be pltoted.
% Uncomment one of these lines if you want the coastline to be plotted.
if show_land
if strcmpi(show_land,'f')
if strcmpi(show_land,'fjord')
m_usercoast('fjord_coastlines.mat', 'patch', land_color)
elseif strcmpi(show_land, 'f')
m_gshhs_f('patch',land_color)
else
m_gshhs_h('patch',land_color)
......@@ -117,8 +118,9 @@ end
clear LON LAT X Y
m_grid('box','fancy','fontsize',fs);
m_grid_old('box','fancy','fontsize',fs);
%m_gshhs('f','patch', 'gray');
%print('g_rect_drone_1', '-dpng')
if nargout > 1
h_figure = gcf;
h_pcolor = h;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment