<jupyter_start><jupyter_text>Time-series============__Goal__:Run SMRT on a time-series with varying temperature on the Dome C snowpack.We propose variations of temperature profile following:$$ T(z, t) = 27 \cos(\omega t - k z) exp(- k z) + (273 - 52) $$with $\omega= 2 \pi/1year$ and $k=0.5 m^{-1}$.  __Learning__:  Time-series is frequent, but from a SMRT perspective is not different from sensitivity study. The idea is to build a list of snowpacks and run it with snowpack_dimension=('time', time_series).__Tips__:The computation for a full year (every day) takes a long time. You can add "progressbar=True" to the `run` function to display a progress bar (works in terminal and jupyter notebooks).<jupyter_code>import numpy as np

import matplotlib.pyplot as plt
%matplotlib notebook

from smrt import make_model, make_snowpack, sensor_list
# prepare the snowpack
thickness, density, radius, tmp = np.loadtxt("data-domec-sp1-picard-2014.dat", skiprows=2, unpack=True, delimiter=" ")

z = np.cumsum(thickness)

def temperature(z, t):
    omega = 2*np.pi/ 365 / 24 / 3600
    k = 0.5
    return 27*np.cos(omega*convert_to_seconds(t) - k*z)* np.exp(-k*z)

def convert_to_seconds(t):
    # this is a bit tricky. It is easier to work with pandas timeseries than numpy timeseries... if you know pandas.
    return (t.astype('datetime64[s]')- np.datetime64('2012-01-01T00:00:00', 's'))/np.timedelta64(1, 's')
snowpack = list()
times = np.arange('2012-01-01', '2013-01-01', 10, dtype='datetime64[D]')
plt.figure()
plt.plot(times, temperature(0, times))
plt.plot(times, temperature(2, times))
# prepare the snowpacks with the different temperature profiles, run and plot the timeseries<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1304093567251462, 'fraction_numerical': 0.043859649122807015, 'mean_word_length': 4.819727891156463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '131611', 'license': 'MIT', 'n_tokens_mistral': 630, 'n_tokens_neox': 570, 'n_words': 194, 'path': '02_using_smrt/04_timeseries.ipynb', 'repo_name': 'mjsandells/trainin', 'size': '1710'}