<jupyter_start><jupyter_text>Menyanthes File*Developed by <NAME>* Menyanthes is timeseries analysis software used by many people in the Netherlands. In this example a Menyanthes-file with one observation-series is imported, and simulated. There are several stresses in the Menyanthes-file, among which are three groundwater extractions with a significant influence on groundwater head.<jupyter_code># First perform the necessary imports
import matplotlib.pyplot as plt
import pastas as ps

%matplotlib notebook<jupyter_output><empty_output><jupyter_text>1. Importing the Menyanthes-fileImport the Menyanthes-file with observations and stresses. Then plot the observations, together with the diferent stresses in the Menyanthes file.<jupyter_code># how to use it?
fname = '../data/MenyanthesTest.men'
meny = ps.read.MenyData(fname)

# plot some series
f1, axarr = plt.subplots(len(meny.IN)+1, sharex=True)
oseries = meny.H['Obsevation well']["values"]
oseries.plot(ax=axarr[0])
axarr[0].set_title(meny.H['Obsevation well']["Name"])
for i, val in enumerate(meny.IN.items()):
    name, data = val
    data["values"].plot(ax=axarr[i+1])
    axarr[i+1].set_title(name)
plt.tight_layout(pad=0)
plt.show()<jupyter_output><empty_output><jupyter_text>2. Run a modelMake a model with precipitation, evaporation and three groundwater extractions.<jupyter_code># Create the time series model
ml = ps.Model(oseries)

# Add precipitation
IN = meny.IN['Precipitation']['values']
IN.index = IN.index.round("D")
IN2 = meny.IN['Evaporation']['values']
IN2.index = IN2.index.round("D")
ts = ps.StressModel2([IN, IN2], ps.Gamma, 'Recharge')
ml.add_stressmodel(ts)

# Add well extraction 1
# IN = meny.IN['Extraction 1']
# # extraction amount counts for the previous month
# ts = ps.StressModel(IN['values'], ps.Hantush, 'Extraction_1', up=False,
#                     settings="well")
# ml.add_stressmodel(ts)

# Add well extraction 2
IN = meny.IN['Extraction 2']
# extraction amount counts for the previous month
ts = ps.StressModel(IN['values'], ps.Hantush, 'Extraction_2', up=False,
                    settings="well")
ml.add_stressmodel(ts)

# Add well extraction 3
IN = meny.IN['Extraction 3']
# extraction amount counts for the previous month
ts = ps.StressModel(IN['values'], ps.Hantush, 'Extraction_3', up=False,
                    settings="well")
ml.add_stressmodel(ts)

# Solve the model (can take around 20 seconds..)
ml.solve()<jupyter_output>INFO: Cannot determine frequency of series None
INFO: Inferred frequency from time series None: freq=D 
INFO: Inferred frequency from time series None: freq=D 
INFO: Cannot determine frequency of series None
INFO: Time Series None: values of stress were transformedto daily values (frequency not altered) with: divide
INFO: Time Series None: values of stress were transformedto daily values (frequency not altered) with: divide
INFO: Time Series None was sampled down to freq D with method timestep_weighted_resample
INFO: Cannot determine frequency of series None
INFO: Time Series None: values of stress were transformedto daily values (frequency not altered) with: divide
INFO: Time Series None: values of stress were transformedto daily values (frequency not altered) with: divide
INFO: Time Series None was sampled down to freq D with method timestep_weighted_resample
INFO: Time Series None: values of stress were transformedto daily values (frequency not altered) with: divide
INFO: Time Serie[...]<jupyter_text>3. Plot the decompositionShow the decomposition of the groundwater head, by plotting the influence on groundwater head of each of the stresses.<jupyter_code>ax = ml.plots.decomposition(ytick_base=1.)
ax[0].set_title('Observations vs simulation')
ax[0].legend()
ax[0].figure.tight_layout(pad=0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.0082010582010582, 'mean_word_length': 5.4965635738831615, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '387', 'license': 'MIT', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1132, 'n_words': 400, 'path': 'examples/notebooks/4_menyanthes_file.ipynb', 'repo_name': 'pgraafstra/pastas', 'size': '3785'}