Browse Source

Removing band that is not used by any network

pull/1/head
Benito Marcote 1 year ago
parent
commit
57bb6c38a9
  1. 69
      app.py
  2. 4
      vlbiplanobs/freqsetups.py

69
app.py

@ -203,6 +203,38 @@ def update_sensitivity(obs):
return [html.Div(className='card-deck col-12 justify-content-center', children=cards)]
def arrays_with_band(arrays, a_band):
"""Returns the given arrays that can observe the given band with at least two antennas.
It excludes e-EVN if it is included in arrays.
Inputs
- arrays : dict
The keys are the name of the array and the values must be a list with the codenames
of the antennas in the array.
- a_band : str
The band to be observed, following the criteria in fs.bands.
Returns
- arrays_with_band : str
Comma-separated list of the arrays that can observe the given band.
"""
tmp = [] # the list of arrays that can observe the given band
for an_array in arrays:
if an_array != 'e-EVN':
if np.sum([all_antennas[a_station].has_band(a_band) for a_station in arrays[an_array]]) > 1:
tmp.append(an_array)
if len(tmp) == 0:
return 'none'
elif len(tmp) == 2:
return ' and '.join(tmp)
elif len(tmp) in (1, 3):
return ', '.join(tmp)
else: # >= 4
return ', '.join(tmp[:-1]) + ' and ' + tmp[-1]
##################### This is the webpage layout
app.layout = html.Div([
@ -219,6 +251,41 @@ app.layout = html.Div([
])
]),
html.Div([html.Br()]),
html.Div(id='main-window', children=[
html.Div(className='row justify-content-center',
children=html.Div(className='col-sm-7',
children=[
html.P(["This tool allows you to plan observations with the ",
html.A(href="https://www.evlbi.org", children="European VLBI Network"),
" (EVN) and other Very Long Baseline Interferometry (VLBI) networks. "
"This tool allows you to determine when you can schedule the observation "
"of a given source (e.g. when it is visible in the sky "
"for the different antennas), and estimating the outcome of the observation "
"(e.g. reached resolution or sensitivity)."]),
html.P(["First, pick the band (wavelength or frequency) at which you want to observe. "
"Note that you will still be able to change the selection afterwards."]),
html.Br(),
dbc.Row([dbc.Card(dbc.CardBody([
html.H5(f"{fs.bands[a_band].split('(')[0].strip()}", className="card-title"),
html.P([f"Wavelength: {fs.bands[a_band].split('(')[1].split('or')[0].strip()}.",
html.Br(),
f"Frequency: {fs.bands[a_band].split('(')[1].split('or')[1].replace(')', '').strip()}.",
html.Br(),
f"Can be observed with the {arrays_with_band(default_arrays, a_band)}."
], className="card-text"),
]), className="w-50", style={'margin-right': '2rem', 'margin-bottom': '2rem'})
for a_band in fs.bands]
)]
))
])
])
@app.callback(Output('main-window', 'children'),
[Input('first-dialog', 'value')])
def update_onsourcetime_label(onsourcetime):
return [
# First row containing all buttons/options, list of telescopes, and button with text output
dcc.ConfirmDialog(id='global-error', message=''),
# Elements in second column (checkboxes with all stations)
@ -512,7 +579,7 @@ app.layout = html.Div([
]),
html.Div(className='container-fluid', children=[html.Br(), html.Br()])
])
])
]

4
vlbiplanobs/freqsetups.py

@ -16,9 +16,9 @@ bands = {'92cm': 'P band (92 cm or 0.33 GHz)', '49cm': 'P band (49 cm or 0.6 GHz
'18cm': 'L band (18 cm or 1.7 GHz)', '13cm': 'S band (13 cm or 2.3 GHz)',
'6cm': 'C band (6cm or 5 GHz)', '5cm': 'M band (5 cm or 6 GHz)',
'3.6cm': 'X band (3.6 cm or 8.3 GHz)', '2cm': 'U band (2 cm or 15 GHz)',
'1.3cm': 'K band (1.3 cm or 23 GHz)', '0.9cm': 'Ka band (0.9 cm or 33 GHz)',
'1.3cm': 'K band (1.3 cm or 23 GHz)', #'0.9cm': 'Ka band (0.9 cm or 33 GHz)',
'0.7cm': 'Q band (0.7 cm or 43 GHz)', '0.3cm': 'W band (0.3 cm or 100 GHz)',
'0.1cm': '0.1 cm or 300 GHz'}
'0.1cm': 'Band 3 (0.1 cm or 300 GHz)'}
# from 4 Mbps to 32 Gbps
data_rates = {2**i: f"{2**i} Mbps" if 2**i<1e3 else f"{2**i/1000:.0f} Gbps" for i in range(2, 16)}

Loading…
Cancel
Save