Simple swath 2D plot
CL_plot_swath(pos [, win_id, style, color_id, data_bounds])
Plots a 2D longitude/latitude swath.
The swath is defined by several "trajectories", from leftmost to rightmost or vice versa. For instance:
- For 2 trajectories: trajectory1 = left side, trajectory2 = right side.
- For 3 trajectories: trajectory1 = left side, trajectory2 = middle, trajectory3 = right side.
The trajectories (pos) can be given in 2 ways:
- list: list(pos1, pos2,... ), where posk is a trajectory in cartesian coordinates (3xN).
- hypermat(3,:,:): pos(:,:,k) is then the kth trajectory (size = 3xN).
The swath can be plotted using the following styles:
- style = "f" ("fill"): polygons made from positions at index k and k+1 are filled with color k.
- style = "c" ("contour"): polygons made from positions at index k and k+1 are plotted with color k.
- style = "s" ("segment"): segments made from positions at index k are plotted with color k.
Notes:
- If style == "f" or "c", the last color index is not used.
- The function implements a simple algorithm using the longitudes only to detect if a polygon contains a pole.
The algorithm works if the positions define the points of a "real" swath whose width on Earth is less than 180 deg, Otherwise, results are unpredictable.
- The plotted longitudes are spherical longitudes.
- Polygons or segments that contain %nan are ignored.
- The function creates only one graphical entity. Properties can be changed after the call, for instance by:
h = CL_g_select(gce(), "Polyline"); h.line_mode = "on"; h.foreground = color("black");
Points describing the swath in cartesian coordinates. (3xNxP) or list(3xN). See above for details.
(integer or window handle, optional) Figure Id. Id of current window if omitted.
(string, optional) The style used to draw the swath: "f", "c" or "s". Default is "c". (1x1)
(integer, optional) Vector of color indices used to draw the swath. Default: black color (1xN or 1x1)
(optional) View area: [longmin, latmin; longmax, latmax] in degrees. Default is [-180, -90; 180, 90].
CNES - DCT/SB
// Generate orbit t0 = 0; // initial time kep0 = [7200.e3; 0; 1.4; 0; 0; 0]; // orbit parameters t = t0 + (0 : 1 : 95) / 1440; // days kep = CL_ex_kepler(t0, kep0, t); // orbit propagation [pos, vel] = CL_oe_kep2car(kep); // inertial position and velocity // Generate swath points (arbitrary radius) ang = 0.3; // "center angle" (rad) p1 = CL_fr_qsw2inertial(pos, vel, [cos(ang); 0; sin(ang)]); p2 = pos; p3 = CL_fr_qsw2inertial(pos, vel, [cos(ang); 0; -sin(ang)]); // Plot (filled, continuous colors) f = scf(); f.color_map = jetcolormap(101); colorbar(t(1)*1440, t($)*1440, colminmax = [1, 101]); CL_plot_swath(list(p1, p2, p3), style = "f", color_id = 1+ round(100*t/t($))); |