#645 closed defect (Fixed)
making read_mask.m more robust
| Reported by: | wilkin | Owned by: | arango |
|---|---|---|---|
| Priority: | minor | Milestone: | Matlab Processing Scripts |
| Component: | Matlab | Version: | 3.7 |
| Keywords: | Cc: |
Description (last modified by )
editmask.m throws some errors due to conflicts with new or incomplete grid files when variable hraw has not been loaded.
These can be solved by making a few changes to read_mask.m
A grid file may have a variable hraw that has not been filled with data. This will cause an error in editmask. I suggest test for the case hraw has an empty dimension:
case {Vname.hraw}
got.hraw=true;
if any(V.Variables(n).Size==0)
got.hraw=false;
end
read_mask presently only checks for spherical in the form of a character, and always returns false even when spherical=1 (numeric). Make this robust and compatible with both conventions with:
if (got.spher)
spher=nc_read(ncfile,Vname.spher);
if ischar(spher)
if strcmpi(spher,'T')
spherical=true;
end
else
spherical=spher;
end
end
Change History (3)
comment:1 by , 11 years ago
| Resolution: | → Fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 11 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 11 years ago
| Milestone: | Release ROMS/TOMS 3.7 → Matlab Processing Scripts |
|---|
Note:
See TracTickets
for help on using tickets.

Yes, thank for reporting these problems. Now, we have:
case {Vname.hraw} if ~any(V.Variables(n).Size == 0), got.hraw=true; endand
if (got.spher), spherical=nc_read(ncfile,Vname.spher); if (ischar(spherical)), if (spherical == 'T' || spherical == 't') spherical = true; else spherical = false; end end end