97 lines
2.6 KiB
Plaintext
97 lines
2.6 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import os\n",
|
|
"from nbutils import add_project_path_to_sys_path\n",
|
|
"\n",
|
|
"\n",
|
|
"# Add project root to sys.path\n",
|
|
"add_project_path_to_sys_path()\n",
|
|
"\n",
|
|
"import pandas as pd\n",
|
|
"import numpy as np\n",
|
|
"import matplotlib.pyplot as plt\n",
|
|
"\n",
|
|
"try:\n",
|
|
" import src.hdf5_ops as hdf5_ops\n",
|
|
" import visualization.napp_plotlib as napp\n",
|
|
" #import pipelines.metadata_revision as metadata_revision\n",
|
|
" print(\"Imports successful!\")\n",
|
|
"except ImportError as e:\n",
|
|
" print(f\"Import error: {e}\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Define h5 file name and make sure file is located at the current working dir\n",
|
|
"filename = '../input_files/FileList_v2.h5'\n",
|
|
"\n",
|
|
"# Read h5 file into dataframe\n",
|
|
"dataframe = hdf5_ops.read_mtable_as_dataframe(filename)\n",
|
|
"\n",
|
|
"\n",
|
|
"dataframe['lastModifiedDatestr']\n",
|
|
"print(dataframe.columns)\n",
|
|
"\n",
|
|
"dataframe.head()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"dataframe['image'][0].shape\n",
|
|
"\n",
|
|
"name_filter = (dataframe['name'] == '0116116_Cl2p_750eV.ibw').to_numpy()\n",
|
|
"date_filter = np.array(['Jun-2023' in date for date in dataframe['lastModifiedDatestr']])\n",
|
|
"\n",
|
|
"filter = np.logical_and(name_filter.flatten(),date_filter.flatten()) \n",
|
|
"\n",
|
|
"napp.plot_image(dataframe,filter)\n",
|
|
"napp.plot_spectra(dataframe,filter)\n",
|
|
"\n",
|
|
"name_filter = np.array(['merge' in name for name in dataframe['name'] ])\n",
|
|
"date_filter = np.array(['Jun-2023' in date for date in dataframe['lastModifiedDatestr']])\n",
|
|
"filter = np.logical_and(name_filter.flatten(),date_filter.flatten()) \n",
|
|
"\n",
|
|
"\n",
|
|
"napp.plot_spectra(dataframe,filter)\n",
|
|
"\n"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "multiphase_chemistry_env",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.11.9"
|
|
},
|
|
"orig_nbformat": 4
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|