bnlcrl package

Submodules

bnlcrl.base_pkconfig module

Default config

bnlcrl.base_pkconfig.alpha()[source]
bnlcrl.base_pkconfig.beta()[source]
bnlcrl.base_pkconfig.dev()[source]
bnlcrl.base_pkconfig.prod()[source]

bnlcrl.bnlcrl_console module

Front-end command line for bnlcrl.

See pykern.pkcli for how this module is used.

copyright:Copyright (c) 2016 mrakitin. All Rights Reserved.
license:http://www.apache.org/licenses/LICENSE-2.0.html
bnlcrl.bnlcrl_console.main()[source]

bnlcrl.crl_simulator module

class bnlcrl.crl_simulator.CRLSimulator(**kwargs)[source]
calc_T_total()[source]
calc_delta_focus(p)[source]
static calc_ideal_focus(**kwargs)[source]
calc_ideal_lens()[source]
calc_lens_array(radius, n)[source]

Calculate accumulated T_fs for one cartridge with fixed radius.

Parameters:
  • radius – radius.
  • n – number of lenses in one cartridge.
Return T_fs_accum:
 

accumulated T_fs.

calc_real_lens()[source]
calc_y_teta()[source]
get_inserted_lenses()[source]
print_result(output_format=None)[source]
read_config_file()[source]

bnlcrl.delta_finder module

A library to get index of refraction (delta) or attenuation length.

Author: Maksim Rakitin (BNL) 2016

class bnlcrl.delta_finder.DeltaFinder(**kwargs)[source]
calculate_delta()[source]
print_info()[source]
save_to_file()[source]

bnlcrl.plot_delta module

bnlcrl.utils module

bnlcrl.utils.console(class_name, parameters_file)[source]
bnlcrl.utils.convert_types(input_dict)[source]

Convert types of values from specified JSON file.

bnlcrl.utils.create_cli_function(function_name, parameters, config)[source]

The function creates the content of the CLI functions with the input from JSON config.

Parameters:
  • function_name (str) – name of the function.
  • parameters (dict) – dictionary with the parameters of the arguments (default value, help info, type).
  • config (dict) – dictionary with the parameters (descriptions, used class name, returns, parameters (optional)).
Returns:

resulted function represented as a string.

Return type:

str

bnlcrl.utils.defaults_file(suffix=None, defaults_file_path=None)[source]
bnlcrl.utils.get_cli_functions(config)[source]

Get list of CLI functions’ content with the input from JSON config.

Parameters:config (dict) – dictionary with the configuration in JSON format.
Returns:list of functions’ contents.
Return type:list
bnlcrl.utils.read_json(file_name)[source]

bnlcrl.visualize module

bnlcrl.visualize.plot_data(df, elements, property, thickness, e_min, e_max, n_points, file_name='data', x_label=None, figsize=(10, 6), show_plot=False)[source]
bnlcrl.visualize.save_to_csv(df, file_name='data', index=False)[source]
bnlcrl.visualize.to_dataframe(d, elements)[source]

Convert a list of strings, each representing the read data, to a Pandas DataFrame object.

Parameters:
  • d – a list of strings, each representing the read data.
  • elements – Chemical elements of interest.
Returns:

a tuple of DataFrame and the parsed columns.

Module contents