Skip to content

Commit

Permalink
Merge pull request #17 from chhoumann/irf
Browse files Browse the repository at this point in the history
IRF
  • Loading branch information
Ivikhostrup authored Nov 6, 2023
2 parents 9f22229 + 14a0066 commit 2b83ca5
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions baseline/irf.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"ccam_dw = pd.read_csv(\"data/data/calib/ccam_default_wave.tab\", sep=\"\\t\", header=None)\n",
"ccam_gain = pd.read_csv(\"data/data/calib/gain_mars.tab\", sep=\"\\t\", header=None)\n",
"\n",
"# Check that both DataFrames have the same number of rows\n",
"if ccam_dw.shape[0] != ccam_gain.shape[0]:\n",
" raise ValueError(\"The DataFrames have different numbers of rows, they can't be merged directly.\")\n",
"\n",
"df = pd.concat([ccam_dw, ccam_gain], axis=1)\n",
"df.columns = [\"wave\", \"gain\"]\n",
"\n",
"# remove rows with 0 values\n",
"df = df[df[\"gain\"] != 0]\n",
"\n",
"# sort by wavelength\n",
"df.sort_values(by=[\"wave\"], inplace=True)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "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.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 2b83ca5

Please sign in to comment.