Changeset 27694


Ignore:
Timestamp:
04/19/23 12:01:03 (2 years ago)
Author:
Cheng Gong
Message:

ADD: a function to interpolate ice mask from Greene monthly reconstruction data

Location:
issm/trunk-jpl/src/m/contrib/chenggong
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/contrib/chenggong/dataprocessing/computeGrad.m

    r26975 r27694  
    11function [gradx, grady]=computeGrad(index,x,y,field)
    2 %COMPUTEHESSIAN - compute the gradient from a field
     2%COMPUTEGRAD - compute the gradient from a field
    33
    44%some variables
  • issm/trunk-jpl/src/m/contrib/chenggong/dataprocessing/extractTransientSolutions.m

    r26975 r27694  
    99transientSolutions.thickness = cell2mat({md.results.TransientSolution(:).Thickness});
    1010transientSolutions.SigmaVM = cell2mat({md.results.TransientSolution(:).SigmaVM});
    11 transientSolutions.smb = cell2mat({md.results.TransientSolution(:).SmbMassBalance});
     11if (isfield(md.results.TransientSolution, 'SmbMassBalance'))
     12        transientSolutions.smb = cell2mat({md.results.TransientSolution(:).SmbMassBalance});
     13end
    1214transientSolutions.ice_levelset = cell2mat({md.results.TransientSolution(:).MaskIceLevelset});
    1315transientSolutions.calvingRate = cell2mat({md.results.TransientSolution(:).CalvingCalvingrate});
  • issm/trunk-jpl/src/m/contrib/chenggong/dataprocessing/integrateOverDomain.m

    r26975 r27694  
    88        weights = ones(size(data));
    99        if nargin<3
    10                 masked = [];
     10                masked = logical(zeros(size(data)));
    1111        end
    1212end
    1313
     14masked = masked | isnan(data) | isnan(weights);
    1415% Set the area with masked=1 to nan
    1516data(masked) = nan;
    1617weights(masked) =nan;
     18
    1719
    1820% get the mesh
     
    2830eleAreas = 1/3*eleAreas.*(weights(elements(:,1),:)+weights(elements(:,2),:)+weights(elements(:,3),:));
    2931
    30 intData = sum(eleData(:),'omitnan');
    31 areas = sum(eleAreas(:),'omitnan');
    32 meanData = intData / areas;
     32intData = sum(eleData, 1, 'omitnan');
     33areas = sum(eleAreas, 1, 'omitnan');
     34meanData = intData ./ areas;
  • issm/trunk-jpl/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m

    r26975 r27694  
    2727elseif strcmp(glacier, 'Rink')
    2828        foldername = '/totten_1/ModelData/Greenland/VelMEaSUREs/Rink_2008_2022/';
     29elseif strcmp(glacier, 'Upernavik')
     30        foldername = '/totten_1/ModelData/Greenland/VelMEaSUREs/Upernavik_2008_2022/';
     31elseif strcmp(glacier, 'Helheim')
     32        foldername = '/totten_1/ModelData/Greenland/VelMEaSUREs/Helheim_2008_2023/';
    2933else
    3034        error(['The velocity data for ', glacier, ' is not available, please download from NSIDC first.']);
  • issm/trunk-jpl/src/m/contrib/chenggong/visualization/plotCompareTransientFlowline.m

    r26975 r27694  
    1616%
    1717%   Author: Cheng Gong
    18 %   Date: 2021-12-06
     18%   Date: 2023-04-10
    1919
    2020N = length(velList);
     
    4646    h=colorbar;
    4747    title(h,'m/a')
     48         % add a vertical line to indicate initial ice front position
     49         id = max(find(~isnan(cumsum(vel_flowline{p}(:,1)))));
     50         icefront = flowline.Xmain(id);
     51         plot([icefront, icefront], [2007,2020], '-r')
    4852end
Note: See TracChangeset for help on using the changeset viewer.