| 1 | function output = interpBamber2013(X,Y,string),
|
|---|
| 2 | %INTERPBAMBER2013 - interpolate Bamber 2013 data
|
|---|
| 3 | %
|
|---|
| 4 | % Available data:
|
|---|
| 5 | % BedrockElevation
|
|---|
| 6 | % SurfaceElevation
|
|---|
| 7 | % IceThickness
|
|---|
| 8 | % SurfaceRMSE
|
|---|
| 9 | % BedrockError
|
|---|
| 10 | % LandMask (Land mask, 0=ocean, 1=land, 2=ice sheet, 3=non-Greenlandic land, 4=ice shelf)
|
|---|
| 11 | % NumberAirbornePoints
|
|---|
| 12 | % Geoid
|
|---|
| 13 | % BedrockChangeMask
|
|---|
| 14 | % IceShelfSourceMask
|
|---|
| 15 | % BedrockElevation_unprocessed
|
|---|
| 16 | % IceThickness_unprocessed
|
|---|
| 17 | % BathymetryDataMask
|
|---|
| 18 |
|
|---|
| 19 | switch oshostname(),
|
|---|
| 20 | case {'murdo','thwaites','astrid'}
|
|---|
| 21 | bamber2013nc='/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/Bamber2013/Greenland_bedrock_topography_V3.nc';
|
|---|
| 22 | case {'ronne'}
|
|---|
| 23 | bamber2013nc='/home/ModelData/Greenland/Bamber2013/Greenland_bedrock_topography_V3.nc';
|
|---|
| 24 | otherwise
|
|---|
| 25 | error('machine not supported yet');
|
|---|
| 26 | end
|
|---|
| 27 | verbose = 0;
|
|---|
| 28 |
|
|---|
| 29 | if nargin==2,
|
|---|
| 30 | string = 'BedrockElevation';
|
|---|
| 31 | end
|
|---|
| 32 |
|
|---|
| 33 | %Convert to Bamber's projections
|
|---|
| 34 | if verbose, disp(' -- Bamber2013: converting coordinates'); end
|
|---|
| 35 | [LAT, LON ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
|
|---|
| 36 | [x3971,y3971] = ll2xy(LAT,LON ,+1,39,71);
|
|---|
| 37 |
|
|---|
| 38 | if verbose, disp(' -- Bamber2013: loading coordinates'); end
|
|---|
| 39 | xdata = double(ncread(bamber2013nc,'projection_x_coordinate'));%*1000;
|
|---|
| 40 | ydata = double(ncread(bamber2013nc,'projection_y_coordinate'));%*1000;
|
|---|
| 41 |
|
|---|
| 42 | if verbose, disp([' -- Bamber2013: loading ' string]); end
|
|---|
| 43 | data = double(ncread(bamber2013nc,string))';
|
|---|
| 44 | if verbose, disp([' -- Bamber2013: interpolating ' string]); end
|
|---|
| 45 | if strcmpi(string,'LandMask');
|
|---|
| 46 | output = InterpFromGrid(xdata,ydata,data,x3971,y3971,'nearest');
|
|---|
| 47 | else
|
|---|
| 48 | output = InterpFromGrid(xdata,ydata,data,x3971,y3971);
|
|---|
| 49 | end
|
|---|
| 50 | output = reshape(output,size(X,1),size(X,2));
|
|---|