def generate_mobility_plots(generic_task, filename, x_axis_tag, x_axis_units, dask_client=None): r""" This function takes as input a mobility task, a filename, the tag which is the x axis of the eventual plot, and the units of the x-axis as a string. It then saves all of the data relevant to this plot. """ if dask_client is None: dask_client = generic_task.sweep_manager.dask_client def _get_relevant_data(mobility_data): mobility_data._serialize() output = {} output["conductance"] = mobility_data.content["conductance"] output["conductance_units"] = mobility_data.content[ "conductance_units"] output["mobility"] = mobility_data.content["mobility"] output["mobility_units"] = mobility_data.content["mobility_units"] output["x_axis"] = str(x_axis_tag).encode("utf8") output["x_axis_units"] = str(x_axis_units).encode("utf8") return output save_relevant_data( generic_task, filename, dask_client, _get_relevant_data, plot_type="mobility_plots", )
def generate_1d_density_plot(generic_task, filename, dask_client=None): if dask_client is None: dask_client = generic_task.sweep_manager.dask_client def _get_relevant_data(density_data): density_data._serialize() output = {} output['densities'] = density_data.content['densities'] output['density_units'] = density_data.content['density_units'] output['bands'] = density_data.content['bands'] output['band_units'] = density_data.content['band_units'] output['mesh'] = density_data.content['mesh'] output['mesh_units'] = density_data.content['mesh_units'] return output save_relevant_data(generic_task, filename, dask_client, _get_relevant_data, plot_type='1d_density_plot')
def generate_2d_density_plot(generic_task, filename, dask_client=None): r""" This function takes as input a 2D ThomasFermi or SchrodingerPoisson task, and a filename. It then saves all of the data relevant to this plot. """ if dask_client is None: dask_client = generic_task.sweep_manager.dask_client def _get_relevant_data(density_data): density_data._serialize() output = {} output['rho'] = density_data.content['rho'] output['rho_units'] = density_data.content['rho_units'] output['mesh'] = density_data.content['mesh'].meshgrid() output['mesh_units'] = density_data.content['mesh_units'] return output save_relevant_data(generic_task, filename, dask_client, _get_relevant_data, plot_type='2d_density_plot')