Spyder IPython控制台在运行部分代码后重新启动

2024-04-29 07:22:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一段代码,我已经为它安装了必要的软件包。运行这两行代码后出现问题:

data_all = spatial.readLidarPoints(inFile)
data_g = spatial.readLidarPoints(inFile,classification=lidarprocessor.CLASSIFICATION_GROUND)

IPython控制台只是在运行了这些行之后重新启动,然后我被抛出到控制台行[1]。我在ubuntu18.04 LTS上使用conda。你知道吗

我会附上完整的代码:

import pylidar
from pylidar import lidarprocessor
from pylidar.toolbox import spatial
from pylidar.toolbox import interpolation

from functools import partial
import pyproj
import numpy as np

import gbdxtools
from gbdxtools.task import env
from gbdxtools import CatalogImage

import matplotlib.pyplot as plt

#from rasterio import features
import numpy.ma 

from skimage import morphology
from gbdxtools.vectors import Vectors

import matplotlib.patches as Patches
from matplotlib.collections import PatchCollection

from matplotlib.patches import Polygon
from shapely import ops
from shapely.geometry import shape

from mpl_toolkits.mplot3d import Axes3D

from matplotlib import cm

import os
#import wget




inp = pyproj.Proj(init='epsg:32136') # 32136
outp = pyproj.Proj(init='epsg:4326')
tfm = partial(pyproj.transform, inp, outp)

BINSIZE = 1

def foot_to_meter(x):
    return x*0.3048 # check resolution


def sp_to_wgs84(p):
    xin, yin, zin = p
    xout, yout = tfm(foot_to_meter(xin), foot_to_meter(yin))
    return [xout, yout, foot_to_meter(zin)]


exists = os.path.isfile('tn_clean.las') 
if exists:
    inFile='tn_clean.las'
else:
    inFile=wget.download('https://s3.amazonaws.com/notebooks-demo-data/tn_clean.las')


#(xmin, xmax, ymin, ymax)
data_all = spatial.readLidarPoints(inFile)
data_g = spatial.readLidarPoints(inFile,classification=lidarprocessor.CLASSIFICATION_GROUND)

Tags: to代码fromimportdatamatplotlibspatialinfile