{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":101849,"databundleVersionId":13093295,"sourceType":"competition"}],"dockerImageVersionId":31089,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nground_truth = pd.read_csv('/kaggle/input/ariel-data-challenge-2025/train.csv')\nground_truth = ground_truth.iloc[11].values\nplanet_id = int(ground_truth[0])\nground_truth = ground_truth[2:]\nground_truth = ground_truth - np.mean(ground_truth)\n\nairs_signal = pd.read_parquet(f'/kaggle/input/ariel-data-challenge-2025/train/{planet_id}/AIRS-CH0_signal_0.parquet', engine='pyarrow').values.reshape((11250 // 2, 2, 32, 356))\n\nairs_signal = airs_signal / 0.4369 - 1000\nairs_signal = airs_signal[:, 1, ...] - airs_signal[:, 0, ...]\n\nlow = np.nanmean(airs_signal[2000: 2500, :, 39: 321], axis=(0, 1))\nhigh = np.nanmean(airs_signal[4000: 5000, :, 39: 321], axis=(0, 1))\n\nspectrum = 1 - low / high\nspectrum = pd.Series(spectrum).rolling(21, min_periods=1, center=True).mean()\nspectrum = spectrum - np.mean(spectrum)\n\nplt.figure('Bug?')\n\nplt.plot(np.arange(282), spectrum, label='Naive AIRS spectrum')\nplt.plot(np.arange(282), ground_truth, label='Original ground truth')\nplt.plot(np.arange(282), np.flip(ground_truth), label='Flipped ground truth')\n\nplt.legend()\n\nplt.show()\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-09-08T20:38:35.707889Z","iopub.execute_input":"2025-09-08T20:38:35.708261Z","iopub.status.idle":"2025-09-08T20:38:37.969453Z","shell.execute_reply.started":"2025-09-08T20:38:35.70823Z","shell.execute_reply":"2025-09-08T20:38:37.968631Z"}},"outputs":[],"execution_count":null}]}