Commit ec483087d3e7b669cd89d259c1baccb5a96ee536
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,6 +100,8 @@ CACHE_DIR = get_path('../cache') | ||
100 | # The order matters. If you change this you also need to change the | 100 | # The order matters. If you change this you also need to change the |
101 | # innermost loop of `get_data_for_target`. | 101 | # innermost loop of `get_data_for_target`. |
102 | # The javascript knows the targets' properties under these names. | 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 | PROPERTIES = ('time', 'vrad', 'vtan', 'vtot', 'btan', 'temp', 'pdyn', 'dens', | 105 | PROPERTIES = ('time', 'vrad', 'vtan', 'vtot', 'btan', 'temp', 'pdyn', 'dens', |
104 | 'atse', 'xhee', 'yhee') | 106 | 'atse', 'xhee', 'yhee') |
105 | 107 | ||
@@ -130,6 +132,14 @@ PARAMETERS = { | @@ -130,6 +132,14 @@ PARAMETERS = { | ||
130 | 'active': False, | 132 | 'active': False, |
131 | 'position': 30, | 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 | 'temp': { | 143 | 'temp': { |
134 | 'slug': 'temp', | 144 | 'slug': 'temp', |
135 | 'name': 'Temperature', | 145 | 'name': 'Temperature', |
@@ -879,10 +889,12 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): | @@ -879,10 +889,12 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): | ||
879 | target_config = get_target_config(target_slug) | 889 | target_config = get_target_config(target_slug) |
880 | plasma_dict = target_config['models'][input_slug][0]['parameters'] | 890 | plasma_dict = target_config['models'][input_slug][0]['parameters'] |
881 | orbit_dict = target_config['orbit']['models'][0]['parameters'] | 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 | list_df = [] | 895 | list_df = [] |
885 | for _name, _id in parameters_dict.items(): | 896 | for _name, _id in parameters_dict.items(): |
897 | + log.debug(f"Parameter {_name}: {_id}") | ||
886 | _df = amda.get_data(_id, started_at, stopped_at).to_dataframe() | 898 | _df = amda.get_data(_id, started_at, stopped_at).to_dataframe() |
887 | if _name == 'xy_v': | 899 | if _name == 'xy_v': |
888 | _df = _df.rename(columns={_df.columns[0]: 'vrad', _df.columns[1]: 'vtan'}) | 900 | _df = _df.rename(columns={_df.columns[0]: 'vrad', _df.columns[1]: 'vtan'}) |