Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4 problems in mon_data_space and map-scatter plots #206

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/eva/data/mon_data_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,9 @@ def read_stn_ieee(self, file_name, coords, dims, ndims_used, dims_arr,
f.close()

else:
rtn_array = np.zeros((len(vars), 1, 1), float)
rtn_array = np.zeros((len(vars), dims[dims_arr[0]], 1), float)
lat.append(0)
lon.append(0)
dims['ydef'] = 1

rtn_lat = np.asarray(lat).reshape(-1)
Expand Down
8 changes: 7 additions & 1 deletion src/eva/plotting/batch/base/diagnostics/map_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,24 @@ def __init__(self, config, logger, dataobj):
def data_prep(self):
""" Preparing data for configure_plot """

# Optionally get the channel|level|datatype to plot
channel = None
if 'channel' in self.config['data']:
channel = self.config['data'].get('channel')
level = None
if 'level' in self.config:
level = self.config.get('level')

lonvar_cgv = self.config['longitude']['variable'].split('::')
lonvar = self.dataobj.get_variable_data(lonvar_cgv[0], lonvar_cgv[1], lonvar_cgv[2], None)
lonvar = slice_var_from_str(self.config['longitude'], lonvar, self.logger)
latvar_cgv = self.config['latitude']['variable'].split('::')
latvar = self.dataobj.get_variable_data(latvar_cgv[0], latvar_cgv[1], latvar_cgv[2], None)
latvar = slice_var_from_str(self.config['latitude'], latvar, self.logger)

datavar_cgv = self.config['data']['variable'].split('::')
datavar = self.dataobj.get_variable_data(datavar_cgv[0], datavar_cgv[1],
datavar_cgv[2], channel)
datavar_cgv[2], channel, level)
datavar = slice_var_from_str(self.config['data'], datavar, self.logger)
self.lonvar = lonvar.flatten()
self.latvar = latvar.flatten()
Expand Down
3 changes: 2 additions & 1 deletion src/eva/plotting/batch/base/plot_tools/dynamic_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def vminvmaxcmap(logger, option_dict, plots_dict, data_collections):
varname_cgv[2], channel, level, datatype)

# Reorder the data array
datavar = np.sort(datavar)
if datavar.size > 1:
datavar = np.sort(datavar)

# Decide how many values to throw out on each end of the dataset
n = datavar.size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def configure_plot(self):
layer_schema = self.config.get('schema', os.path.join(return_eva_path(), 'plotting',
'batch', 'emcpy', 'defaults', 'map_scatter.yaml'))
new_config = get_schema(layer_schema, self.config, self.logger)
delvars = ['longitude', 'latitude', 'data', 'type', 'schema']
delvars = ['longitude', 'latitude', 'data', 'type', 'schema', 'level']
for d in delvars:
new_config.pop(d, None)
self.plotobj = update_object(self.plotobj, new_config, self.logger)
Expand Down
Loading