<commit_before>import climt
from sympl import PlotFunctionMonitor
from datetime import timedelta
import numpy as np


def plot_function(fig, state):

    ax = fig.add_subplot(1, 1, 1)
    state['zenith_angle'].transpose().plot.contourf(
        ax=ax, levels=16, robust=True)

    fig.suptitle('Zenith Angle at time: '+str(state['time']))
#    plt.savefig(str(state['time'])+'.png')


monitor = PlotFunctionMonitor(plot_function)

instellation = climt.Instellation()

y_grid = dict(label='latitude',
              values=np.linspace(-90, 90, 100), units='degrees_north')
x_grid = dict(label='longitude',
              values=np.linspace(0, 360, 100), units='degrees_east')

state = climt.get_default_state([instellation], x=x_grid, y=y_grid)

time_step = timedelta(hours=6)

for i in range(8000):
    diag = instellation(state)
    state.update(diag)
    monitor.store(state)
    state['time'] += time_step<commit_msg>added example for using zenith angle code.<commit_after>import climt
from sympl import PlotFunctionMonitor
from datetime import timedelta
import numpy as np


def plot_function(fig, state):

    ax = fig.add_subplot(1, 1, 1)
    state['zenith_angle'].transpose().plot.contourf(
        ax=ax, levels=16, robust=True)

    fig.suptitle('Zenith Angle at time: '+str(state['time']))


monitor = PlotFunctionMonitor(plot_function)

instellation = climt.Instellation()

y_grid = dict(label='latitude',
              values=np.linspace(-90, 90, 100), units='degrees_north')
x_grid = dict(label='longitude',
              values=np.linspace(0, 360, 100), units='degrees_east')

state = climt.get_default_state([instellation], x=x_grid, y=y_grid)

time_step = timedelta(hours=6)

for i in range(8000):
    diag = instellation(state)
    state.update(diag)
    monitor.store(state)
    state['time'] += time_step
{'fraction_non_alphanumeric': 0.1356397583745195, 'fraction_numerical': 0.026359143327841845, 'mean_word_length': 4.537993920972644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '84525', 'n_tokens_mistral': 671, 'n_tokens_neox': 610, 'n_words': 130}