-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from chhoumann/irf
IRF
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |