Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions nightly/ConsDB_visits_metadata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,29 @@
"metadata": {},
"outputs": [],
"source": [
"if 'usdf' in os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\"):\n",
"# Where is the notebook running? (RSPs are 'special')\n",
"current_location = os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\")\n",
"\n",
"# RUBIN_SIM_DATA_DIR at usdf\n",
"if 'usdf' in current_location:\n",
" os.environ[\"RUBIN_SIM_DATA_DIR\"] = \"/sdf/data/rubin/shared/rubin_sim_data\"\n",
"\n",
"# TOKEN CONFIGURATION\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is None:\n",
" tokenfile = os.path.join(os.path.expanduser(\"~\"), \".lsst/usdf_rsp\")\n",
" site = 'usdf'\n",
"else:\n",
"if current_location != \"\":\n",
" # You are on an rsp.\n",
" # You should use the default RSP values, whether summit/base/USDF.\n",
" tokenfile = None\n",
" site = None\n",
"# If you are outside of an RSP? - just use USDF and your own USDF-RSP token\n",
"# See https://rsp.lsst.io/guides/auth/creating-user-tokens.html\n",
"else:\n",
" # Substitute the location of your own tokenfile\n",
" tokenfile = os.getenv(\"ACCESS_TOKEN_FILE\", \"\")\n",
" site = os.getenv(\"DATA_SITE\", \"\")\n",
" if tokenfile == \"\":\n",
" # A very reasonable backup.\n",
" tokenfile = os.path.join(os.path.expanduser(\"~\"), \".lsst/usdf_rsp\")\n",
" site = 'usdf'\n",
"\n",
"endpoints = connections.get_clients(tokenfile, site)\n",
"consdb = endpoints['consdb']"
Expand Down
40 changes: 22 additions & 18 deletions nightly/EvaluateScriptQueue.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,6 @@
"# EFD Scripts + Logs "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "54727427-2a2f-4501-9687-3bf819d6da99",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is not None:\n",
" print(\"updating rubin_nights\")\n",
" !pip install --user --upgrade git+https://github.com/lsst-sims/rubin_nights.git --no-deps > /dev/null 2>&1"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -61,12 +48,29 @@
"import logging\n",
"logging.getLogger('rubin_nights').setLevel(logging.INFO)\n",
"\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is None:\n",
" tokenfile = '/Users/lynnej/.lsst/usdf_rsp'\n",
" site = 'usdf'\n",
"else:\n",
"# Where is the notebook running? (RSPs are 'special')\n",
"current_location = os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\")\n",
"\n",
"# RUBIN_SIM_DATA_DIR at usdf\n",
"if 'usdf' in current_location:\n",
" os.environ[\"RUBIN_SIM_DATA_DIR\"] = \"/sdf/data/rubin/shared/rubin_sim_data\"\n",
"\n",
"# TOKEN CONFIGURATION\n",
"if current_location != \"\":\n",
" # You are on an rsp.\n",
" # You should use the default RSP values, whether summit/base/USDF.\n",
" tokenfile = None\n",
" site = None"
" site = None\n",
"# If you are outside of an RSP? - just use USDF and your own USDF-RSP token\n",
"# See https://rsp.lsst.io/guides/auth/creating-user-tokens.html\n",
"else:\n",
" # Substitute the location of your own tokenfile\n",
" tokenfile = os.getenv(\"ACCESS_TOKEN_FILE\", \"\")\n",
" site = os.getenv(\"DATA_SITE\", \"\")\n",
" if tokenfile == \"\":\n",
" # A very reasonable backup.\n",
" tokenfile = os.path.join(os.path.expanduser(\"~\"), \".lsst/usdf_rsp\")\n",
" site = 'usdf'"
]
},
{
Expand Down
32 changes: 22 additions & 10 deletions nightly/FBS_Targets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outputs": [],
"source": [
"# This cell is only for setting example parameter defaults - gets replaced by sidecar.\n",
"day_obs = \"20251120\"\n",
"day_obs = \"20251122\"\n",
"#day_obs = \"today\"\n",
"#telescope = \"AuxTel\" \n",
"telescope = \"SimonyiTel\"\n",
Expand Down Expand Up @@ -42,10 +42,10 @@
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is not None:\n",
" print(\"updating rubin_nights\")\n",
" !pip install --user --upgrade git+https://github.com/lsst-sims/rubin_nights.git --no-deps > /dev/null 2>&1"
"# import os\n",
"# if os.getenv(\"EXTERNAL_INSTANCE_URL\") is not None:\n",
"# print(\"updating rubin_nights\")\n",
"# !pip install --user --upgrade git+https://github.com/lsst-sims/rubin_nights.git --no-deps > /dev/null 2>&1"
]
},
{
Expand Down Expand Up @@ -99,17 +99,29 @@
"import rubin_nights.dayobs_utils as rn_dayobs\n",
"from rubin_nights.targets_and_visits import targets_and_visits, flag_potential_bad_visits\n",
"\n",
"if 'usdf' in os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\"):\n",
"# Where is the notebook running? (RSPs are 'special')\n",
"current_location = os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\")\n",
"\n",
"# RUBIN_SIM_DATA_DIR at usdf\n",
"if 'usdf' in current_location:\n",
" os.environ[\"RUBIN_SIM_DATA_DIR\"] = \"/sdf/data/rubin/shared/rubin_sim_data\"\n",
"\n",
"# TOKEN CONFIGURATION\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is None:\n",
" tokenfile = os.path.join(os.path.expanduser(\"~\"), \".lsst/usdf_rsp\")\n",
" site = 'usdf'\n",
"else:\n",
"if current_location != \"\":\n",
" # You are on an rsp.\n",
" # You should use the default RSP values, whether summit/base/USDF.\n",
" tokenfile = None\n",
" site = None\n",
"# If you are outside of an RSP? - just use USDF and your own USDF-RSP token\n",
"# See https://rsp.lsst.io/guides/auth/creating-user-tokens.html\n",
"else:\n",
" # Substitute the location of your own tokenfile\n",
" tokenfile = os.getenv(\"ACCESS_TOKEN_FILE\", \"\")\n",
" site = os.getenv(\"DATA_SITE\", \"\")\n",
" if tokenfile == \"\":\n",
" # A very reasonable backup.\n",
" tokenfile = os.path.join(os.path.expanduser(\"~\"), \".lsst/usdf_rsp\")\n",
" site = 'usdf'\n",
"\n",
"minutes_to_days = 1./60/24\n",
"seconds_to_days = 1./60/60/24\n",
Expand Down
65 changes: 35 additions & 30 deletions nightly/FindPotentialBadVisits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metadata": {},
"outputs": [],
"source": [
"day_obs = 20250722\n",
"day_obs = 20251115\n",
"#day_obs = \"yesterday\"\n",
"show_joined = False"
]
Expand Down Expand Up @@ -38,30 +38,6 @@
"---------"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5715adab-58f4-442d-a73d-cb049ac0865c",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is not None:\n",
" print(\"updating rubin_nights\")\n",
" !pip install --user --upgrade git+https://github.com/lsst-sims/rubin_nights.git --no-deps > /dev/null 2>&1"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e078f2ff-9b8c-45eb-ac2a-50e46c518e9f",
"metadata": {},
"outputs": [],
"source": [
"import rubin_nights\n",
"print('rubin_nights version', rubin_nights.__version__)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -101,12 +77,31 @@
"metadata": {},
"outputs": [],
"source": [
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is None:\n",
" tokenfile = '/Users/lynnej/.lsst/usdf_rsp'\n",
" site = 'usdf'\n",
"else:\n",
"# Where is the notebook running? (RSPs are 'special')\n",
"current_location = os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\")\n",
"\n",
"# RUBIN_SIM_DATA_DIR at usdf\n",
"if 'usdf' in current_location:\n",
" os.environ[\"RUBIN_SIM_DATA_DIR\"] = \"/sdf/data/rubin/shared/rubin_sim_data\"\n",
"\n",
"# TOKEN CONFIGURATION\n",
"if current_location != \"\":\n",
" # You are on an rsp.\n",
" # You should use the default RSP values, whether summit/base/USDF.\n",
" tokenfile = None\n",
" site = None\n",
"# If you are outside of an RSP? - just use USDF and your own USDF-RSP token\n",
"# See https://rsp.lsst.io/guides/auth/creating-user-tokens.html\n",
"else:\n",
" # Substitute the location of your own tokenfile\n",
" tokenfile = os.getenv(\"ACCESS_TOKEN_FILE\", \"\")\n",
" site = os.getenv(\"DATA_SITE\", \"\")\n",
" if tokenfile == \"\":\n",
" # A very reasonable backup.\n",
" tokenfile = os.path.join(os.path.expanduser(\"~\"), \".lsst/usdf_rsp\")\n",
" site = 'usdf'\n",
"\n",
"\n",
"endpoints = connections.get_clients(tokenfile=tokenfile, site=site)"
]
},
Expand Down Expand Up @@ -143,8 +138,18 @@
"if vt is None:\n",
" vt = []\n",
"print(f\"Found {len(vt)} targets->visits.\")\n",
"\n",
"if len(visits) > 0:\n",
" print(f\"Visit metadata included {visits.scheduler_note.unique()}, {visits.target_name.unique()}\")"
" def split_regions(x):\n",
" regions = set()\n",
" for k in x: #.target_name:\n",
" regions = regions.union(set([kk.replace(' ', '') for kk in k.split(',')]))\n",
" regions = list(regions)\n",
" regions.sort()\n",
" return regions\n",
" print(\"Regions observed\", split_regions(visits.target_name.unique()))\n",
" print(\"Science programs\", visits.science_program.unique())\n",
" print(\"Observation Reasons / Surveys\", np.sort(visits.observation_reason.unique()))"
]
},
{
Expand Down
41 changes: 20 additions & 21 deletions nightly/GapLogs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metadata": {},
"outputs": [],
"source": [
"day_obs = 20251109\n",
"day_obs = 20251123\n",
"time_gap = 5"
]
},
Expand All @@ -19,19 +19,6 @@
"# SQMiner Logs for LSSTCam (consdb) visit gaps {{ params.day_obs }} (gap > {{ params.time_gap }})"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "776c9fa6-2708-47a9-ad8e-8b91b6720c1c",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is not None:\n",
" print(\"updating rubin_nights\")\n",
" !pip install --user --upgrade git+https://github.com/lsst-sims/rubin_nights.git --no-deps > /dev/null 2>&1"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -56,17 +43,29 @@
"\n",
"tz_utc = ZoneInfo(\"UTC\")\n",
"\n",
"# Where is the notebook running? (RSPs are 'special')\n",
"current_location = os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\")\n",
"\n",
"if 'usdf' in os.getenv(\"EXTERNAL_INSTANCE_URL\", \"\"):\n",
"# RUBIN_SIM_DATA_DIR at usdf\n",
"if 'usdf' in current_location:\n",
" os.environ[\"RUBIN_SIM_DATA_DIR\"] = \"/sdf/data/rubin/shared/rubin_sim_data\"\n",
"\n",
"\n",
"if os.getenv(\"EXTERNAL_INSTANCE_URL\") is None:\n",
" tokenfile = '/Users/lynnej/.lsst/usdf_rsp'\n",
" site = 'usdf'\n",
"else:\n",
"# TOKEN CONFIGURATION\n",
"if current_location != \"\":\n",
" # You are on an rsp.\n",
" # You should use the default RSP values, whether summit/base/USDF.\n",
" tokenfile = None\n",
" site = None"
" site = None\n",
"# If you are outside of an RSP? - just use USDF and your own USDF-RSP token\n",
"# See https://rsp.lsst.io/guides/auth/creating-user-tokens.html\n",
"else:\n",
" # Substitute the location of your own tokenfile\n",
" tokenfile = os.getenv(\"ACCESS_TOKEN_FILE\", \"\")\n",
" site = os.getenv(\"DATA_SITE\", \"\")\n",
" if tokenfile == \"\":\n",
" # A very reasonable backup.\n",
" tokenfile = os.path.join(os.path.expanduser(\"~\"), \".lsst/usdf_rsp\")\n",
" site = 'usdf'"
]
},
{
Expand Down
Loading
Loading