0
点赞
收藏
分享

微信扫一扫

utm模块转换坐标

import utm
st = read('*.SHZ', format='SAC')
df = pd.DataFrame(columns=['name','x','y','z'])
name = []
x = []
y = []
for i in range(len(st)):
    stla = st[i].stats.sac.stla
    stlo = st[i].stats.sac.stlo
    utm_ = utm.from_latlon(stla,stlo)
    stationname = st[i].stats.station
    utm_x = utm_[0]
    utm_y = utm_[1]
    x.append(utm_x)
    y.append(utm_y)
    name.append(stationname)
#     utm.from_latlon(st[i].stats.sac.stla,st[i].stats.sac.stlo)[0]
df['name'] = name
df['x'] = x
df['y'] = y
df['z'] = [0]*len(x)
df.to_csv('coordinate.txt', sep=' ', header=None, index=None)
举报

相关推荐

0 条评论