Rank: 1047 based on 129 downloads (last 30 days) and 9 files submitted
photo

Andrew Stevens

E-mail
Company/University
US Geological Survey
Lat/Long
37.4556999206543, -122.1700973510742

Personal Profile:

 

Watch this Author's files

 

Files Posted by Andrew Stevens View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 Jan 2010 SP_PROJ Convert to and from US state plane coordinates Author: Andrew Stevens coordinate transforma..., earth science, gis 18 1
  • 5.0
5.0 | 1 rating
18 Aug 2009 Screenshot CURVVEC draw curved vectors from 2D vector data Author: Andrew Stevens quiver, stream lines, vector field, 2d, specialized plotting 24 2
  • 5.0
5.0 | 3 ratings
01 Apr 2009 Screenshot BIN2MAT Create a matrix from scattered data without interpolation Author: Andrew Stevens reshape, vector, gridding, accumarray 9 0
  • 4.0
4.0 | 1 rating
31 Mar 2009 ARCGRIDWRITE Write gridded data set in Arc ASCII Grid Format Author: Andrew Stevens data import, data export, esri, arc, grid, raster 27 11
  • 4.4
4.4 | 5 ratings
04 Mar 2009 Screenshot GESCATTER Create a scatter plot in Google Earth (.kml) Author: Andrew Stevens data export, google earth, kml, scatter 18 3
  • 4.66667
4.7 | 3 ratings
Comments and Ratings by Andrew Stevens View all
Updated File Comments Rating
31 Mar 2011 ARCGRIDWRITE Write gridded data set in Arc ASCII Grid Format Author: Andrew Stevens

Edgar,

The default precision for the function is %0.3f, so you should get 0.075 as the cell spacing. I tried the following code to verify:

%generate synthetic data with desired %cell spacing
xi=0:0.075:1;
yi=0:0.075:1;
[xm,ym]=meshgrid(xi,yi);
zm=peaks(numel(xi));

%call arcgridwrite
arcgridwrite('test.asc',xm,ym,zm);

%look at output
type('test.asc')

The results look correct to me. Let me know (by email) if you have further questions.

09 Mar 2010 Matlab script to read and plot NCEP/NCAR 4x Daily Reanalysis data Matlab script to read and plot NCEP/NCAR 4x Daily Reanalysis data Author: Paula Moreira

Why not use OPeNDAP which has a tool to read NCEP Re-Analysis data (as well as many other datasets) directly into matlab?

http://opendap.org/download/ml-structs.html

27 Jan 2010 ascii2xyz convert ARC ASCII text file to xyz Author: Andrew Stevens

Fran,

This file is intended to read in an ASCII file produced by ARC GIS containing raster data. A properly formatted ARC ASCII file has header information which your file does not apparently have. Type 'help ascii2xyz' to see the required header format.

Andrew

10 Sep 2009 xyzplotter Transforms lists xin,yin,zin into matrices which can be used with the functions surf and mesh. Author: Jack Kohoutek

This code worked fine for the example that I tried. Here are a couple comments and questions that I think, if addressed, will improve the code and clarify its function.

1)The help section is in a non-standard format and an H1 line would be useful.
2) What does the code do with repeat x and y values?
3) What is the cell-size of the resulting grid? Answers to 2 and 3 should be added to the help section.
4) Efficiency: This code uses a triple loop to fill the grid. For large datasets, this will be extremely slow. An alternative approach is to use a combination of HISTC and ACCUMARRAY to populate the grid that will be fast.

-Andrew

31 Mar 2009 ARCGRIDWRITE Write gridded data set in Arc ASCII Grid Format Author: Andrew Stevens

Colin,

Thanks for your comments. I found after playing with a couple examples, I determined that if I simply change the output filename from .txt to .asc that the file can be read directly into arc without doing the raster conversion.

I would also be careful with your modification of the way the header is written in the output file. Your modification forces the cell-size to be an integer which would produce a large error in many of my datasets.

Andrew

Comments and Ratings on Andrew Stevens' Files View all
Updated File Comment by Comments Rating
08 Jul 2014 CURVVEC draw curved vectors from 2D vector data Author: Andrew Stevens Zhigang

This is a very nice code, however, it will be more perfect if it can add a scale legend on the upper left/right corner of the plotting.

18 Jun 2014 ascii2xyz convert ARC ASCII text file to xyz Author: Andrew Stevens HIT

USEFUL

23 Nov 2013 ARCGRIDWRITE Write gridded data set in Arc ASCII Grid Format Author: Andrew Stevens Yugarshi

in Marc's code:

replace:

for i=1:mz

with

for i=mz:-1:1

this fixes the flipud problem

02 Jul 2013 ARCGRIDWRITE Write gridded data set in Arc ASCII Grid Format Author: Andrew Stevens Marc

Thanks for this useful submission. However the performance of your code is bad (at least on my (standard) pc). Writing of a 3500 by 6000 matrix would take days on my desktop machine. I looked into your code and replaced your nested for loop (which is a real bottleneck!) containing the fprintf statement by a single one, taking advantage of the list behaviour of the format specifier the fprintf command can take.
specifically i replaced:

%%%START OF YOUR ORIGINAL CODE%%%
%write data
for i=1:mz
for j=1:nz

if j==nz
fprintf(fid,[dc,'\n'],Z(i,j));
else
fprintf(fid,[dc,'\t'],Z(i,j));
end
end
%update waitbar
waitbar(i/mz,h,['Writing file: ',[fname,ext],...
sprintf(' %d%% complete...',round(i/mz*100))])
end

%%%END OF YOUR ORIGINAL CODE%%%

with:

%%%START OF MY MODIFIED VERSION%%%%
test=repmat([dc,'\t'],1,nz);
test(end-1:end)='\n';
%write data
for i=1:mz
fprintf(fid,test,Z(i,:));
%update waitbar
waitbar(i/mz,h,['Writing file: ',[fname,ext],...
sprintf(' %d%% complete...',round(i/mz*100))])
end
%%%END OF MY MODIFIED VERSION%%%

My modified Version takes approx. 10 minutes to write my large array. Maybe you can integrate this in your submission... By the way in ESRI arcmap10 i still have to flipud the imported asc file to display correctly...
Best regards
Marc

11 Feb 2013 CURVVEC draw curved vectors from 2D vector data Author: Andrew Stevens th kuo

Contact us