AWK and GNU Octave Programming Languages Integrated with Generic Mapping Tools for Geomorphological Analysis

The paper presents a sequential use of the AWK and GNU Octave programming languages integrated with Generic Mapping Tools (GMT) for geospatial data analysis. The geographic scope of the research is focused on the Kuril-Kamchatka Trench, north Pacific Ocean. Practical research aim is to analyse and compare bathymetry in the southern and northern part of the trench using digitized cross-section profiles. The initial mapping and geospatial analysis was performed in GMT scripting toolset. The GMT was used for cartographic mapping based on the raster ETOPO1 grid and automatic digitizing of the profiles crossing the trench perpendicularly. Besides visualized map, the processed geodata were received in a numerical form as a complex multi-field table for each segment. These tables were generated by the GMT in its native format and could not be directly processed by the MATLAB/Octave. Therefore, the tables were exported to AWK, a data-driven programming language and a powerful tool for data extraction. The table was then restructured, sorted and reshaped by the AWK script. Because the total amount of profiles overstepped 100 (62 and 52 for the northern and southern trench segments), only selected profiles were visualized. For this purpose, at the next step the modified tables were converted to GNU Octave language for visualizing and plotting selected profiles. Finally, the geomorphology was analysed and two segments compared. The results show that the southern part has deeper bathymetric values, vary in geomorphic structure and has steeper gradient slopes comparing to the north, which is caused by the seismicity, volcanism, geologic and tectonic settings. Three full scripts of GMT, AWK and GNU Octave programming languages are presented for replicability in the Appendix.


INTRODUCTION
The conceptual idea of this research consists in a chain of data processes by GMT cartographic scripting toolset and programming languages AWK and Octave. The experiment aims at the analysis of the geomorphic differences of the Kuril-Kamchatka Trench located in the north-west Pacific Ocean ( Figure 1) through the analysis of its cross sectioning profiles converted to the AWK and Octave for further processing and plotting. The geographic aim is to visualize the difference in the northern and southern parts of the trench separated by the Bussol Strait ( Figure 1). The experimental batch sequence of the data processing through three different tools is advantageous, because they were used sequentially for each step of the data analysis where they suit best: the GMT for mapping, geospatial data analysis and generating series of profiles, AWK for reshaping complex tables, and Octave for plotting graphs of the selected profiles.
The experimental novelty of this research is integration of the three tools, -GMT scripting toolset, AWK and Octave programming languages, -combined together for the geospatial data analysis and modelling aimed to study submarine geomorphology of the hadal trench. While traditional geographic data analysis is mostly based on the GIS software, the technical aim of this research is to demonstrate successful application of the advanced tools of data analysis applied specifically for the geospatial research: AWK and Octave are traditionally used in the IT domains, while geological mapping is mostly based on GIS.
Therefore, the main goal is to develop a technical methodology for the batch processing of the geospatial data by the smooth stepwise GMT-AWK-Octave workflow chain. This technical workflow also supported geomorphic studies helping to visualize and better understand structure of the trench. Usually, similar research is maintained in the GIS software, but applying advanced data processing scripting tools facilitates research through automation. Automatically digitized transect profiles are precise, finely plotted and statistically correct comparing to the hand-made vector drawing using GIS (e.g. ArcGIS or QGIS).

