Skip to content

Commit

Permalink
Added DDV to Nightlog, Organized assorted plots for move to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Vebop committed Sep 19, 2024
1 parent cca18f1 commit 7c75c50
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 56 deletions.
71 changes: 37 additions & 34 deletions notebooks_tsqr/NightLog.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,33 @@
"id": "9",
"metadata": {},
"source": [
"# Almanac"
"# DDV"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"metadata": {},
"outputs": [],
"source": [
"DDV = f\"{server}/rubintv-dev/ddv/index.html\"\n",
"display_markdown(f'Access DDV part of RubinTV: {DDV}', raw=True)\n"
]
},
{
"cell_type": "markdown",
"id": "11",
"metadata": {},
"source": [
"# Almanac"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"metadata": {},
"outputs": [],
"source": [
"# Display various almanac values (for moon, sun)\n",
Expand All @@ -199,7 +214,7 @@
},
{
"cell_type": "markdown",
"id": "11",
"id": "13",
"metadata": {},
"source": [
"# Night Report"
Expand All @@ -208,12 +223,8 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"id": "14",
"metadata": {},
"outputs": [],
"source": [
"# Get data from Night Report log. Display nightly Jira BLOCKS.\n",
Expand Down Expand Up @@ -254,7 +265,7 @@
},
{
"cell_type": "markdown",
"id": "13",
"id": "15",
"metadata": {},
"source": [
"# Exposure Log"
Expand All @@ -263,12 +274,8 @@
{
"cell_type": "code",
"execution_count": null,
"id": "14",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"id": "16",
"metadata": {},
"outputs": [],
"source": [
"# Get data from Exposure log. Display time log.\n",
Expand Down Expand Up @@ -298,7 +305,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "15",
"id": "17",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -308,12 +315,8 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"id": "18",
"metadata": {},
"outputs": [],
"source": [
"# Display Observation gaps\n",
Expand All @@ -335,7 +338,7 @@
},
{
"cell_type": "markdown",
"id": "17",
"id": "19",
"metadata": {},
"source": [
"# Narrative Log\n"
Expand All @@ -344,7 +347,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "18",
"id": "20",
"metadata": {
"jupyter": {
"source_hidden": true
Expand Down Expand Up @@ -389,7 +392,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"id": "21",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -403,7 +406,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"id": "22",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -413,15 +416,15 @@
{
"cell_type": "code",
"execution_count": null,
"id": "21",
"id": "23",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "22",
"id": "24",
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -443,7 +446,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
64 changes: 42 additions & 22 deletions notebooks_tsqr/consdb/assorted_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"import pandas as pd\n",
"import matplotlib.pylab as plt\n",
"from IPython.display import display, Markdown, display_markdown\n",
"\n",
"from lsst.summit.utils import ConsDbClient"
"%matplotlib inline"
]
},
{
Expand All @@ -34,36 +33,24 @@
"metadata": {},
"outputs": [],
"source": [
"### 'Get Consdb access'\n",
"from lsst.summit.utils import ConsDbClient\n",
"\n",
"URL = \"http://consdb-pq.consdb:8080/consdb\" # Don't use this one\n",
"os.environ[\"no_proxy\"] += \",.consdb\"\n",
"%matplotlib inline\n",
"day_obs_int = int(day_obs.replace('-', ''))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"\n",
"client = ConsDbClient(URL)\n",
"display_markdown('### Consolidated Database is accessible',raw=True)"
]
},
{
"cell_type": "markdown",
"id": "4",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"# Put Plot in backend\n",
"plt.style.use('seaborn-v0_8-bright')\n",
"def plot(y, x):\n",
" # plot\n",
Expand All @@ -76,16 +63,16 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
"day_obs_int = int(day_obs.replace('-', ''))\n",
"\n",
"instrument_list = [ins.strip() for ins in instruments.split(',')]\n",
"\n",
"for instrument in instrument_list:\n",
" print(f'instrumental {instrument}')\n",
" #################### Put in Backend\n",
" ccdvisit1_quicklook = f'''\n",
" SELECT * FROM cdb_{instrument}.ccdvisit1_quicklook\n",
" '''\n",
Expand All @@ -99,6 +86,7 @@
" quicklook = client.query(ccdvisit1_quicklook).to_pandas()\n",
"\n",
" visits = visits.join(quicklook, on='visit_id',lsuffix='',rsuffix='_q')\n",
" #################### Put in Backend - end\n",
"\n",
" # If we see data exist in psf, zero, then we should pare down like visits_today below\n",
" try:\n",
Expand Down Expand Up @@ -128,6 +116,22 @@
" plot(ra, dec)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -143,6 +147,22 @@
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "9",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 7c75c50

Please sign in to comment.