<jupyter_start><jupyter_text>Visualize a stem mapHere, you can enter the path to your treelist, which can be a text (.csv) file, a shapefile (.shp) or a pandas DataFrame or geopandas GeoDataFrame. Each species in your treelist will be represented with the same color.You also have the option to specify a Digital Elevation Model (DEM), which should be a raster format (e.g., a GeoTiff). Providing a DEM will place the trees on the terrain. If your tree list is very large, you may run into difficulty rendering the 3D model depending on your computer's available memory. You can specify a sample of trees to render from the tree list, which will be randomly selected. If you're unsure whether your tree list is too big. Start off with a smaller number, and work your way up...<jupyter_code>plot_tree_list(tree_list = '../data/processed/wind_river/wind_river_tree_list.shp',
               dem = '../data/processed/wind_river/wind_river_elevation.tif', 
               sample=200)<jupyter_output><empty_output><jupyter_text>Just for fun, visualizing a "Random Forest"Plot a tree list with randomly-shaped trees.<jupyter_code>import numpy as np
import ipyvolume as ipv
import seaborn as sns
from forest3d.geometry import Tree
def random_tree():
    species = 'Douglas-fir'
    dbh = np.random.rand()*40
    ht = np.random.randint(low=50,high=200)
    crown_ratio = np.random.randint(low=40,high=95)/100
    stem_x = np.random.rand()*500 - 250
    stem_y = np.random.rand()*500 - 250
    stem_z = np.random.rand()*10 - 5
    crown_radii = np.random.randint(low=10,high=80,size=4)/100*ht
    crown_edge_heights = np.random.rand(4)
    crown_shapes = np.random.randint(low=50,high=300,size=(2,4))/100
    lean_direction = np.random.rand()*360
    lean_severity = np.random.rand()*10
    return Tree(species, dbh, ht, stem_x, stem_y, stem_z, lean_direction, lean_severity, crown_ratio, crown_radii, crown_edge_heights, crown_shapes).get_crown()
    
def random_forest(num_trees=15):
    palette = sns.color_palette('colorblind', num_trees)
    ipv.figure()
    for i in range(num_trees):
        x,y,z = random_tree()
        ipv.plot_wireframe(x.reshape((50,32)), y.reshape((50,32)), z.reshape((50,32)), 
                         color=palette[np.random.randint(0, len(palette))])
    ipv.show()
random_forest()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10787671232876712, 'fraction_numerical': 0.03125, 'mean_word_length': 4.091503267973856, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '532457', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 842, 'n_tokens_neox': 770, 'n_words': 224, 'path': 'notebooks/03_Visualize a Forest Plot in 3D.ipynb', 'repo_name': 'd-diaz/Lidar_Plot_Registration', 'size': '2336'}