<jupyter_start><jupyter_text>Pyosim in the cloudwith [pyomeca](https://github.com/pyomeca/pyoma)<NAME> (<EMAIL> | [GitHub](https://github.com/romainmartinez))   Inverse kinematics<jupyter_code>from pathlib import Path

import yaml

import numpy as np
import pandas as pd
from pyosim import Conf
from pyomeca import Analogs3d

import altair as alt

alt.data_transformers.enable("json")
MODEL = "wu"
DATA = '1_inverse_kinematic'
EXT = 'mot'
aws_conf = yaml.safe_load(open("../conf.yml"))

conf = Conf(project_path=aws_conf["path"]["project"]["local"])
participants = conf.get_participants_to_process()
conf.check_confs()
data = []
for iparticipant in participants:
    data_path = conf.project_path / iparticipant / DATA
    for ifile in data_path.glob(f"*.{EXT}"):
        f = ifile.stem.replace(f"{MODEL}_", "")
        meta = {
            "filename": ifile.stem,
            "participant": f[:4].lower(),
            "sex": f[4],
            "height": f[-3],
            "weight": f[5:].split("H")[0],
            "trial": f[-1],
        }
        d = Analogs3d.from_sto(ifile)
        data.append(
#             d.low_pass(freq=d.get_rate, order=2, cutoff=6)
            d
            .time_normalization()
            .update_misc(meta)
            .to_dataframe(add_metadata=["misc"])
        )
data = pd.concat(data).reset_index()

print(data.shape)
data.head()
data_wide = data.melt(id_vars=["index", "filename", "participant", "sex", "height", "weight", "trial"])
data_wide.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15942028985507245, 'fraction_numerical': 0.007246376811594203, 'mean_word_length': 3.2194444444444446, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '548660', 'license': 'Apache-2.0', 'n_tokens_mistral': 550, 'n_tokens_neox': 530, 'n_words': 99, 'path': 'notebooks/01.01-inverse-kinematics.ipynb', 'repo_name': 'pyomeca/pyosim_aws', 'size': '1544'}