-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename tile_coord%pfaf to tile_coord%pfaf_index; add matlab reader fo…
…r tile file (ASCII and nc4) (#78)
- Loading branch information
Showing
7 changed files
with
571 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
function [tile_coord ] = read_catchmentdef( fname ) | ||
|
||
% read (land) tile properties from "catchment.def" file (EASEv2 and cube-sphere) | ||
% | ||
% reichle, 24 Jan 2025 | ||
% | ||
% ------------------------------------------------------------- | ||
|
||
% read file | ||
|
||
disp(['reading from ', fname]) | ||
|
||
ifp = fopen( fname, 'r' ); | ||
|
||
% read header line | ||
|
||
tmpdata = fscanf( ifp, '%f', 1 ); | ||
|
||
tile_coord.N_tile = tmpdata(1); | ||
|
||
% read rest of data | ||
|
||
tmpdata = fscanf( ifp, '%f' ); | ||
|
||
fclose(ifp); | ||
|
||
disp('done reading "catchment.def" file') | ||
|
||
% -------------------------------------------------- | ||
|
||
% process data | ||
|
||
tmpdata = reshape(tmpdata, [7, tile_coord.N_tile])'; | ||
|
||
tile_coord.tile_id = tmpdata(:,1); | ||
tile_coord.pfaf_index = tmpdata(:,2); | ||
|
||
tile_coord.min_lon = tmpdata(:,3); | ||
tile_coord.max_lon = tmpdata(:,4); | ||
tile_coord.min_lat = tmpdata(:,5); | ||
tile_coord.max_lat = tmpdata(:,6); | ||
|
||
tile_coord.elev = tmpdata(:,7); | ||
|
||
% ========== EOF =================================================== | ||
|
Oops, something went wrong.