Commit ec483087d3e7b669cd89d259c1baccb5a96ee536

Authored by hitier
1 parent 79509300
Exists in rhitier-dev

Fix dict merging

Showing 1 changed file with 13 additions and 1 deletions   Show diff stats
web/run.py
... ... @@ -100,6 +100,8 @@ CACHE_DIR = get_path('../cache')
100 100 # The order matters. If you change this you also need to change the
101 101 # innermost loop of `get_data_for_target`.
102 102 # The javascript knows the targets' properties under these names.
  103 +# PROPERTIES = ('time', 'vrad', 'vtan', 'vtot', 'btan', 'brad', 'temp', 'pdyn', 'dens',
  104 +# 'atse', 'xhee', 'yhee')
103 105 PROPERTIES = ('time', 'vrad', 'vtan', 'vtot', 'btan', 'temp', 'pdyn', 'dens',
104 106 'atse', 'xhee', 'yhee')
105 107  
... ... @@ -130,6 +132,14 @@ PARAMETERS = {
130 132 'active': False,
131 133 'position': 30,
132 134 },
  135 + # 'brad': {
  136 + # 'slug': 'brad',
  137 + # 'name': 'B Radial',
  138 + # 'title': 'B Radial.',
  139 + # 'units': 'nT',
  140 + # 'active': False,
  141 + # 'position': 35,
  142 + # },
133 143 'temp': {
134 144 'slug': 'temp',
135 145 'name': 'Temperature',
... ... @@ -879,10 +889,12 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at):
879 889 target_config = get_target_config(target_slug)
880 890 plasma_dict = target_config['models'][input_slug][0]['parameters']
881 891 orbit_dict = target_config['orbit']['models'][0]['parameters']
882   - parameters_dict = plasma_dict+orbit_dict
  892 + parameters_dict = {**plasma_dict, **orbit_dict}
883 893  
  894 + log.info(f"Aggregating dataframes speazy parameters for {input_slug} to {target_slug}" )
884 895 list_df = []
885 896 for _name, _id in parameters_dict.items():
  897 + log.debug(f"Parameter {_name}: {_id}")
886 898 _df = amda.get_data(_id, started_at, stopped_at).to_dataframe()
887 899 if _name == 'xy_v':
888 900 _df = _df.rename(columns={_df.columns[0]: 'vrad', _df.columns[1]: 'vtan'})
... ...