scientimate.readxyzfile#
x, y, z = scientimate.readxyzfile(xyzfilename, xyzfilelocation=None, zscale=1, domain='all', xmin=-180, xmax=180, ymin=-90, ymax=90, savedata='no', outfilename='xyzdata.csv', outfilelocation=None)
Description#
Read and extract x (longitude), y (latitude) and z (elevation) data from ASCII gridded (tabular) xyz file
Use readdatafile function for more options
Inputs#
- xyzfilename
- Name of xyz file between ‘ ‘ mark, example: ‘xyzfile.xyz’xyz file should be in form of 3 coloumn format
- xyzfilelocation=pwd
Location of xyz file between ‘ ‘ mark, example: ‘C:'
- zscale=1
Scale z (elevation) data by factor of zscale
- domain=’all’
- Define a domain to be extracted from data‘all’: all xyz data in input file are extracted‘domain’: only data within a defined domain are extracted
- xmin=-180
Minimum x (longitude) of domain to be extracted
- xmax=180
Maximum x (longitude) of domain to be extracted
- ymin=-90
Minimum y (latitude) of domain to be extracted
- ymax=90
Maximum y (latitude) of domain to be extracted
- savedata=’no’
- Define if save xyz data in a file or not in outfilelocation folder‘no’: does not save‘yes’: save xyz data as csv file
- outfilename=’xyzdata.csv’
- Name of output file between ‘ ‘ mark, example: ‘xyzdata.csv’outfilename should have ‘.csv’ extension
- outfilelocation=pwd
Location of output file between ‘ ‘ mark, example: ‘C:'
Outputs#
- x
x (longitude) data extracted from xyz file
- y
y (latitude) data extracted from xyz file
- z
z (elevation) data extracted from xyz file
Examples#
import scientimate as sm
xyzfilename='xyzfile.xyz' #e.g. xyzfilename='PersianGulf_ETOPO1.xyz'
xyzfilelocation='C:/' #e.g. xyzfilelocation='C:/datafolder'
x,y,z=sm.readxyzfile(xyzfilename,xyzfilelocation)
xyzfilename='xyzfile.xyz' #e.g. xyzfilename='PersianGulf_ETOPO1.xyz'
xyzfilelocation='C:/' #e.g. xyzfilelocation='C:/datafolder'
x,y,z=sm.readxyzfile(xyzfilename,xyzfilelocation,1,'all',-180,180,-90,90,'no')
References#
Geospatial data