Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wind Farm Monitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
Wind Farm Monitor
Merge requests
!3
Reduced schedule to one night
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Merged
Reduced schedule to one night
brentjens
into
main
Overview
0
Commits
1
Pipelines
0
Changes
2
Merged
Michiel Brentjens
requested to merge
brentjens
into
main
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
dac686e4
1 commit,
2 years ago
2 files
+
20
−
20
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
notebooks/monitoring-observation.ipynb
+
18
−
20
Options
%% Cell type:markdown id:4f48b265-2419-477c-89a0-308be16a32d6 tags:
# Monitoring observation
Observations at the stations are performed using https://git.astron.nl/brentjens/lofar-black-ops
%% Cell type:code id:aa78bd0a-de98-4a65-8dec-d1107aa76c0c tags:
```
python
%
matplotlib
widget
%
load_ext
autoreload
%
autoreload
2
```
%% Cell type:code id:a4804e27-81d3-41b7-96fd-d00d3fab1d93 tags:
```
python
from
windfarmmonitor
import
windfarmmonitor
as
wfm
import
pandas
as
pd
import
astropy
as
apy
from
astropy
import
units
as
u
import
lofarobsxml
as
lox
```
%% Cell type:code id:9a6cca25-bad0-4040-839e-9a1f3f15cc0c tags:
```
python
FIRST_DATE
=
'
2019-09-10
'
LAST_DATE
=
'
2019-09-04
'
```
%% Cell type:code id:3157da6b-3676-440c-95b9-92d310418546 tags:
```
python
sunset_utc
=
apy
.
time
.
Time
(
str
(
lox
.
next_sunset
(
FIRST_DATE
)).
replace
(
'
/
'
,
'
-
'
),
scale
=
'
utc
'
)
sunrise_utc
=
apy
.
time
.
Time
(
str
(
lox
.
next_sunrise
(
LAST_DATE
)).
replace
(
'
/
'
,
'
-
'
),
scale
=
'
utc
'
)
sunset_utc
.
iso
,
sunrise_utc
.
iso
```
%% Cell type:markdown id:b026f789-5feb-41d0-9e7a-04920632fd60 tags:
## Observations start at 18:30 UTC and end at 04:30 UTC.
This leaves 9.5 h to perform 4 2 hour observations
Rise and set of Tau A and Vir A are important moments. We should avoid observing when they do.
19:00 on first day -> 8
*
4 = 32 min earlier on last day
%% Cell type:code id:c98f74cf-bd36-4ba1-8f59-140a91c97fc3 tags:
```
python
f
=
wfm
.
celestial_sources_alt_az
(
'
2019-09-02 19:00
'
)
# f
```
%% Cell type:markdown id:d25f0f8a-ab69-46e8-85ac-bd32893e91d7 tags:
Tau A rises 22:10 on second of september. Try: 19:00-21:00 LBA; 21:00-22:00 HBA_LOW part I BREAK UNTIL 23:30, then HBA_HIGH until 01:30, HBA_MID 01:30-03:30
-
19:00-21:00 LBA
-
21:05-22:05 HBA_LOW I
-
#Break for Tau A rising
-
23:30-00:30 HBA_LOW II
-
00:35-02:35 HBA_HIGH
-
02:40-04:40 HBA_MID
%% Cell type:code id:5bcdfd42-954c-4c9b-aec5-37c34426af2a tags:
```
python
apy
.
time
.
Time
(
'
2019-09-02 22:00
'
,
scale
=
'
utc
'
,
location
=
wfm
.
LOFAR
).
sidereal_time
(
'
apparent
'
)
```
%% Cell type:code id:38c1f5ab-42c8-4f7f-82f2-1eec1f07eb48 tags:
```
python
#schedule_header= ['start_utc', 'end_utc', 'band', 'beam_config', 'rcu_mode', 'sb_main', 'sb_cal', 'tx_carrier_spacing_kHz', 'tx_power_dB', 'tx_pol', 'SAS_ID', 'remark']
schedule_header
=
[(
'
Start
'
,
'
(UTC)
'
),
(
'
End
'
,
'
(UTC)
'
),
(
'
Band
'
,
''
),
(
'
Beam
'
,
''
),
(
'
RCU
'
,
''
),
(
'
Subbands
'
,
'
(main)
'
),
(
'
Subbands
'
,
'
(aux)
'
),
(
'
TX rate
'
,
'
(kHz)
'
),
(
'
TX power
'
,
'
(dB)
'
),
(
'
TX pol
'
,
'
(H/V)
'
),
(
'
OBS ID
'
,
''
),
(
'
Remarks
'
,
''
)]
mi_columns
=
pd
.
MultiIndex
.
from_tuples
(
schedule_header
)
ORIGINAL_SCHEDULE
=
[(
0
,
'
V
'
,
'
Production
'
),]
OVERALL_SCHEDULE
=
[(
0
,
'
V
'
,
'
Production
'
),
(
1
,
'
V
'
,
'
Production
'
),
(
2
,
'
V
'
,
'
OFF
'
),
(
3
,
'
V
'
,
'
Downtime Standby Plus
'
),
(
4
,
'
V
'
,
'
Downtime Standby
'
),
(
5
,
'
H
'
,
'
Production
'
),
(
6
,
'
H
'
,
'
Downtime Standby
'
),
(
7
,
'
H
'
,
'
Downtime Standby Plus
'
),
(
8
,
'
H
'
,
'
OFF
'
),
(
9
,
'
H
'
,
'
Production
'
),
(
10
,
'
H
'
,
'
EMC shutdown; RED light
'
),
(
11
,
'
V
'
,
'
EMC shutdown; RED light
'
),
(
12
,
'
V
'
,
'
SPARE NIGHT
'
),
]
#
OVERALL_SCHEDULE = [(0, 'V', 'Production'),
#
(1, 'V', 'Production'),
#
(2, 'V', 'OFF'),
#
(3, 'V', 'Downtime Standby Plus'),
#
(4, 'V', 'Downtime Standby'),
#
(5, 'H', 'Production'),
#
(6, 'H', 'Downtime Standby'),
#
(7, 'H', 'Downtime Standby Plus'),
#
(8, 'H', 'OFF'),
#
(9, 'H', 'Production'),
#
(10, 'H', 'EMC shutdown; RED light'),
#
(11, 'V', 'EMC shutdown; RED light'),
#
(12, 'V', 'SPARE NIGHT'),
#
]
schedule
=
[]
for
day
,
pol
,
wtg
in
O
VERAL
L_SCHEDULE
:
for
day
,
pol
,
wtg
in
O
RIGINA
L_SCHEDULE
:
OBS_SCHEDULE_TEMPLATE
=
[
(
wfm
.
add_sidereal_days
(
'
2019-09-02 19:00:00
'
,
day
),
wfm
.
add_sidereal_days
(
'
2019-09-02 21:00:00
'
,
day
),
'
LBA
'
,
wfm
.
BM_SPLIT
,
wfm
.
RCU_10_90
,
'
51:460
'
,
wfm
.
cal_subbands
(
200
,
51
,
460
,
78
),
1000
,
'
0: 12s OFF: 48s
'
,
pol
,
-
1
,
wtg
),
(
wfm
.
add_sidereal_days
(
'
2019-09-02 21:05:00
'
,
day
),
wfm
.
add_sidereal_days
(
'
2019-09-02 22:05:00
'
,
day
),
'
HBA
'
,
wfm
.
BM_SPLIT
,
wfm
.
RCU_110_190
,
'
51:460
'
,
wfm
.
cal_subbands
(
200
,
51
,
460
,
78
),
1000
,
'
0: 12s OFF: 48s
'
,
pol
,
-
1
,
wtg
),
(
wfm
.
add_sidereal_days
(
'
2019-09-02 23:30:00
'
,
day
),
wfm
.
add_sidereal_days
(
'
2019-09-03 00:30:00
'
,
day
),
'
HBA
'
,
wfm
.
BM_SPLIT
,
wfm
.
RCU_110_190
,
'
51:460
'
,
wfm
.
cal_subbands
(
200
,
51
,
460
,
78
),
1000
,
'
0: 12s OFF: 48s
'
,
pol
,
-
1
,
wtg
),
(
wfm
.
add_sidereal_days
(
'
2019-09-03 00:35:00
'
,
day
),
wfm
.
add_sidereal_days
(
'
2019-09-03 02:35:00
'
,
day
),
'
HBA
'
,
wfm
.
BM_SPLIT
,
wfm
.
RCU_210_250
,
'
51:256
'
,
wfm
.
cal_subbands
(
200
,
51
,
256
,
200
),
1000
,
'
0: 12s OFF: 48s
'
,
pol
,
-
1
,
wtg
),
(
wfm
.
add_sidereal_days
(
'
2019-09-03 02:40:00
'
,
day
),
wfm
.
add_sidereal_days
(
'
2019-09-03 04:40:00
'
,
day
),
'
HBA
'
,
wfm
.
BM_SPLIT
,
wfm
.
RCU_170_230
,
'
145:365
'
,
wfm
.
cal_subbands
(
160
,
145
,
365
,
180
),
1000
,
'
0: 12s OFF: 48s
'
,
pol
,
-
1
,
wtg
),
(
wfm
.
add_sidereal_days
(
'
2019-09-02 22:15:00
'
,
day
),
wfm
.
add_sidereal_days
(
'
2019-09-03 00:15:00
'
,
day
),
'
HBA
'
,
wfm
.
BM_SPLIT
,
wfm
.
RCU_210_250
,
'
51:256
'
,
wfm
.
cal_subbands
(
200
,
51
,
256
,
200
),
1000
,
'
0: 12s OFF: 48s
'
,
pol
,
-
1
,
wtg
),
#(wfm.add_sidereal_days('2019-09-03 02:40:00', day), wfm.add_sidereal_days('2019-09-03 04:40:00', day), 'HBA', wfm.BM_SPLIT , wfm.RCU_170_230, '145:365', wfm.cal_subbands(160, 145, 365, 180), 1000, '0: 12s OFF: 48s', pol, -1, wtg),
]
schedule
+=
OBS_SCHEDULE_TEMPLATE
september
=
pd
.
DataFrame
(
schedule
,
columns
=
mi_columns
)
```
%% Cell type:code id:f2d98b1c-ee98-4ab1-b218-5c59dba31cee tags:
```
python
pd
.
options
.
display
.
max_colwidth
=
100
september
.
to_csv
(
'
../test/output/observations-2019-09.csv
'
,
index
=
False
)
with
open
(
'
../test/output/observations-2019-09.tex
'
,
mode
=
'
w
'
)
as
out
:
out
.
write
(
september
.
to_latex
(
index
=
False
,
column_format
=
'
llllrllrrllp{35ex}
'
,
formatters
=
{(
'
Subbands
'
,
'
(aux)
'
):
lambda
x
:
''
if
not
x
else
str
(
x
)[
0
:
9
]
+
'
...
'
,
(
'
Remarks
'
,
''
):
lambda
x
:
x
},
multirow
=
True
))
september
```
%% Cell type:code id:21a40305-1461-4fb9-8df1-be759d1da9bf tags:
```
python
wfm
.
generate_observation_files
(
schedule_df
=
september
,
output_directory
=
'
../test/output/
'
,
transmitter_etrs
=
{
'
H
'
:
wfm
.
transmitter_H_etrs
,
'
V
'
:
wfm
.
transmitter_V_etrs
,
'
N/A
'
:
wfm
.
LOFAR_ORIGIN_ETRS
},
)
```
%% Cell type:code id:8094528d-d806-4538-a41e-fd744b438b7a tags:
```
python
ls
-
tl
..
/
test
/
output
/
station
ls
-
tl
..
/
test
/
output
/
```
%% Cell type:code id:bc067ba2-2f91-4551-b3e2-78b4b12f8e73 tags:
```
python
```
Loading