Browse Source

Better estimation of BMIN

pull/1/head
Benito Marcote 2 years ago
parent
commit
14cd84e963
  1. 17
      app.py
  2. BIN
      src/__pycache__/observation.cpython-36.pyc
  3. 20
      src/observation.py

17
app.py

@ -278,7 +278,7 @@ app.layout = html.Div([ @@ -278,7 +278,7 @@ app.layout = html.Div([
]),
html.Div(id='antennas-div', className='container', children=[
# List with all antennas
html.Div(className='antcheck', children=[html.Br(),
html.Div(className='antcheck', children=[html.Br(), html.Br(),
html.Label(html.H4(f"{sorted_networks[an_array]}")),
html.Br(),
dcc.Checklist(id=f"list_stations_{an_array}",
@ -302,8 +302,9 @@ app.layout = html.Div([ @@ -302,8 +302,9 @@ app.layout = html.Div([
# Sensitivity calculations
# dcc.Markdown(id='sensitivity-output',
# children="Set the observation first.")
html.Div(className='col-12', id='sensitivity-output',
children=[html.Div(className='col-6 justify-content-center',
html.Div(className='col-10 justify-content-center',
id='sensitivity-output',
children=[html.Div(className='col-6 justify-content-center',
children=[html.Br(),
html.P("You need to set the observation and click in the 'Compute Observation' buttom first (go to the previous tab).")])
])
@ -312,7 +313,7 @@ app.layout = html.Div([ @@ -312,7 +313,7 @@ app.layout = html.Div([
dcc.Tab(label='Elevations', className='custom-tab',
selected_className='custom-tab--selected', children=[
html.Div(className='row justify-content-center', children=[
html.Div(className='col-md-8', children=[
html.Div(className='col-md-8 justify-content-center', children=[
# Elevation VS time
html.Div([
dcc.Graph(id='fig-elev-time')
@ -327,7 +328,7 @@ app.layout = html.Div([ @@ -327,7 +328,7 @@ app.layout = html.Div([
selected_className='custom-tab--selected', children=[
# Images
html.Div(className='row justify-content-center', children=[
html.Div(className='col-md-8', children=[
html.Div(className='col-md-8 justify-content-center', children=[
# dcc.Markdown(children="""To be implemented.
# The uv coverage and expected dirty images will go here.""")
html.Div([dcc.Graph(id='fig-uvplane')])
@ -497,7 +498,7 @@ def update_sensitivity(obs): @@ -497,7 +498,7 @@ def update_sensitivity(obs):
temp_msg += [f"Considering the shortest baseline in the array ({optimal_units(shortest_bl, [u.km, u.m]):.5n}), you will filter out emission on angular scales larger than {optimal_units(largest_ang_scales, [u.arcmin, u.arcsec, u.mas]):.3n}."]
cards += create_sensitivity_card('FoV limitations', temp_msg)
return [html.Div(className='card-deck col-12', children=cards)]
return [html.Div(className='card-deck col-12 justify-content-center', children=cards)]
@ -519,7 +520,7 @@ def select_antennas(selected_band, selected_networks, is_eEVN): @@ -519,7 +520,7 @@ def select_antennas(selected_band, selected_networks, is_eEVN):
if (all_antennas[ant].has_band(selected_band) and \
(all_antennas[ant].network == 'EVN'))]
return [html.Div([html.Br(),
return [html.Div([html.Br(), html.Br(),
html.Label(html.H4(f"{sorted_networks[an_array]}")),
html.Br(),
dcc.Checklist(id=f"list_stations_{an_array}",
@ -535,7 +536,7 @@ def select_antennas(selected_band, selected_networks, is_eEVN): @@ -535,7 +536,7 @@ def select_antennas(selected_band, selected_networks, is_eEVN):
selected_antennas += [ant for ant in default_arrays[an_array] \
if all_antennas[ant].has_band(selected_band)]
return [html.Div([html.Br(),
return [html.Div([html.Br(), html.Br(),
html.Label(html.H4(f"{sorted_networks[an_array]}")),
html.Br(),
dcc.Checklist(id=f"list_stations_{an_array}",

BIN
src/__pycache__/observation.cpython-36.pyc

Binary file not shown.

20
src/observation.py

@ -429,22 +429,10 @@ class Observation(object): @@ -429,22 +429,10 @@ class Observation(object):
# Defines the BMAJ and PA
bl_bmaj = np.max(uvvis_polar[:,0])
bl_bmaj_theta = uvvis_polar[:,1][np.where(uvvis_polar[:,0] == bl_bmaj)][0]
# Estimates the BMIN
cond = [[]]
if len(cond[0]) == 0:
cond = np.where((uvvis_polar[:,1] > (bl_bmaj_theta+4*np.pi/3) % (2*np.pi)) & (uvvis_polar[:,1] < (bl_bmaj_theta+5*np.pi/3) % (2*np.pi) ))
check_intervals = [(np.pi/3, 2*np.pi/3), (4*np.pi/3, 5*np.pi/3), (np.pi/4, 3*np.pi/4),
(5*np.pi/4, 7*np.pi/4)]
try:
while len(cond[0]) == 0:
ci = check_intervals.pop()
cond = np.where((uvvis_polar[:,1] > (bl_bmaj_theta+ci[0]) % (2*np.pi)) & \
(uvvis_polar[:,1] < (bl_bmaj_theta+ci[1]) % (2*np.pi) ))
bl_bmin = np.max( uvvis_polar[:,0][cond] )
except IndexError:
bl_bmin = bl_bmaj/50
# Gets the BMIN and an orthogonal projection
bl_bmin_theta = ( bl_bmaj_theta + np.pi/2 ) % (2*np.pi)
bl_bmin = np.max(np.abs(uvvis.dot(np.array([np.cos(bl_bmin_theta),
np.sin(bl_bmin_theta)]))))
self._synth_beam = {'bmaj': resolution(bl_bmin), 'bmin': resolution(bl_bmaj),
'pa': (bl_bmaj_theta*u.rad).to(u.deg)}

Loading…
Cancel
Save