-
Notifications
You must be signed in to change notification settings - Fork 0
/
snow_white_script.py
49 lines (45 loc) · 1.14 KB
/
snow_white_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from astra import __version__
from astra.pipelines.snow_white import snow_white
from tqdm import tqdm
from astra.models import BossCombinedSpectrum, Source, SnowWhite, BossRestFrameVisitSpectrum
from peewee import JOIN
q = (
BossCombinedSpectrum
.select()
.join(Source)
.switch(BossCombinedSpectrum)
.join(
SnowWhite,
JOIN.LEFT_OUTER,
on=(
(SnowWhite.spectrum_pk == BossCombinedSpectrum.spectrum_pk)
& (SnowWhite.v_astra == __version__)
)
)
.where(
Source.assigned_to_program("mwm_wd")
& SnowWhite.spectrum_pk.is_null()
)
)
for item in tqdm(snow_white(q), total=1):
None
q = (
BossRestFrameVisitSpectrum
.select()
.join(Source)
.switch(BossRestFrameVisitSpectrum)
.join(
SnowWhite,
JOIN.LEFT_OUTER,
on=(
(SnowWhite.spectrum_pk == BossRestFrameVisitSpectrum.spectrum_pk)
& (SnowWhite.v_astra == __version__)
)
)
.where(
Source.assigned_to_program("mwm_wd")
& SnowWhite.spectrum_pk.is_null()
)
)
for item in tqdm(snow_white(q), total=1):
None