-
Notifications
You must be signed in to change notification settings - Fork 4
Home
After installing lstosa
run pytest --basetemp=test_osa
from the root directory of the repository (where setup.py
is placed). You can control verbosity with -v
, -vv
, etc. If you want to execute a given test use -k <test_name>
or only some tests from a given subfolder with -m <path_to_subfolder>
.
Tests should be self-contained, i.e., everything needed by the tests should be either within the extra
subfolder or just produced by the test fixtures. Therefore, they should be able to run in any environment adequately set.
The message in the queue output says: launch failed requeued held
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
323390_112 long LST1_089 user.name PD 0:00 1 (launch failed requeued held)
This job can be resumed by doing: scontrol release 323390_112
sqlite3 /your/path/to/osa.db
Create the processing table:
CREATE TABLE IF NOT EXISTS processing
(telescope, date, prod_id, start, end, is_finished)
sqlite3 /path/to/osa.db
sqlite> .schema processing
CREATE TABLE processing`
`(telescope, date, prod_id, start, end, is_finished);
sqlite> select * from processing;
LST1|2022-06-05|v0.9|2022-06-09 19:58:03.124332|2022-06-09 21:10:10.637506|1
Example to list the source/wobble info available from all runs. Note that sometimes info is missing and accessing that information for some runs is not possible in this way.
from pymongo import MongoClient
tcu_server = "lst101-int"
client = MongoClient(tcu_server)
database = client['lst1_obs_summary']
telescope_collection = database['telescope']
telescope_summaries = telescope_collection.find({})
for telescope_entry in telescope_summaries:
try:
data = telescope_entry["data"]
structure_runs = data["structure"]
camera_runs = data["camera"]
for camera, structure in zip(camera_runs, structure_runs):
source_name = structure["target"]["name"]
# wobble = structure["target"]["wobble"]
run_number = camera["run_number"]
print(run_number, source_name) #, wobble)
except (KeyError, TypeError) as err:
print(f'Failed fetching observation info from entry: {err!r}')