def main():
"""Main demo."""
# Load survey data
llh, data = get_flightlines()
decimate = 5
llh = llh[::decimate]
data = data[::decimate]
# Select by height intervals (57% of the data)
hrange = [95., 105.]
keep = np.bitwise_and(llh[:, 2] > hrange[0], llh[:,2] < hrange[1])
llh = llh[keep]
data = data[keep]
# Write out the reduced llh, data
sf = shapefile.Writer(shapefile.POINT)
outname = data_root + 'new_flightlines'
log.info('Writing shapefile')
sf.field("K")
sf.field("Th")
sf.field("U")
for ll, dat in tqdm(zip(llh, data)):
sf.point(ll[0], ll[1], ll[2])
sf.record(K=dat[0], Th=dat[1], U=dat[2])
sf.save(outname)
log.info('Done!')
评论列表
文章目录