green) and northern (red) study segments
For this purpose, the profiles were automatically digitized by the GMT and then the data were AWK, a domain-specific programming language designed for the text processing, was used in this work for table reshaping. The AWK programming language was created at Bell Labs in the 1970s [1] and its name is derived from the surnames of its authors: Alfred Aho, Peter Weinberger, and Brian Kernighan. The GNU implementation of AWK is called GAWK. The available documentation and information on AWK was used extensively in this research [2], [3], [4]. AWK language is highly suitable for sorting multi-field records in a table due to its specially designed syntax and embedded algorithms. Other possibilities include managing small databases, generate reports based on tables, validating data, producing indexes, performing document-preparation tasks, extracting pieces of data for further processing, sorting data [5]. AWK is a data-driven scripting language integrated with commands of Unix operating system and can be run from the console. It consists of a set of codes-actions that can be taken against to operate with streams of table data [6]. AWK enables to extract or transform text, produce formatted records [7]. It uses string datatype, associative arrays indexed by key strings, and regular expressions [8]. Based on this, AWK was selected as a powerful advanced tool for the processing of tables.
The GMT scripting toolset was selected as a geospatial tool for raster grid processing, mapping and automated digitizing of the geomorphological profiles. GMT was initially developed by the American scientists, P. Wessel and P. Smith [10], further maintained and improved to finally become a powerful open source scripting toolset for the geospatial analysis and cartographic visualization. GMT is completely based on the command-line usage (see Appendix, Script #1 for the example of the GMT code presented in this paper). That being said, it is not a classical GIS. Using the full powerful functionality of GMT requires writing a script with numerous arguments for the fine-tuning and setting up of every cartographic element: projections, major and minor grids, colour palettes, map legends, visualized vector elements and annotations, adding map elements (e.g. coastlines, directional roses, scale bars) etc. However, the high cost of the steep learning curve of GMT as well as its nonvisual command line based operation pays off by its powerful functionality and excellent visualization. GMT is compatible with Unix commands (cut, rm, echo) and GDAL raster processing, it operates with both raster and vector data, produces high-quality maps and figures, has embedded functions for the descriptive statistical analysis (e.g. histograms, median, mean). All this makes it one of the most preferred data visualization and mapping toolsets by cartographers and professional geoscientists.

GEOGRAPHIC SETTINGS
The geographic focus of this work lies on the Kuril-Kamchatka Trench, an oceanic trench with depths more than 5000 m, located in the Sea of Okhotsk, north-west Pacific Ocean ( Figure 1). Geographically, the Kuril-Kamchatka Trench continues south-eastwards from the coast of the Kamchatka Peninsula, in parallel to the Kuril Island chain, and finally meets Hokkaido Island. Geologically, the Kuril-Kamchatka Trench presents a boundary of the large subduction zone of the Pacific tectonic plate under the Okhotsk tectonic plate [11], which causes irregularity in its bathymetric shapes and geomorphic structure. The submarine geomorphology of the seafloor underlying the Kuril-Kamchatka Trench is formed as a result of the complex interplay between the geological substrate, water column and a range of the geophysical processes and phenomena. As a result, the variations in the distribution of the geomorphic landforms in the trench were caused by a continuous effect of various factors through the whole history of the trench formation. The trench is characterized by a geometrically long narrow, elongate, deep and asymmetrical depression of the seafloor with steep slopes [12]. Together with Aleutian Trench, the Kuril-Kamchatka Trench presents contiguous complex covering area of 254,740 km 2 [13].
The Kuril-Kamchatka Trench is distributed along Kuril island arcs and Eurasian continent masses, developed in the association with an island-arc system where Pacific tectonic plate subducts below the North American and Okhotsk plates. The Okhotsk plate represents a region of active grabens lying southwards of a chain of small sedimentary basins in the Cherskii Mountains [14]. The geomorphic and topographic patterns of the land area of Kamchatka Peninsula are influenced by the climate and glaciological effects (glacier cirques) [15]. The Kuril-Kamchatka Trench is divided by the Bussol Strait into southern and northern parts. Because the geologic factors differ in northern and southern parts of the trench, it affects its geomorphology. The southern part of the Greater Kuril Chain includes the large Kunashir, Iturup, and Urup islands constituting the islands-arc-trench system. This part is confined to the northwestern Pacific subduction zone [16]. The topographic and geomorphic features of the trench in its northern part are different from those located further southwards near the group of the seamounts.

Methodological summary
The research aim of this paper is to analyse regional geomorphological variations in the trench in its southern and norther parts through the technical application of GMT, AWK and Octave tools. The methodological workflow aims at stepwise combination of AWK, GMT and GNU Octave, which is reflected in the methodological structure of this paper that consists of the three parts integrating advanced data processing. Brief explanation of the methodology is as follows: 1. The first step consisted in bathymetric mapping, modelling and plotting profiles using GMT by the code provided in Appendix (Script #1). The geospatial analysis was performed using GMT modules for cartographic mapping and automatic digitizing of the orthogonal profiles. As a result of this step the map was visualized ( Figure 1) using ETOPO 1 raster grid and the profiles were generated using GMT code (Script #1). The enlarged view of the profiles and their numbering are shown in Figure 2. The stacked profiles with a median as a red line and error bars are shown in Figure 3. The profiles contained information on coordinates and depths in each point across the profile (every 2 km). Sixty-two profiles were plotted for the northern and 52 profiles for the southern parts of the trench. These data were stored as two tables in GMT format. The fragment of the initial table is shown in Table 1. The geological conditions associated with the studied geomorphology were analysed using available literature on the geology of the Kuril-Kamchatka Trench. During GMT mapping (Figure 1), the geospatial data visualization methods included the following ones: selecting cartographic projections, choosing fonts and cartographic layout, ticks, scale bar, legend, annotations, colour palettes, etc. The reason for the use of GMT lies in its high effectiveness and availability of various modules designed for various tasks: plotting lines and polygons, visualizing raster data sets, digitizing cross-section profiles, etc. Because the table produced by GMT automatically during digitizing process ( Table 1) was not compatible with GNU Octave and could not be used directly for plotting, the AWK table reshaping was then performed in the second step.
2. The second step consisted of reshaping the tables that were generated automatically from GMT in the previous step. These tables were reshaped using AWK programming language provided in Appendix as Script #2. Only necessary columns and rows were selected from the initial tables using AWK script. As a result of this step, two tables were reshaped into the new ones, as shown in Table 2 (fragment) where each column now contained depth values by the profiles which could be processed by the Octave.
3. The third step consisted in the plotting graphs of the selected profiles by the GNU Octave code provided in Appendix as Script #3. After the table was converted to the necessary format through AWK manipulations (Table 2), it was then processed by the GNU Octave scripting and two graphs showing northern and southern segments of the trench were plotted ( Figure 4 and Figure 5). The GNU Octave scripting was used for visualizing and plotting graph and geomorphological analysis for the selected profiles. The trench segments were visualized in graphs ( Figure 4 and Figure 5) plotted based on the tables reshaped by AWK in the previous step. The profiles were selected taking into account the qualitative and quantitative assessment of data. Quantitative comparability consists in the repeatability of the sampling intervals: every 7 th profile in the northern segment and every 5 th profile in the southern segment until profile 40 and profile 52 respectively. Qualitative selection was based on the analysis of the bathymetric shapes: similar profiles were removed to avoid repeatability and only varying profiles were compared. More detailed explanations of each of the three steps follow below (Sections 3.2, 3.3 and 3.4).

Mapping and modelling in GMT
The methodological workflow cycle is performed by means of the GMT scripting toolset [17]. The data were collected using automatic digitizing of the series of cross-sectioning orthogonal parallel profiles 400 km long, spaced 10 km, sampled every 2 km. These were stacked using modules of GMT focusing on the bathymetric sampling. Two sample parts of the trench were studied, northern and southern ones, to make a representation of the geomorphological shape patterns of the Kuril-Kamchatka Trench. The available data sets were modelled, visualized and analysed. To achieve high resolution data, the numerical publicly available data sources in .img and .grd format were added to the GMT project from the Scripps University of Oceanography San-Diego California, US ftp://topex.ucsd.edu/pub.

Figure 2. Enlarged view of the profiles: numbering starts from south to north for both segments
The data were then recompiled and reprocessed technically using combination of various GMT modules: gmtset, gmtdefaults, grdcut, makecpt, grdimage, psscale, grdcontour, psbasemap, psxy, grdtrack, convert, pstext, logo, psconvert. Following UNIX utilities were used additionally: echo (aim: placing the text), rm (removing tempfiles), cat (visualizing the file content in the shell console). Shorelines and continent vector data are taken from the available embedded GMT layers [18].

Figure 3. Median stacked profiles with error bars for the southern (A) and northern (B) segments
The essence of this processing is as follows (the explanations below refer to the presented Script#1, see Appendix for the full GMT code).
Step-1, the postscript (ps) file was generated in the Step-1 and saved in the working folder.
Step-2 includes the set-up of the GMT format (map aesthetics: font size, title offset, frames, etc.).
Step-3 includes overwriting of the default GMT values for the aesthetics by the new ones.
Step-4 includes cutting off necessary piece of map from the raster grid using 'grdcut' module. The coordinates of the square are given by the -R command (-R140/170/40/60).
Step-5 includes making colour palette using 'makecpt' module where the range is set up by -T.
Step-6 shows visualization of the raster using gmt 'grdimage' module where the -I+a15+ne0.75 shows illumination (shadows for the relief).
Step-7 consists in adding vertical colour legend. Because some of the annotations were made smaller than on the main map, the font set up was overwritten for this step.
Step-8 adds contour shorelines on the map, where -R -J means the same projection and region as on the main raster grid. '-C1000' means plotting contours every 1000 meters. '-W0.1,black' means the thickness and colour of the contour line.
Step-9 is adding the grid using 'psbasemap' module. -Bxg4f2a4 -Byg4f2a4 means adding major and minor grids every 4 and 2 degrees, and annotations every 4 degrees respectively. Step-10 consists in dotting two points by coordinates (here for northern segment).
Step 11 means plotting the lines between these two points using module 'psxy'.
Steps 12, 13 and 14 consists in automatic digitizing profiles 400 km long, spaced 10 km, sampled every 2km using module 'grdtrack' and converting data into table by module 'convert'.
Steps 15-18 repeat the same procedure for the southern segment.
Step-19 consists in adding texts on the map by coordinates. For example, '-F+f16p,Times-Roman,blue+jLB' means text of 16 pt size, Times New Roman, blue and Left Bottom justified.
Step-20 is adding vector arrow pointing at the Bussol Strait.
Step-21 is adding a subtitle by the module 'pstext'.
Step-22 is adding the GMT logotype.
The last step is converting the map through the 'psconvert' module into the jpg file with 720 resolutions, portrait orientation and margins 0.5 c.
More detailed explanations can be found in the cartographic documentation of GMT [10].

AWK programming language for table reshaping
The AWK part of the research followed GMT aimed at table processing. The .csv table was run directly as a file following by a set of the temporary files (tempfiles) created to store the selected columns from the initial tables as part of a script pipeline. The AWK script (see Appendix Script#2) was used for reshaping initial table ( Table 1) that was received directly from GMT as a result of the automatically digitized profiles. This table was then reshaped by AWK into the second table ( Table 2) that now had a structured view with columns containing only necessary data: depths (m) and profile length (from -200 to 200 m, according to the stretch). The main task of the reshaping was to select useful information from the initial huge table that contained 12726 rows and 5 columns. Therefore, during this procedure the unnecessary rows were removed, and only necessary columns were selected. The AWK research steps were done consequentially as explained below stepwise.
Initially, the working directory was set up to store all the files (both temporary and main ones) in this folder (cd /Users/pauline/Documents/Octave) which was then controlled by 'pwd' check. Then the input file (table2.csv) was read in into AWK environment in units (records) processed by the embedded syntax rules of the AWK one record at a time line by line [19]. Each record was automatically split into pieces, that is fields of the table making it more convenient for AWK to work on the parts of a table [20].
Step-1. At the first step the series of the temporary files was created where all the preliminary results were stored (TMPFILE0… TMPFILE10) using Unix: mktemp utility. Several kinds of tasks occurred repeatedly when working with table file received from GMT: extracting columns one by one from the initial file and then storing them as separate files. Therefore, certain lines were extracted from the table and the rest was discarded at this step.
Step-2. The initial GMT tables for two segments of the profiles contained 62 and 52 profiles for northern and southern parts respectively. Therefore, at this step only two necessary columns were selected using AWK predefined variable 'FS' (field separator) as space. That means, in both input and output data (output field separator as 'OFS') the items were separated by single spaces: 'BEGIN{FS=" "; OFS=" "}'.
Step-3. Now only profile 1 was selected and saved as a separate table as 'table_10pr' with X and Y (location and depths).
Step-4. Only Y column (field 5) was taken from the initial table. This column contained depths for all profiles, for example for the northern segment these are 12726 rows.
Step-5. The profile I was selected consequentially from Y column. This is done using command printing section of file between two regular expressions (regex). Patterns in awk control the execution of rules when its pattern matches the current input record. The following is an example of the AWK snippet code in this case: awk '/-L0-07/,/-L0-08/' $TMPFILE1 > table_p07.csv. This means that in the case all the data between lines L0-07 and L0-08 were taken and a new mini-table was created. This table now contained information for the depths in all points along the profile nr. 7. Then the same procedure was repeated for all other profiles. The regular expression that matches the text of the table ('/-L0-07/,/-L0-08/') is put between the slash lines, like this: /regular expression/.
Step-6. At this step the single Y column of the profile i was added to the table (for example, 'table_10p.csv'). Then, the output was saved to 'table_10Kuril-Kamchatka Trench.csv'. Making these modifications in the table was done using patterns (see AWK script), but leaving the rest of the table file alone. The same procedure was repeated for the southern segment using the same regular expression as a template.
Step-7. Now the header and tail were deleted from the output table using the AWK expression that prints only lines which do not match regex.
Step-8. The auxiliary files were removed by the 'rm'.
Step-9. The number of lines was counted for the initial table. In this case, the initial table (table2.csv) had 12726 lines.
Step-10. Finally, the number of lines was counted for the output table. In this case the final table (table_10Kuril-Kamchatka Trench.csv) had only 201 lines (against previous 12726).
As can be noticed, the presented AWK script consists of expressions that are the basic building blocks of AWK patterns and actions. An expression performed in each step of the script evaluates to a value that was printed and consequentially passed to the next expression at the following step in the script. For the case of the temporary files (Step-5), a series of expressions assigned a new value to the table variables using an assignment operator. AWK expressions extensively used in the script served as a pattern for the selected geomorphological profiles along the whole length of the trench, thus facilitating the repeatability of the research steps.
The final output table was reshaped in view, that is columns became rows. Azimuth and absolute coordinates were deleted from the table. As a result, the output table contained 201 rows and 11 columns and initial long table has been reshaped. The new structure of the table is as follows: column 1 contains cross-section line 400 km long (-200:200 km). Columns 2-11 contains depths for the cross-section profiles. Unix programs and utilities used additionally included: 'mktemp' for creating a series of temporary files and 'rm' for removing preliminary temporary files. The final table was then processed in GNU Octave language for the visualization of the cross-section profiles.

GNU Octave plotting
The final part of the research contains plotting graphs by presented Script #2 (see Appendix) in GNU Octave programming language to visualize selected graphs of the geomorphology. The plotting was done using available technical documentation [21]. The Figures 4 and 5 show selected graphs of the profiles made on the basis of the table created in the previous step by AWK and further visualized in GNU Octave using provided script of 'm-file' with an example of the northern segment (see Script #2). The southern part was repeated using the same script template using corresponding table and necessary minor amendments (numbers of profiles, depths, corresponding for the southern segment).  Figure 2. The direction of each profile is NW-SE, i.e. from the Sea of Okhotsk and Greater Kuril Chain directed to the Pacific Ocean. Using Octave, a comparative analysis of the geomorphology in selected profiles crossing the Kuril-Kamchatka Trench was performed visualizing the "V" shape of the Kuril-Kamchatka Trench which can be noticed in a series of the cross-section profiles (Figure 4 and Figure 5). The Octave graphs (Figure 4 and Figure 5) highlighted the geomorphic patterns in the northern and southern parts of the trench visualizing variations in depths and geomorphic shapes. Southern part of the trench proved to have deeper bathymetric ranges and steeper trench gradient slope, which is caused by the intensive seismicity and volcanic activities in this particular area of the trench.

RESULTS
GMT/AWK/Octave sequential data processing, automatic digitizing of the orthogonal profiles and graphical plotting based on various algorithms of the data analysis have been tested as an experimental design of this research, aimed to visualize two morphological patterns along the southern and northern segment flanks of the Kuril-Kamchatka Trench. Comparing the resulting two graphs (Figure 4 and of the trench affected by numerous earthquakes located on the Kamchatka Peninsula is influenced by a large amount of the accumulated sediments. Necessarily, it forms the shallower depths and gentle flat slopes in the morphology of the northern part of the Kuril-Kamchatka Trench. The results of the dataset analysis were compared and found out that profiles located in the southern and northern parts vary in depths and geomorphic steepness, due to the impact of the geological settings and seismicity.

Figure 4. Northern part of the geomorphology of the Kuril-Kamchatka Trench: a graph based on the table reshaped by AWK script
In general, the profiles in the northern part of the trench show deeper values and less steep slopes comparing to the southern segment, which refer to the erosional moats and drift of the submarine sediments. On the contrary, the southern part of the trench has deeper bathymetric ranges and steeper trench gradient slope, comparing to the northern part. This can be influenced by the intensive seismicity and volcanic activities in this particular area of the trench. Furthermore, the trench forms a more V-shaped valley in its southern segment with about 3 km wide in profiles and more U-shaped form in the northern part. The shape of the slopes and steeper morphology of the southern part is affected by the specific geophysical conditions of the southern part of the Kuril Islands  The oceanic trenches are associated with tectonic subduction zones. Therefore, besides the geological factors, the trench geomorphology is necessarily affected by the local tectonic settings. The seafloor spreading creates an axial rift and hills. Spreading ridges are formed by the nearby faults, where subduction of the cooled tectonic plate into the mantle causes the creation of the deep ocean trenches [22]. As a consequence, the major earthquakes occur along the Kuril-Kamchatka trench. Various geophysical factors affect the geomorphological structure of the trench and cause variations in its morphological structure [23], among which tectonics plays the major role in the trench formation. For the case of the Kuril-Kamchatka Trench, two tectonic plate have responses to its tectonic history, which could be caused by the ongoing subduction of the major Pacific Plate under the minor Okhotsk tectonic plate [24]. The Okhotsk plate is a region of the active grabens located southwards of a chain of small sedimentary basins in the Cherskii Mountains, North Russia [25]. In principle, the collision of the tectonic plates could be the one more reason that has affected both the Kuril-Kamchatka trench motion and the morphology of the subducting Pacific plate at depth in the northern and southern parts of the trench that could be sliced in the two distinct morphologies in its northern and southern parts. The distinct changes in the trench geomorphology is illustrated by [26] where they show changes between the slab beneath the horizontal slab and vertical arcs with a case study of Mariana trench area. The variations in physical properties within the slab could be the result of the distortion of the Pacific plate as its shape transforms between near horizontal to near vertical, as well as change in the velocity of the subduction plate, or a combination of all these factors.
The seafloor of the trench presents a background for all geological, oceanological and geochemical processes that are necessarily reflected in its shape. Thus, the main morphostructure elements of the seafloor are the outskirts of the continents, tectonic plates and ocean bedrock. The structure of the trench and the nature of its geomorphic shape are therefore greatly complicated by the multiple secondary tectonic disturbances: system of faults, displacements of grabens, horsts and lateral geologic shifts [27]. The interconnection of these complex processes is also illustrated by recent findings [28] that demonstrates correlation between the back-arc deformation and upper continental tectonic plate velocity. The trench migration rates are also mainly controlled by the lower continental tectonic plate velocity [29], which in turn depends on the tectonic slab age buoyancy [30]. More detailed study on the tectonic impact goes beyond the scope and size of this manuscript which aims at development of the technical methodology of the batch geodata processing by GMT, AWK and Octave as a chain methodological workflow. As a suggestion for further studies on this phenomena, a comparative analysis of the subduction speed of the tectonic plates in the northern and southern parts of the trench could be performed in a separate research based on the availability of the precise geophysical and seismic data.

CONCLUSION
Combination of various data analysis tools, such as GMT scripting toolset, AWK and Octave programming languages for sorting and reshaping data, plotting graphs and mapping enabled to create a geospatial analysis of the selected specific areas of the Pacific Ocean -the Kuril-Kamchatka Trench. Successful application of the programming languages and advanced statistical tools towards geospatial data analysis has been demonstrated in various papers: Python [31], [32], [33], Fortran language [34], [35], [36], R language [37], [38], [39], [40], SPSS IBM Statistics [41], [42], [43], Gretl GNU Regression, Econometrics and Time-series Library for Statistical Analysis [44]. However, only few examples were given so far specifically for AWK language and its application is traditionally limited by the IT domains [45], [46]. In this paper, I contribute to filling the gap in the need for using such effective language as AWK [47] in the geological and Earth sciences and absence of the practical examples and full codes that are always useful besides technical manuals.
Understanding complex interrelation and spatial variation of the geological and geophysical factors affecting the Kuril-Kamchatka Trench is crucial to analysis of its geomorphic patterns. Various factors contribute to the trench geomorphology and shape: motion of the Pacific plate subduction to the adjacent small Okhotsk plate, seismicity and location of the earthquakes. Special geophysical settings, geological parameters and special sedimentation processes induced by active volcanism and seismicity in the region are among the crucial factors affecting trench geomorphology. Geological settings of the Kamchatka region in general are notable for the mountains chains in the adjacent land, recorded active seismicity and magmatism, steep gradients of the mountains Hokkaido and Sakhalin islands, and Kamchatka Peninsula, as well as frequent earthquakes and erodible lithology. Necessarily, these factors contribute towards the active sedimentation processes which in turn affect the geomorphology of the trench. Large amounts of the sediments are being transported to the Okhotsk Sea and then driven in SE direction from the Hokkaido and NW from the Kamchatka Peninsula to the neighbouring Kuril-Kamchatka Trench.
The study illustrated variations in the geomorphic patterns of the Kuril-Kamchatka Trench by means of a sequential usage of the advanced scripting toolset: GMT, AWK and GNU Octave programming languages. The orthogonal cross-sections from the 2D profiles along the two studied parts of the trench were automatically digitized and processed by GMT and initial tables converted to GNU Octave via AWK. Three scripts used in GMT, AWK and GNU Octave are presented in full to enable replicability of this research. The paper has a multidisciplinary nature combining IT programming instrumentation with geospatial data analysis and cartography in GMT.

Competing interests:
The author declares no competing interests.