SE_GEOwindows β Geographic Coverage & Sub-Area Map Windows
SE_GEOwindows (code/SE/SE_GEOwindows.c, code/SE/SE_GEOwindows.h) manages the geographic map windows in swathed: the full-area overview window (sub_window[1], titled "Terrain Coverage : <grid>" or "Geographic Coverage") and the zoomable sub-area window (sub_window[2], titled "sub_area"). Authored by John E. Hughes Clarke (July 1999), it links georeferenced gridded bathymetry (.r4) and sidescan/backscatter mosaics (.8bit/.mos) directly to multibeam survey lines (.merged), supporting spatial ping lookup, sun-illuminated relief generation, corridor selection for SE_2Dwindow and SE_PATCHwin, and target/cleaned-box tracking.
Window Architecture & Initialization
sub_window[1](Main Geographic Overview):- Initialized by
setup_main_area()when-locate <grid.r4>is passed on the command line, or bysetup_blank_area()when clicking thegeoicon (icon_window[14]) without a background grid (sizing the map bounds automatically from.global_boundsfiles viacheck_global_bounds()). - Supports standard buffered file I/O (
read_farray) or memory-mapped I/O (mmap_farraywhen-nmap/use_nmapis enabled) for large.r4grids, plus up to 50 co-registered.8bitsidescan mosaics (ss_image[]) loaded viaload_images().
- Initialized by
sub_window[2](Zoomed Sub-Area Window):- Created dynamically by
view_subimage(left, right, bottom, top)when the user drags a left-mouse rubber-band box insub_window[1]. - Scaled up to 400Γ400 pixels with optional bilinear interpolation (
smooth_sub_area()whensmooth_flagis active) and panned in half-window increments viashift_subimage(dir)using arrow keys.
- Created dynamically by
Core Subsystems & Algorithms
1. Synthetic Sun-Illuminated Relief (setup_sunmap)
When displaying a .r4 bathymetric grid, setup_sunmap() computes a shaded-relief byte array (sun_array) controlled interactively by SE_TOOLBOXwin:
- Evaluates local east-west and north-south depth gradients (
dz/dx,dz/dy), scales them by vertical exaggeration (exag), and computes the surface normal dot product against the illumination vector defined byazi($0^\circ, 90^\circ, 180^\circ, 270^\circ$) andelev($0^\circ\text{β}90^\circ$). - Depending on
colormap_flag(SUN,DEPTH, orSS_IMAGE),prime_main_area()andprime_sub_area()blend depth hue and sun-illumination intensity into 8-bit/24-bit XImage buffers (main_image,sub_image).
2. Spatial Ping Lookup Table (set_up_LUT & <prefix>.lookup)
To allow instant middle-click jumping from any pixel on the map to the corresponding survey file and ping number:
set_up_LUT()allocates a 32-bit integer arrayref_tablematching the pixel dimensions ofsub_window[1].- If
<grid_prefix>.lookupexists on disk (-lookup), it reads the precomputed table; otherwise, it iterates through all loaded.mergedfiles (no_in), projects each pingβs nadir coordinate (profile.latitude,profile.longitude) viaproj(), and packs(file_no << 16) + ping_nointoref_table, saving<grid_prefix>.lookupfor subsequent sessions. - Middle-clicking (
Button2) insub_window[1]orsub_window[2]searches a 7Γ7 pixel spiral (search[49][2]) around the cursor inref_table, unpacksfileandrecno, and loads the 80-swath block centered on that ping.
3. Spatial Indexing & Corridor Overlays
- Fast Bounding-Box Culling (
check_swath_in_area,check_random_in_area): Reads<line>.merged.100_ping_bounds(swath_bounds) to test whether 100-ping segments intersect a geographic sub-box before reading full.mergedrecords. - Rotatable Corridor Box (
plot_rot_box): Renders the oriented rectangular corridor (Ecen,Ncen,rect_width,rect_height,rect_angle) used bySE_2Dwindow,SE_BSwindow, andSE_PATCHwin, drawing the viewing-direction arrow (NORTH,SOUTH,EAST,WEST) and slice bounds. - Cleaned Area & Target Overlays:
load_cleaned()anddump_cleaned()read/write<prefix>.cleaned_areas, rendering completed editing sub-boxes in red onsub_window[1](marked viacinsub_window[2], cleared vian).load_targets(),add_target(),write_targets(), andload_vectbin()overlay point targets (.tgt/ target files) and binary coastline/contour vectors on both map windows.
Interactive Mouse & Keyboard Controls
| Window | Input | Action |
|---|---|---|
sub_window[1] | Left-drag | Rubber-band a geographic sub-area and open/update sub_window[2] (view_subimage()). |
sub_window[1] / [2] | Middle-click | Query ref_table (5-pixel radius) and load the nearest survey line and ping into swathed; print cursor Lat/Lon to terminal. |
sub_window[2] | Left-click / Right-click | When 2D, Class, or Patch is active, repositions the corridor center (Ecen, Ncen) or rotates rect_angle toward the cursor. |
sub_window[2] | Arrow keys | Pan sub_window[2] North, South, East, or West by half the sub-window span (shift_subimage()). |
sub_window[2] | [ / ] | Narrow or widen the corridor width (rect_width) for 2D/Patch/BS analysis. |
sub_window[2] | c / n | Mark the current sub-area as cleaned (dump_cleaned()) / clear all cleaned sub-area boxes. |
sub_window[1] / [2] | t / w | Jump to the closest acoustic target (.tgt) near the cursor (t) or write updated targets to disk (w). |