Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions content/CC1_CMS_activity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,23 @@
"outputs": [],
"source": [
"# Installing some extra programs to help us (this may take a minute the first time this is run)\n",
"!pip -q install gdown==4.6.0\n",
"import gdown\n",
"\n",
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"import pyodide_http\n",
"pyodide_http.patch_all()\n"
"\n",
"\n",
"# run these fixes only if we're running on a JupyerLite / JupyterEverywhere platform\n",
"import sys\n",
"if (sys.platform == 'emscripten'):\n",
" import pyodide_http\n",
" from pyodide.http import pyfetch\n",
" import io\n",
" pyodide_http.patch_all()\n",
"\n",
"else:\n",
" !pip -q install gdown==4.6.0\n",
" import gdown"
]
},
{
Expand All @@ -54,11 +62,18 @@
},
"outputs": [],
"source": [
"# Load in the dimuon data set from Google Drive\n",
"muon_csv_id = '1UIgcmWP6Jzk2CX2aZqG9cSzR5vGBbQjk'\n",
"file_name = \"Muons.csv\"\n",
"gdown.download(id=muon_csv_id, output=file_name)\n",
"muons = pd.read_csv(file_name)\n"
"# Load in the dimuon data set from Google Drive (or GitHub if we're using JupyterLite)\n",
"# JupyterLite won't load the full 2015 dataset without crashing due to memory, so we're using the 2011 dataset instead\n",
"if (sys.platform == 'emscripten'):\n",
" # Load the 2011 dataset (500k rows)\n",
" url = \"https://raw.githubusercontent.com/QuarkNet-HEP/coding-camp/refs/heads/main/content/data/Double_Muon_Run2011A.csv\"\n",
" muons = pd.read_csv(url)\n",
"else:\n",
" # Load the full 2015 dataset (1M+ rows)\n",
" muon_csv_id = '1UIgcmWP6Jzk2CX2aZqG9cSzR5vGBbQjk'\n",
" file_name = \"Muons.csv\"\n",
" gdown.download(id=muon_csv_id, output=file_name)\n",
" muons = pd.read_csv(file_name)"
]
},
{
Expand Down
8 changes: 6 additions & 2 deletions content/Elements.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"pd.options.display.max_rows = 120\n",
"import pyodide_http\n",
"pyodide_http.patch_all()\n"
"\n",
"# run these fixes only if we're running on a JupyerLite / JupyterEverywhere platform\n",
"import sys\n",
"if (sys.platform == 'emscripten'):\n",
" import pyodide_http\n",
" pyodide_http.patch_all()\n"
]
},
{
Expand Down
9 changes: 6 additions & 3 deletions content/Falcon_9_Rocket_Data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@
"mpl.rcParams.update(mpl.rcParamsDefault)\n",
"%matplotlib inline\n",
"\n",
"import pyodide_http\n",
"pyodide_http.patch_all()\n",
"# run these fixes only if we're running on a JupyerLite / JupyterEverywhere platform\n",
"import sys\n",
"if (sys.platform == 'emscripten'):\n",
" import pyodide_http\n",
" pyodide_http.patch_all()\n",
"\n",
"\n",
"# Set the graph size to be large\n",
"#plt.rcParams['figure.figsize'] = (10,6)\n",
"#plt.rcParams['figure.dpi'] = 600\n",
"\n",
"#Importing the data set\n",
"data_url = \"https://raw.githubusercontent.com/Peter-Apps/Coding-in-MS-HS/master/Falcon%209%20Rocket%20Data.csv\"\n",
"data_url = \"https://raw.githubusercontent.com/QuarkNet-HEP/coding-camp/refs/heads/main/content/data/Falcon%209%20Rocket%20Data.csv\"\n",
"data = pd.read_csv(data_url,on_bad_lines='skip')"
]
},
Expand Down
29 changes: 26 additions & 3 deletions content/basic_stats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
"import numpy as np\n",
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"import pyodide_http\n",
"pyodide_http.patch_all()\n"
"\n",
"# run these fixes only if we're running on a JupyerLite / JupyterEverywhere platform\n",
"import sys\n",
"if (sys.platform == 'emscripten'):\n",
" import pyodide_http\n",
" pyodide_http.patch_all()\n"
]
},
{
Expand All @@ -36,7 +40,7 @@
"outputs": [],
"source": [
"# read in a data file.\n",
"data = pd.read_csv('https://github.com/QuarkNet-HEP/coding-camp/raw/main/data/Double_Muon_Run2011A.csv')\n",
"data = pd.read_csv('https://raw.githubusercontent.com/QuarkNet-HEP/coding-camp/refs/heads/main/content/data/Double_Muon_Run2011A.csv')\n",
"data.head()"
]
},
Expand Down Expand Up @@ -168,6 +172,25 @@
"## Credits\n",
"This notebook was designed by [Quarknet](https://quarknet.org/) Teaching and Learning Fellow [Adam LaMee](https://adamlamee.github.io/). The handy csv files were created from the CMS Run2011A primary datasets and converted from ROOT format by the masterful [Tom McCauley](https://github.com/tpmccauley). More can be found on the [CERN OpenData](http://opendata.cern.ch/?ln=en) site, like [here](http://opendata.cern.ch/record/545). The 3D vector image can be found on [WikiMedia Commons](https://commons.wikimedia.org/wiki/File:Coord_XYZ.svg). Finally, thanks to the great folks at [Binder](https://mybinder.org/) and [Google Colaboratory](https://colab.research.google.com/notebooks/intro.ipynb) for making this notebook interactive without you needing to download it or install [Jupyter](https://jupyter.org/) on your own device. Find more activities and license info at [CODINGinK12.org](http://www.codingink12.org)."
]
},
{
"cell_type": "markdown",
"id": "f40c8fac",
"metadata": {},
"source": [
"# Acknowledgements & Licenses\n",
"\n",
"The development and implementation of these materials and workshop were additionally funded by generous support from IRIS-HEP, the [Institute for Research and Innovation in Software for High Energy Physics](https://iris-hep.org/).\n",
"\n",
"This work is licensed under a\n",
"[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].\n",
"\n",
"[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]\n",
"\n",
"[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/\n",
"[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png\n",
"[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg"
]
}
],
"metadata": {
Expand Down
Loading
Loading