From 4b8b7ea8e4e9668c32f5636664b3e34899cd6c1f Mon Sep 17 00:00:00 2001 From: jrob93 Date: Tue, 30 Jul 2024 14:43:09 +0100 Subject: [PATCH] demo nb --- notebooks/colour_functions_demo.ipynb | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/notebooks/colour_functions_demo.ipynb b/notebooks/colour_functions_demo.ipynb index 0feeaa5..902f481 100644 --- a/notebooks/colour_functions_demo.ipynb +++ b/notebooks/colour_functions_demo.ipynb @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b35e509", + "id": "73871e56", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "483aad4b", + "id": "63980010", "metadata": {}, "source": [ "Now we can inpsect how the colour of the object varies (or not) as a function of time. The adler function `col_obs_ref` will compare the latest observation in a given filter with observations in another filter. By setting parameter `N_ref` one can set how many past obsevrations to use when calculating the latest colour." @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a32cb06", + "id": "bd0e0185", "metadata": {}, "outputs": [], "source": [ @@ -223,19 +223,19 @@ "ax1 = plt.subplot(gs[0, 0])\n", "\n", "col_dict_list = []\n", - "for i in range(len(t_app) - 1):\n", + "for app_i in range(len(t_app) - 1):\n", " # consider only one apparition\n", - " if i != 3:\n", + " if app_i != 3:\n", " continue\n", "\n", - " time_min = t_app[i]\n", - " time_max = t_app[i + 1]\n", + " time_min = t_app[app_i]\n", + " time_max = t_app[app_i + 1]\n", " print(time_min, time_max)\n", "\n", " _df_obs_all = df_obs_all[\n", " (df_obs_all[\"midPointMjdTai\"] >= time_min) & (df_obs_all[\"midPointMjdTai\"] < time_max)\n", " ]\n", - " print(i, len(_df_obs_all))\n", + " print(app_i, len(_df_obs_all))\n", " _time_max = np.amax(_df_obs_all[\"midPointMjdTai\"])\n", "\n", " # get the phase curve model and observations for each filter\n", @@ -259,9 +259,9 @@ "\n", " # simulate stepping through each filt_obs observation\n", " x1 = time_min\n", - " for i in range(len(df_obs)):\n", - " x2 = df_obs.iloc[i][x_plot]\n", - " print(i, x1, x2)\n", + " for xi in range(len(df_obs)):\n", + " x2 = df_obs.iloc[xi][x_plot]\n", + " print(xi, x1, x2)\n", "\n", " # do the colour finding function here\n", " col_dict = col_obs_ref(\n", @@ -279,7 +279,7 @@ " col_dict_list.append(col_dict)\n", "\n", " # plot some lines to show the colour and mean reference\n", - " ax1.vlines(df_obs.iloc[i][x_plot], df_obs.iloc[i][y_plot], col_dict[y_ref_col], color=\"k\", ls=\":\")\n", + " ax1.vlines(df_obs.iloc[xi][x_plot], df_obs.iloc[xi][y_plot], col_dict[y_ref_col], color=\"k\", ls=\":\")\n", " ax1.hlines(col_dict[y_ref_col], col_dict[x1_ref_col], col_dict[x2_ref_col], color=\"k\", ls=\"--\")\n", "\n", "# store running colour parameters as a dataframe\n", @@ -297,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ab8b05a", + "id": "a7734122", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd42d97c", + "id": "0cd867d9", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1c71812", + "id": "05abfee3", "metadata": {}, "outputs": [], "source": [ @@ -361,7 +361,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cded6f36", + "id": "605a043a", "metadata": {}, "outputs": [], "source": []