<jupyter_start><jupyter_text>First Light Example Render a sample dataset using AscentTo start, we run a basic “First Light” example to generate an image. This example renders the an example dataset using ray casting to create a pseudocolor plot. The dataset is one of the built-in Conduit Mesh Blueprint examples, in this case an unstructured mesh composed of hexagons.<jupyter_code># conduit + ascent imports
import conduit
import conduit.blueprint
import ascent

# cleanup any old results
!./cleanup.sh
# create conduit node with an example mesh using conduit blueprint's braid function
# ref: https://llnl-conduit.readthedocs.io/en/latest/blueprint_mesh.html#braid

# things to explore:
#  changing the mesh resolution

mesh = conduit.Node()
conduit.blueprint.mesh.examples.braid("hexs",
                                      50,
                                      50,
                                      50,
                                      mesh)
# create an Ascent instance
a = ascent.Ascent()

# set options to allow errors propagate to python
ascent_opts = conduit.Node()
ascent_opts["exceptions"] = "forward"

#
# open ascent
#
a.open(ascent_opts)

#
# publish mesh data to ascent
#
a.publish(mesh)

#
# Ascent's interface accepts "actions" 
# that to tell Ascent what to execute
#
actions = conduit.Node()

# Create an action that tells Ascent to:
#  add a scene (s1) with one plot (p1)
#  that will render a pseudocolor of 
#  the mesh field `braid`
add_act = actions.append()
add_act["action"] = "add_scenes"

# declare a scene (s1) and pseudocolor plot (p1)
scenes = add_act["scenes"]

# things to explore:
#  changing plot type (mesh)
#  changing field name (for this dataset: radial)
scenes["s1/plots/p1/type"] = "pseudocolor"
scenes["s1/plots/p1/field"] = "braid"

# set the output file name (ascent will add ".png")
scenes["s1/image_name"] = "out_first_light_render_3d"

# view our full actions tree
print(actions.to_yaml())

# execute the actions
a.execute(actions)
# show the result from our scene using the AscentViewer widget
ascent.jupyter.AscentViewer(a).show()
# close ascent
a.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09171322160148976, 'fraction_numerical': 0.0074487895716946, 'mean_word_length': 3.4127310061601643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '291635', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 688, 'n_tokens_neox': 654, 'n_words': 230, 'path': 'src/examples/tutorial/ascent_intro/notebooks/01_ascent_first_light.ipynb', 'repo_name': 'goodbadwolf/ascent', 'size': '2148'}