diff --git a/documents/Readme.pdf b/documents/Readme.pdf index 9953e4d..65bed5a 100644 Binary files a/documents/Readme.pdf and b/documents/Readme.pdf differ diff --git a/documents/Step_01_download_ross_front_atl06_data.html b/documents/Step_01_download_ross_front_atl06_data.html index c5b208b..6fd7c93 100644 --- a/documents/Step_01_download_ross_front_atl06_data.html +++ b/documents/Step_01_download_ross_front_atl06_data.html @@ -13084,8 +13084,11 @@

-

This notebook uses the icepyx library (Scheick et al., 2019; https://github.com/icesat2py/icepyx) to download spatially and temporally subsetted ATL06 granules from the National Snow and Ice Data Center. Running this notebook should result in the download of these granules in the location defined by the variable 'path' in last code block. Adjust path according to your own workflow.

+

This notebook uses the icepyx library (Scheick et al., 2019; https://github.com/icesat2py/icepyx) to download spatially and temporally subsetted ATL06 granules from the National Snow and Ice Data Center. Running this notebook should result in the download of these granules in the location defined by the variable 'path' in the last code block. The user should adjust the path according to their own workflow.

This script implements the ATL06-specific methods described in Subsection 2.2 of Becker et al. (2021).

+

Susan L. Howard, Earth and Space Research, showard@esr.org

+

Maya K. Becker, Scripps Institution of Oceanography, mayakbecker@gmail.com

+

Last updated April 15, 2021

@@ -13245,7 +13248,7 @@

-

Order all granules that meet the Query object's parameters. We do not use any variable subsetting.

+

Order all granules that meet the Query object's parameters, in this case without any variable subsetting

diff --git a/scripts/Step_01_download_ross_front_atl06_data.ipynb b/scripts/Step_01_download_ross_front_atl06_data.ipynb index 4f9014b..1c5c677 100644 --- a/scripts/Step_01_download_ross_front_atl06_data.ipynb +++ b/scripts/Step_01_download_ross_front_atl06_data.ipynb @@ -11,9 +11,15 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "This notebook uses the icepyx library (Scheick et al., 2019; https://github.com/icesat2py/icepyx) to download spatially and temporally subsetted ATL06 granules from the National Snow and Ice Data Center. Running this notebook should result in the download of these granules in the location defined by the variable 'path' in last code block. Adjust path according to your own workflow.\n", + "This notebook uses the icepyx library (Scheick et al., 2019; https://github.com/icesat2py/icepyx) to download spatially and temporally subsetted ATL06 granules from the National Snow and Ice Data Center. Running this notebook should result in the download of these granules in the location defined by the variable 'path' in the last code block. The user should adjust the path according to their own workflow.\n", "\n", - "This script implements the ATL06-specific methods described in Subsection 2.2 of Becker et al. (2021)." + "This script implements the ATL06-specific methods described in Subsection 2.2 of Becker et al. (2021).\n", + "\n", + "Susan L. Howard, Earth and Space Research, showard@esr.org\n", + "\n", + "Maya K. Becker, Scripps Institution of Oceanography, mayakbecker@gmail.com\n", + "\n", + "Last updated April 15, 2021" ] }, { @@ -129,7 +135,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Order all granules that meet the Query object's parameters. We do not use any variable subsetting." + "### Order all granules that meet the Query object's parameters, in this case without any variable subsetting" ] }, { diff --git a/scripts/Step_02_build_structure_from_h5_files.m b/scripts/Step_02_build_structure_from_h5_files.m index 092d141..31a05f0 100644 --- a/scripts/Step_02_build_structure_from_h5_files.m +++ b/scripts/Step_02_build_structure_from_h5_files.m @@ -1,46 +1,44 @@ % This script builds and saves a MATLAB structure with all relevant information % from the HDF5 files downloaded in Step 01 and plots the approximate ice- % shelf front location for each ground track profile over the mask from Depoorter -% et al. (2013). The user should specify the location of the HDF5 files with -% variable 'data_dir,' which should match the path specified at the end of -% the Step 01 Jupyter Notebook, as well as the location of the *.mat file +% et al. (2013). The user should specify the location of (1) the HDF5 files +% with the variable 'data_dir,' which should match the path specified at the +% end of the Step 01 Jupyter Notebook, and (2) the location of the *.mat file % containing the Depoorter et al. (2013) mask data. % % This script implements part of Step (i) described in Subsection 2.3 of % Becker et al. (2021). % % NOTE: This script calls the Antarctic Mapping Tools 'll2ps' function -% (Greene et al., 2017), which can be downloaded from the Mathworks File +% (Greene et al., 2017), which can be downloaded from the MathWorks File % Exchange: -% https://www.mathworks.com/matlabcentral/fileexchange/47638-antarctic-mapping-tools +% https://www.mathworks.com/matlabcentral/fileexchange/47638-antarctic-mapping-tools. % % Susan L. Howard, Earth and Space Research, showard@esr.org % Maya K. Becker, Scripps Institution of Oceanography, mayakbecker@gmail.com % -% Last update: April 14, 2021. -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Last updated April 16, 2021 +%%%%%%%%%%%%%%%%%%%%%%%%%%%% Begin user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%% work_path = pwd; - out_filename = 'ross_files.mat'; % output filename -data_dir = 'D:\ICESat2\ross_data_download\ '; % should match the path specified at the end of the Step - % 01 Jupyter Notebook - -load 'Depoorter_et_al_2013_mask.mat'; % Load mask from Depoorter et al.(2013) +data_dir = 'D:\ICESat2\ross_data_download\'; % change to match the path + % specified at the end of + % the Step 01 Jupyter Notebook + +load 'Depoorter_et_al_2013_mask.mat'; % load mask from Depoorter et al. (2013) - - -%%%%%%%%%%%%%%%%%%% end user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cd(data_dir) all_files = dir('*.h5'); number_of_files = length(all_files); % Create variables for the approximate front locations in the ground track -% profiles-- for each front crossing, we keep track of the x and y locations -% on either side of crossing (ocean to ice shelf mask change, described -% below) +% profiles. For each front crossing, we keep track of the x and y locations +% on either side of the crossing (determined by the change in mask value +% from ocean to ice shelf, described below). front_x = zeros(number_of_files,6,2); front_y = zeros(number_of_files,6,2); @@ -51,8 +49,8 @@ beams = ['1r'; '1l'; '2r'; '2l'; '3r'; '3l']; -% Use Depoorter et al.(2013) mask -- Mask values are: 0: ocean, -% 1: land and grounded ice, 2: ice shelf--and plot it as a basemap +% Plot the Depoorter et al. (2013) mask as a basemap. Mask values are as +% follows: 0 = ocean, 1 = land and grounded ice, and 2 = ice shelf. [SM.X,SM.Y] = meshgrid(SM.x,SM.y); @@ -63,19 +61,21 @@ axis([-700 550 -1550 -1075]) hold on -ross_files = struct; -structure_entry = 0; - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Read relevant variables from each beam of each ATL06 file, check for -% front crossings based on mask, and store in structure +% Read the relevant variables from each beam of each ATL06 file, check for +% a front crossing based on the mask, and store the variables in the structure +% 'ross_files' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ross_files = struct; +structure_entry = 0; + for i = 1:number_of_files % Loop through all six beams of each file, pulling all relevant % variables--refer to ATL06 data dictionary for variable/attribute - % description: https://nsidc.org/data/atl06 + % description: + % https://nsidc.org/sites/nsidc.org/files/technical-references/ATL06-data-dictionary-v001.pdf for j = 1:length(beams) @@ -94,7 +94,7 @@ dem_h = h5read([data_dir '/' all_files(i).name], ['/gt' beams(j,:) '/land_ice_segments/dem/dem_h']); dem_flag = h5read([data_dir '/' all_files(i).name], ['/gt' beams(j,:) '/land_ice_segments/dem/dem_flag']); sc_orient = h5read([data_dir '/' all_files(i).name], '/orbit_info/sc_orient'); - % Flag values: ['0', '1', '2'], flag meanings: ['backward', 'forward', 'transition'] + % spacecraft orientation parameter values: ['0', '1', '2']; value meanings: ['backward', 'forward', 'transition'] x_atc = h5read([data_dir '/' all_files(i).name], ['/gt' beams(j,:) '/land_ice_segments/ground_track/x_atc']); y_atc = h5read([data_dir '/' all_files(i).name], ['/gt' beams(j,:) '/land_ice_segments/ground_track/y_atc']); product = all_files(i).name(11:15); @@ -103,7 +103,7 @@ region = all_files(i).name(38:39); % Determine the beam type, i.e., whether it is strong or weak, - % using the value of 'sc_orient' (spacecraft orientation) + % using the value of 'sc_orient' if sc_orient == 1 @@ -133,7 +133,7 @@ end % Convert latitude and longitude coordinates to polar stereographic - % map coordinates using 'll2ps' function (Greene et al., 2017) + % map coordinates using the 'll2ps' function (Greene et al., 2017) [x,y] = ll2ps(lat,lon); @@ -148,8 +148,8 @@ [a,b] = size(mask_interp); % Set the ellipsoidal height data ('h_li' in the ATL06 data - % dictionary) values greater than 3e38, and their corresponding - % locations, to NaN + % dictionary and here) values greater than 3e38, and their + % corresponding locations, to NaN nan_idx = find(h_li > 3.e+38); @@ -161,11 +161,12 @@ % Loop through the interpolated mask values, calculating the % difference between each value and the next. A difference value - % greater than 1 denotes an ice-shelf front crossing (ocean = 0, - % ice shelves = 2); there should only be one ice-shelf front - % crossing per beam/ground track profile. Only information from - % beams that show a transition from ice shelf to ocean is - % included in the structure. + % greater than 1 denotes an ice-shelf front crossing (because + % the ocean mask value is 0 and the ice-shelf mask value is 2); + % there should only be one ice-shelf front crossing per + % beam/ground track profile. Only information from beams that + % show a transition from ice shelf to ocean is included in the + % structure. for k = 1:a-1 @@ -259,9 +260,7 @@ gt_count = structure_entry; -% Save final 'ross_front_crossings' structure and other relevant parameters -% to a *.mat file +% Save final 'ross_files' structure and other relevant parameters to a +% *.mat file save(out_filename, '-v7.3', 'ross_files', 'gt_count', 'front_y', 'front_x') - - diff --git a/scripts/Step_03_detect_front.m b/scripts/Step_03_detect_front.m index 34c94f1..60cc2c0 100644 --- a/scripts/Step_03_detect_front.m +++ b/scripts/Step_03_detect_front.m @@ -5,69 +5,66 @@ % various data on the front crossing. % % This script implements part of Step (i) and steps (ii)-(iv) described in -% Subsection 2.3 of Becker et al. (2021). +% Subsection 2.3 of Becker et al. (2021). This text also describes choices +% for cleaning up the data, specifically assessed for Ross Ice Shelf. % % Susan L. Howard, Earth and Space Research, showard@esr.org % Maya K. Becker, Scripps Institution of Oceanography, mayakbecker@gmail.com % -% Last update: April 14, 2021. -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - +% Last updated April 16, 2021 +%%%%%%%%%%%%%%%%%%%%%%%%%%%% Begin user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%% load 'ross_files.mat' % *.mat file created in Step 02 -out_filename = 'ross_front_crossing_data.mat'; % output filename - +out_filename = 'ross_front_crossing_data.mat'; % output filename ref_time = datenum(2018,01,01); % reference time for all ground track profiles -mdt = -1.4; % constant value to use for the MDT correction. - - -% set h_ss ((instantaneous sea surface) outlier values -hss_low=-5; -hss_high=100; +mdt = -1.4; % constant value to use for the MDT correction +h_ss_low = -5; % lowest allowable instantaneous sea surface (h_ss) value +h_ss_high = 100; % highest allowable h_ss value % Set various criteria that a ground track profile jump must satisfy in % order to be classified as representing the ice front by the % front-detection algorithm -h_a_upper_limit = 2; % upper limit of the height of the ocean point in the - % front jump -h_diff_lower_limit = 10; % lower limit of the height increase that - % constitutes a front jump -h_diff_upper_limit = 100; % upper limit of the height increase that - % constitutes a front jump +h_a_upper_limit = 2; % upper limit of the height of the ocean + % point in the front jump + +h_diff_lower_limit = 10; % lower limit of the height increase that + % constitutes a front jump + +h_diff_upper_limit = 100; % upper limit of the height increase that + % constitutes a front jump + jump_x_dist_upper_limit = 80; % upper limit of the along-track distance over % which a front jump could occur - - - -%%%%%%%%%%%%%%%%%%%%%%% end user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Clean data & apply geophysical corrections +% Clean up the structure and apply geophysical corrections to the data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Clean up the structure from Step 02. Looping through each structure entry/ % ground track profile, first set the h_li values to NaN for segments for -% which the interpolated Depoorter et al. (2013) mask value indicates that +% which the interpolated Depoorter et al. (2013) mask values indicate that % they occur over grounded ice, and then do the same for segments for which % the quality summary parameter ('atl06_quality_summary' in the ATL06 data -% dictionary) value indicates some sort of data-quality issue. +% dictionary) values indicate data-quality issues. ross_files_clean = ross_files; for i = 1:gt_count grounded_ice_inds = find(ross_files_clean(i).mask == 1); - % value of 1 indicates grounded ice + % mask value of 1 indicates grounded ice ross_files_clean(i).h_li(grounded_ice_inds) = NaN; bad_quality_inds = find(ross_files_clean(i).quality_summary_flag == 1); - % value of 1 indicates some potential data-quality problem + % parameter value of 1 indicates some potential data-quality problem ross_files_clean(i).h_li(bad_quality_inds) = NaN; end @@ -77,8 +74,7 @@ % ocean tides, inverted barometer effects (IBE), and mean dynamic topography % (MDT). Obtain values for the geoid height and ocean tides and IBE corrections % from the ATL06 product itself; apply a constant value for the MDT -% correction. - +% correction (which was set in the user input section). for i = 1:gt_count @@ -89,17 +85,17 @@ end -% For each ground track profile, remove outliers of h_ss (limits -% set in user input section), and generate a new variable, 'x_dist,' -% which gives the difference in along-track x-coordinate between the first -% ATL06 segment and each successive segment +% For each ground track profile, remove outliers of h_ss (the limits for +% which were set in the user input section), and generate a new variable, +% 'x_dist,' which gives the difference in along-track x-coordinate between +% the first ATL06 segment and each successive segment for i = 1:gt_count - low_h_ss_inds = find(ross_files_clean(i).h_ss < hss_low); + low_h_ss_inds = find(ross_files_clean(i).h_ss < h_ss_low); ross_files_clean(i).h_ss(low_h_ss_inds) = NaN; - high_h_ss_inds = find(ross_files_clean(i).h_ss > hss_high); + high_h_ss_inds = find(ross_files_clean(i).h_ss > h_ss_high); ross_files_clean(i).h_ss(high_h_ss_inds) = NaN; ross_files_clean(i).x_dist = ross_files_clean(i).x_atc - ... @@ -108,7 +104,8 @@ end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Create structure for ice front crossings +% Create a new structure, 'ross_front_crossing_data,' for the ice-front +% crossings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Create a new structure that expands upon the cleaned-up version of the @@ -152,6 +149,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Run the front-detection algorithm for each ground track profile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + for i = 1:gt_count disp(i) @@ -177,9 +175,10 @@ % Calculate 'h_diff,' the difference between adjacent values of % h_ss. If a pair of points meets the height, height difference, - % and along-track distance criteria defined in input section, - % take the pair as representing a front jump and gather data about - % the front crossing. Break out of this loop once the front is detected. + % and along-track distance criteria defined in the user input + % section, take the pair as representing a front jump and gather + % data about the front crossing. Break out of this loop once + % the front is detected. h_diff = abs(h_ss_non_NaN_inds(j + 1) - h_ss_non_NaN_inds(j)); @@ -336,5 +335,3 @@ save(out_filename, '-v7.3', 'ross_front_crossing_data', 'gt_count', ... 'h_a_upper_limit', 'h_diff_lower_limit', 'h_diff_upper_limit', ... 'h_diff_upper_limit') - - diff --git a/scripts/Step_04_detect_rm_features.m b/scripts/Step_04_detect_rm_features.m index 0993580..aafd8e9 100644 --- a/scripts/Step_04_detect_rm_features.m +++ b/scripts/Step_04_detect_rm_features.m @@ -1,49 +1,52 @@ % This script searches each ground track profile in which the ice front was % detected for a rampart-moat (R-M) structure (again moving from the ocean % to the ice shelf). If an R-M structure is found, it gathers various data -% on the structure that can be used to compute dh_RM and dx_RM. +% on the structure and uses those data to compute dh_RM and dx_RM. % -% This script implements Step (v) described in Subsection 2.3 of Becker et -% al. (2021). +% This script implements steps (v) and (vi) described in Subsection 2.3 of +% Becker et al. (2021). % % Susan L. Howard, Earth and Space Research, showard@esr.org % Maya K. Becker, Scripps Institution of Oceanography, mayakbecker@gmail.com % -% Last update: April 14, 2021. -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Last updated April 16, 2021 +%%%%%%%%%%%%%%%%%%%%%%%%%%%% Begin user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%% load 'ross_front_crossing_data.mat' % *.mat file created in Step 03 out_filename = 'ross_rm_data.mat'; % output filename +ref_time = datenum(2018,01,01); % reference time for all ground track profiles % Set various criteria that a near-front depression must satisfy in order % to be classified as representing an R-M structure by the R-M detection % algorithm -moat_h_lower_limit = 2; % lower limit of the height of the moat--must be - % above sea level -moat_search_dist = 2000; % along-track distance from the detected front over - % which to search for a moat +moat_h_lower_limit = 2; % lower limit of the height of the moat--must be + % above sea level + +moat_search_dist = 2000; % along-track distance from the detected front over + % which to search for a moat + rampart_max_search_dist = 100; % along-track distance from the detected front % over which to search for a higher maximum % than what the algorithm detects as the rampart - -%%%%%%%%%%%%%% end user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End user input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Generate variables for various moat- and rampart-related parameters. Set % all to NaN; these variables will be populated later on in this script. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% moat_h(1:gt_count) = NaN; % height of the moat minimum moat_index(1:gt_count) = NaN; % index corresponding to the moat minimum moat_x(1:gt_count) = NaN; % x-coordinate of the moat minimum location moat_y(1:gt_count) = NaN; % y-coordinate of the moat minimum location -moat_x_dist(1:gt_count) = NaN; % along-track distance (in x) from the moat - % minimum location to the first ATL06 segment - % in the ground track profile +moat_x_dist(1:gt_count) = NaN; % along-track distance (in x) from the first + % ATL06 segment in the ground track profile + % to the moat minimum location moat_x_atc(1:gt_count) = NaN; % along-track x-coordinate of the moat minimum % location moat_delta_time(1:gt_count) = NaN; % delta time value of the moat minimum @@ -55,9 +58,9 @@ rampart_index(1:gt_count) = NaN; % index corresponding to the rampart maximum rampart_x(1:gt_count) = NaN; % x-coordinate of the rampart maximum location rampart_y(1:gt_count) = NaN; % y-coordinate of the rampart maximum location -rampart_x_dist(1:gt_count) = NaN; % along-track distance (in x) from the rampart - % maximum location to the first ATL06 - % segment in the ground track profile +rampart_x_dist(1:gt_count) = NaN; % along-track distance (in x) from the + % first ATL06 segment in the ground track + % profile to the rampart maximum location rampart_x_atc(1:gt_count) = NaN; % along-track x-coordinate of the rampart % maximum location rampart_delta_time(1:gt_count) = NaN; % delta time value of the rampart maximum @@ -85,14 +88,15 @@ end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Rampart - Moat Detection +% Run the R-M detection algorithm for each ground track profile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Run the R-M detection algorithm for each ground track profile, sorting by % ascending and descending tracks as in Step 03. Search for the moat by % looking for the minimum height value in the first detected depression -% that is less than 2 km (along track) from the upper, ice-shelf point in -% the front jump (Point B). +% that is less than 2 km (or the value of 'moat_search_dist' defined in the +% user input section) along track from the upper, ice-shelf point in the +% front jump (Point B). for i = 1:gt_count @@ -105,14 +109,17 @@ x_diff = ross_front_crossing_data(i).x_dist_b; index_b = ross_front_crossing_data(i).index_b; - msd_count=(moat_search_dist)/20+1; %we limit moat loop index based on moat search distance - rsd_count=(rampart_max_search_dist)/20+1; %we limit rampart loop index based on rampart search distance + % Limit the moat loop indices based on the the value of + % 'moat_search_dist' specified in the user input section + + moat_search_dist_index_count = (moat_search_dist / 20) + 1; if ~isnan(h_b) if ross_front_crossing_data(i).direction == 'D' % descending - for j = 1:msd_count + for j = 1:moat_search_dist_index_count + try x_dist_near_front = abs(x_diff - ross_front_crossing_data(i).x_dist(index_b + j)); @@ -129,7 +136,8 @@ else % Break out of this loop if a depression that - % satisfies the criteria is detected + % satisfies the criteria defined in the user input + % section is detected break @@ -147,7 +155,7 @@ else % ascending - for j = 1:msd_count + for j = 1:moat_search_dist_index_count try @@ -183,8 +191,8 @@ moat_h(i) = rm_h_loop; moat_index(i) = index_loc; - % If a depression satisfies the criteria described above, take it - % as a moat and gather and report data about it + % If a depression satisfies the criteria defined in the user input + % section, take it as a moat and gather and report data about it if ~isnan(h_b) @@ -206,10 +214,9 @@ end - % Keep all moat-related variable values as NaN if h_b is NaN for a - % specific ground track profile - - else + + else % h_b is NaN for a specific ground track profile. Re-set all + % moat-related variable values to NaN moat_h(i) = NaN; moat_index(i) = NaN; @@ -226,7 +233,8 @@ % If a moat is detected along a ground track profile, make sure that the % upper, ice-shelf point in the front jump (Point B) is actually the rampart -% maximum by searching for the highest point within 100 m of the front +% maximum by searching for the highest point within 100 m (or the value of +% 'rampart_max_search_dist' defined in the user input section) of the front for i = 1:gt_count @@ -239,13 +247,18 @@ x_diff = ross_front_crossing_data(i).x_dist_b; index_b = ross_front_crossing_data(i).index_b; + % Limit the rampart loop indices based on the value of + % 'rampart_max_search_dist' specified in the user input section + + rampart_max_search_dist_index_count = (rampart_max_search_dist / 20) + 1; + if ~isnan(h_b) if rm_flag(i) == 1 % if a moat has been detected if ross_front_crossing_data(i).direction == 'D' % descending - for j = 1:rsd_count + for j = 1:rampart_max_search_dist_index_count x_dist_near_front = abs(x_diff - ross_front_crossing_data(i).x_dist(index_b + j)); @@ -266,7 +279,7 @@ else % ascending - for j = 1:rsd_count + for j = 1:rampart_max_search_dist_index_count x_dist_near_front = abs(x_diff - ross_front_crossing_data(i).x_dist(index_b - j)); @@ -290,8 +303,9 @@ rampart_h(i) = rm_h_loop; rampart_index(i) = index_loc; - % If a high point satisfies the criteria described above, take - % it as the rampart maximum and gather and report data about it + % If a high point satisfies the criteria defined in the user input + % section, take it as the rampart maximum and gather and report + % data about it if ~isnan(h_b) @@ -302,11 +316,11 @@ rampart_delta_time(i) = ross_front_crossing_data(i).delta_time(index_loc); end - - % Keep all rampart-related variable values as NaN if a moat has not - % been detected along a specific ground track profile + - else + else % rm_flag is 0 for current ground track profile at index i. + % A moat was not detected. Re-set all rampart-related + % variable values for the ground track profile at to NaN rampart_h(i) = NaN; rampart_index(i) = NaN; @@ -318,10 +332,11 @@ end - % Keep all moat-related variable values as NaN if h_b is NaN for a - % specific ground track profile - - else + + else % h_b is NaN for current ground track profile at index i. + % Re-set all rampart-related variable values for the ground + % track profile at to NaN + rampart_h(i) = NaN; rampart_index(i) = NaN; @@ -336,12 +351,42 @@ end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Compute specific parameters that describe the R-M feature (if it exists) +% in each ground track profile +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Generate variables for three R-M parameters: dh_rm, which is the height +% of the rampart maximum relative to the moat; dx_rm, which is the +% along-track distance from the rampart maximum to the lowest portion of +% the moat; and time_rm, which is the serial date number corresponding to +% the approximate center of the R-M feature. Set all to NaN; these variables +% will be populated in the loop that follows. + +dh_rm(1:gt_count) = NaN; +dx_rm(1:gt_count) = NaN; +time_rm(1:gt_count) = NaN; + +for i = 1:gt_count + + % Only calculate these values if a moat has been detected + + if rm_flag(i) == 1 + + dh_rm(i) = rampart_h(i) - moat_h(i); + dx_rm(i) = rampart_x_dist(i) - moat_x_dist(i); + average_time = (rampart_delta_time(i) + moat_delta_time(i)) / 2; % "average" time of the R-M feature + time_rm(i) = datenum(ref_time + (average_time / (60*60*24))); + + end + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Save relevant R-M parameters to a *.mat file save(out_filename, '-v7.3', 'moat_h', 'moat_index', 'moat_x', 'moat_y', ... 'moat_x_dist', 'moat_x_atc', 'moat_delta_time', 'rm_flag', 'rampart_h', ... 'rampart_index', 'rampart_x', 'rampart_y', 'rampart_x_dist', ... - 'rampart_x_atc', 'rampart_delta_time', 'track_node', 'cycle_number') - + 'rampart_x_atc', 'rampart_delta_time', 'dh_rm', 'dx_rm', 'time_rm', ... + 'track_node', 'cycle_number')