Skip to content

Commit

Permalink
looping over provided instruments
Browse files Browse the repository at this point in the history
  • Loading branch information
Vebop committed Sep 18, 2024
1 parent f1361f9 commit cca18f1
Showing 1 changed file with 42 additions and 38 deletions.
80 changes: 42 additions & 38 deletions notebooks_tsqr/consdb/assorted_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,17 @@
},
{
"cell_type": "markdown",
"id": "656dd809",
"id": "4",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
"\n",
"psf_query = f'''\n",
" SELECT psf_area FROM cdb_lsstcomcamsim.ccdvisit1_quicklook\n",
" where day_obs = {day_obs_int}\n",
"'''\n",
"\n",
"sky_brightness_query = f'''\n",
"'''\n",
"\n",
"zero_point_query = f'''\n",
" SELECT zero_point FROM cdb_lsstcomcamsim.ccdvisit1_quicklook\n",
" where day_obs = {day_obs_int}\n",
"'''\n",
"\n",
"ra_dec_query = f'''\n",
" SELECT s_ra, s_dec FROM cdb_lsstcomcamsim.ccdvisit1_quicklook\n",
" where day_obs = {day_obs_int}\n",
"'''\n",
"\n",
"plt.style.use('seaborn-v0_8-bright')\n",
"def plot(y, x):\n",
" # plot\n",
Expand All @@ -95,15 +76,16 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
"day_obs_int = int(day_obs.replace('-', ''))\n",
"\n",
"instrument_list = instruments.split(',',' ')\n",
"instrument_list = [ins.strip() for ins in instruments.split(',')]\n",
"\n",
"for instrument in instrument_list:\n",
" print(f'instrumental {instrument}')\n",
" ccdvisit1_quicklook = f'''\n",
" SELECT * FROM cdb_{instrument}.ccdvisit1_quicklook\n",
" '''\n",
Expand All @@ -119,18 +101,24 @@
" visits = visits.join(quicklook, on='visit_id',lsuffix='',rsuffix='_q')\n",
"\n",
" # If we see data exist in psf, zero, then we should pare down like visits_today below\n",
" visits_w_psf = visits[visits['psf_area'].notna()]\n",
" time = visits_w_psf['obs_start']\n",
" print(f'length of visits with psf_area populated {len(visits_w_psf)}')\n",
" display_markdown('# psf_area vs obs_start', raw=True)\n",
" plot(time, visits_w_psf['psf_area'])\n",
"\n",
" visits_w_zero = visits[visits['zero_point'].notna()]\n",
" time = visits_w_zero['obs_start']\n",
" print(f'length of visits with zero_point populated {len(visits_w_zero)}')\n",
" display_markdown('# zero_point vs obs_start', raw=True)\n",
" plot(time, visits_w_zero['zero_point'])\n",
"\n",
" try:\n",
" visits_w_psf = visits[visits['psf_area'].notna()]\n",
" time = visits_w_psf['obs_start']\n",
" print(f'length of visits with psf_area populated {len(visits_w_psf)}')\n",
" display_markdown('# psf_area vs obs_start', raw=True)\n",
" plot(time, visits_w_psf['psf_area'])\n",
" except KeyError as err:\n",
" print(\"No psf\")\n",
" \n",
" try:\n",
" visits_w_zero = visits[visits['zero_point'].notna()]\n",
" time = visits_w_zero['obs_start']\n",
" print(f'length of visits with zero_point populated {len(visits_w_zero)}')\n",
" display_markdown('# zero_point vs obs_start', raw=True)\n",
" plot(time, visits_w_zero['zero_point'])\n",
" except KeyError as err:\n",
" print(\"No zero_point\")\n",
" \n",
" # Pare down to only day obs\n",
" visits_today = visits[(visits['day_obs'] == day_obs_int)]\n",
"\n",
Expand All @@ -139,13 +127,29 @@
" display_markdown('# Ra Dec proof they populated', raw=True)\n",
" plot(ra, dec)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "logrep",
"display_name": "LSST",
"language": "python",
"name": "python3"
"name": "lsst"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -157,7 +161,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down

0 comments on commit cca18f1

Please sign in to comment.