error in read_srtm30plus.m script ....

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
mashinde
Posts: 135
Joined: Mon Jun 22, 2009 3:46 pm
Location: Indian Institute of Tropical Meteorology, Pune, INDIA

error in read_srtm30plus.m script ....

#1 Unread post by mashinde »

Dear Friends ,

I am building a grid with seagrid. I have following errors while reading bathymetry via read_srtm30plus.m script,

[xbathy,ybathy,zbathy]=read_srtm30plus([-20 37],[30 49],60);
??? Error using ==> rtifc
/tmp/tp8377d624_0366_4942_b7c9_623a47471fcf: Not a TIFF file, bad magic number 16188 (0x3f3c).

Error in ==> readtif at 52
[X, map, details] = rtifc(args);

Error in ==> imread at 432
[X, map] = feval(fmt_s.read, filename, extraArgs{:});

Error in ==> read_srtm30plus at 60
pix=imread(url,'tif');


So, can you please tell how to solve this error.


in addition also look the discussion page link :

https://www.myroms.org/wiki/index.php/Talk:seagrid




Thanks

gmaze

Re: error in read_srtm30plus.m script ....

#2 Unread post by gmaze »

Hi, I was wondering if you have found a resolution to this problem?

rsignell
Posts: 124
Joined: Fri Apr 25, 2003 9:22 pm
Location: USGS

Re: error in read_srtm30plus.m script ....

#3 Unread post by rsignell »

Unfortunately NASA took down the WMS site, but fortunately, it's easy to get
subsetted global and other bathymetry data using NCTOOLBOX:

1. Get NCTOOLBOX for Matlab (easy install at http://code.google.com/p/nctoolbox/)

2. Use the "geosubset" method to subset bathy data. For SRTM30PLUS, it would look like:

Code: Select all

url='http://geoport.whoi.edu/thredds/dodsC/bathy/srtm30plus_v1.nc';
nc=ncgeodataset(url)
topovar=nc.geovariable('topo')
s.lon=[-71.2 -69.9]
s.lat=[41 42];
%s.h_stride=[2 2];  %get every other value
g=topovar.geosubset(s)
imagesc(g.grid.lon,g.grid.lat,g.data);axis xy;colorbar;
title('SRTM (m)')
Image

You can substitute any other OPeNDAP URL in this catalog, which includes ETOPO2, ETOPO1, NOAA Coastal Relief Model for the US, and more:
http://geoport.whoi.edu/thredds/bathy_catalog.html

Good Luck,
Rich

AlexisEspinosa
Posts: 23
Joined: Fri May 24, 2013 3:05 am
Location: UWA

Re: error in read_srtm30plus.m script ....

#4 Unread post by AlexisEspinosa »

Dear Prof. Signell,

Thanks a lot for all your shared tools!

It would be nice if someone can update the wikiRoms page. Both, the svn repositories and the usage of read_srtm30plus are incorrect and mislead us.

Thanks a lot,
Alexis Espinosa
UWA

pilipalapipa

Re: error in read_srtm30plus.m script ....

#5 Unread post by pilipalapipa »

Dear friends,

I tried the method below, but I got the wrong message like this,
-----------------------------------------
>> [x,y,z]=read_srtm30plus(ax(1:2),ax(3:4),30);
Warning: The netcdf-java cdm contains no coordinate information
associated with the variable. Returning ncvariable instead of
ncgeovariable object. (Methods that rely on coordinate information
like 'grid' or 'geosubset' are not available.
> In ncgeodataset>ncgeodataset.geovariable at 215
In ncgeodataset>ncgeodataset.subsref at 378
In read_srtm30plus2 at 32
??? Error using ==> subsref
No appropriate method, property, or field geosubset for class
ncvariable.

Error in ==> ncvariable>ncvariable.subsref at 295
sref = builtin('subsref',obj,s);

Error in ==> read_srtm30plus2 at 36
g=topovar.geosubset(s);

------------------------------
I will be pretty appreciated if anyone gives some suggestions,

Tony

rsignell wrote:Unfortunately NASA took down the WMS site, but fortunately, it's easy to get
subsetted global and other bathymetry data using NCTOOLBOX:

1. Get NCTOOLBOX for Matlab (easy install at http://code.google.com/p/nctoolbox/)

2. Use the "geosubset" method to subset bathy data. For SRTM30PLUS, it would look like:

Code: Select all

url='http://geoport.whoi.edu/thredds/dodsC/bathy/srtm30plus_v1.nc';
nc=ncgeodataset(url)
topovar=nc.geovariable('topo')
s.lon=[-71.2 -69.9]
s.lat=[41 42];
%s.h_stride=[2 2];  %get every other value
g=topovar.geosubset(s)
imagesc(g.grid.lon,g.grid.lat,g.data);axis xy;colorbar;
title('SRTM (m)')
Image

You can substitute any other OPeNDAP URL in this catalog, which includes ETOPO2, ETOPO1, NOAA Coastal Relief Model for the US, and more:
http://geoport.whoi.edu/thredds/bathy_catalog.html

Good Luck,
Rich

Caffery

Re: error in read_srtm30plus.m script ....

#6 Unread post by Caffery »

I also meet that problem like you. But my problem is lack of 'private'. i don't know whether it needs to download and where.

Code: Select all

>> [xbathy,ybathy,zbathy]=read_srtm30plus(lon_range,lat_range,60);
??? Error: File: ncgeodataset.m Line: 60 Column: 38
Undefined function or variable 'private'.

Error in ==> read_srtm30plus at 34
nc=ncgeodataset(url);

>> 
thnks and i hope that i can get answers.

Post Reply