xoppylib.power package
Submodules
xoppylib.power.power1d_calc module
1D integrated power and flux calculations for optical elements.
- xoppylib.power.power1d_calc.power1d_calc(energies=array([1000., 1494.94949495, 1989.8989899, 2484.84848485, 2979.7979798, 3474.74747475, 3969.6969697, 4464.64646465, 4959.5959596, 5454.54545455, 5949.49494949, 6444.44444444, 6939.39393939, 7434.34343434, 7929.29292929, 8424.24242424, 8919.19191919, 9414.14141414, 9909.09090909, 10404.04040404, 10898.98989899, 11393.93939394, 11888.88888889, 12383.83838384, 12878.78787879, 13373.73737374, 13868.68686869, 14363.63636364, 14858.58585859, 15353.53535354, 15848.48484848, 16343.43434343, 16838.38383838, 17333.33333333, 17828.28282828, 18323.23232323, 18818.18181818, 19313.13131313, 19808.08080808, 20303.03030303, 20797.97979798, 21292.92929293, 21787.87878788, 22282.82828283, 22777.77777778, 23272.72727273, 23767.67676768, 24262.62626263, 24757.57575758, 25252.52525253, 25747.47474747, 26242.42424242, 26737.37373737, 27232.32323232, 27727.27272727, 28222.22222222, 28717.17171717, 29212.12121212, 29707.07070707, 30202.02020202, 30696.96969697, 31191.91919192, 31686.86868687, 32181.81818182, 32676.76767677, 33171.71717172, 33666.66666667, 34161.61616162, 34656.56565657, 35151.51515152, 35646.46464646, 36141.41414141, 36636.36363636, 37131.31313131, 37626.26262626, 38121.21212121, 38616.16161616, 39111.11111111, 39606.06060606, 40101.01010101, 40595.95959596, 41090.90909091, 41585.85858586, 42080.80808081, 42575.75757576, 43070.70707071, 43565.65656566, 44060.60606061, 44555.55555556, 45050.50505051, 45545.45454545, 46040.4040404, 46535.35353535, 47030.3030303, 47525.25252525, 48020.2020202, 48515.15151515, 49010.1010101, 49505.05050505, 50000.]), source=array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]), substance=['Be'], flags=[0], dens=['?'], thick=[0.5], angle=[3.0], roughness=0.0, output_file=None, material_constants_library=None)[source]
Apply reflectivities/transmittivities of optical elements on a source spectrum
- Parameters:
energies – the array with photon energies in eV
source – the spectral intensity or spectral power
substance – a list with descriptors of each optical element material
flags – a list with 0 (filter or attenuator) or 1 (mirror) for all optical elements
dens – a list with densities of o.e. materials. “?” is accepted for looking in the database
thick – a list with the thickness in mm for all o.e.’s. Only applicable for filters
angle – a list with the grazing angles in mrad for all o.e.’s. Only applicable for mirrors
:param roughness:a list with the roughness RMS in A for all o.e.’s. Only applicable for mirrors :param output_file: name of the output file (default=None, no output file) :return: a dictionary with the results
xoppylib.power.power1d_calc_monochromators module
1D power and flux calculations for Bragg, Laue and multilayer monochromators.
- xoppylib.power.power1d_calc_monochromators.get_multilayer_instance(filename, material_constants_library=None, verbose=1)[source]
- xoppylib.power.power1d_calc_monochromators.power1d_calc_bragg_monochromator(h_miller=1, k_miller=1, l_miller=1, energy_setup=8000.0, energies=array([7900., 7901.00502513, 7902.01005025, 7903.01507538, 7904.0201005, 7905.02512563, 7906.03015075, 7907.03517588, 7908.04020101, 7909.04522613, 7910.05025126, 7911.05527638, 7912.06030151, 7913.06532663, 7914.07035176, 7915.07537688, 7916.08040201, 7917.08542714, 7918.09045226, 7919.09547739, 7920.10050251, 7921.10552764, 7922.11055276, 7923.11557789, 7924.12060302, 7925.12562814, 7926.13065327, 7927.13567839, 7928.14070352, 7929.14572864, 7930.15075377, 7931.15577889, 7932.16080402, 7933.16582915, 7934.17085427, 7935.1758794, 7936.18090452, 7937.18592965, 7938.19095477, 7939.1959799, 7940.20100503, 7941.20603015, 7942.21105528, 7943.2160804, 7944.22110553, 7945.22613065, 7946.23115578, 7947.2361809, 7948.24120603, 7949.24623116, 7950.25125628, 7951.25628141, 7952.26130653, 7953.26633166, 7954.27135678, 7955.27638191, 7956.28140704, 7957.28643216, 7958.29145729, 7959.29648241, 7960.30150754, 7961.30653266, 7962.31155779, 7963.31658291, 7964.32160804, 7965.32663317, 7966.33165829, 7967.33668342, 7968.34170854, 7969.34673367, 7970.35175879, 7971.35678392, 7972.36180905, 7973.36683417, 7974.3718593, 7975.37688442, 7976.38190955, 7977.38693467, 7978.3919598, 7979.39698492, 7980.40201005, 7981.40703518, 7982.4120603, 7983.41708543, 7984.42211055, 7985.42713568, 7986.4321608, 7987.43718593, 7988.44221106, 7989.44723618, 7990.45226131, 7991.45728643, 7992.46231156, 7993.46733668, 7994.47236181, 7995.47738693, 7996.48241206, 7997.48743719, 7998.49246231, 7999.49748744, 8000.50251256, 8001.50753769, 8002.51256281, 8003.51758794, 8004.52261307, 8005.52763819, 8006.53266332, 8007.53768844, 8008.54271357, 8009.54773869, 8010.55276382, 8011.55778894, 8012.56281407, 8013.5678392, 8014.57286432, 8015.57788945, 8016.58291457, 8017.5879397, 8018.59296482, 8019.59798995, 8020.60301508, 8021.6080402, 8022.61306533, 8023.61809045, 8024.62311558, 8025.6281407, 8026.63316583, 8027.63819095, 8028.64321608, 8029.64824121, 8030.65326633, 8031.65829146, 8032.66331658, 8033.66834171, 8034.67336683, 8035.67839196, 8036.68341709, 8037.68844221, 8038.69346734, 8039.69849246, 8040.70351759, 8041.70854271, 8042.71356784, 8043.71859296, 8044.72361809, 8045.72864322, 8046.73366834, 8047.73869347, 8048.74371859, 8049.74874372, 8050.75376884, 8051.75879397, 8052.7638191, 8053.76884422, 8054.77386935, 8055.77889447, 8056.7839196, 8057.78894472, 8058.79396985, 8059.79899497, 8060.8040201, 8061.80904523, 8062.81407035, 8063.81909548, 8064.8241206, 8065.82914573, 8066.83417085, 8067.83919598, 8068.84422111, 8069.84924623, 8070.85427136, 8071.85929648, 8072.86432161, 8073.86934673, 8074.87437186, 8075.87939698, 8076.88442211, 8077.88944724, 8078.89447236, 8079.89949749, 8080.90452261, 8081.90954774, 8082.91457286, 8083.91959799, 8084.92462312, 8085.92964824, 8086.93467337, 8087.93969849, 8088.94472362, 8089.94974874, 8090.95477387, 8091.95979899, 8092.96482412, 8093.96984925, 8094.97487437, 8095.9798995, 8096.98492462, 8097.98994975, 8098.99497487, 8100.]), calculation_method=0, crystal_descriptor='Si', material_constants_library=None)[source]
- xoppylib.power.power1d_calc_monochromators.power1d_calc_laue_monochromator(h_miller=1, k_miller=1, l_miller=1, energy_setup=8000.0, energies=array([7900., 7901.00502513, 7902.01005025, 7903.01507538, 7904.0201005, 7905.02512563, 7906.03015075, 7907.03517588, 7908.04020101, 7909.04522613, 7910.05025126, 7911.05527638, 7912.06030151, 7913.06532663, 7914.07035176, 7915.07537688, 7916.08040201, 7917.08542714, 7918.09045226, 7919.09547739, 7920.10050251, 7921.10552764, 7922.11055276, 7923.11557789, 7924.12060302, 7925.12562814, 7926.13065327, 7927.13567839, 7928.14070352, 7929.14572864, 7930.15075377, 7931.15577889, 7932.16080402, 7933.16582915, 7934.17085427, 7935.1758794, 7936.18090452, 7937.18592965, 7938.19095477, 7939.1959799, 7940.20100503, 7941.20603015, 7942.21105528, 7943.2160804, 7944.22110553, 7945.22613065, 7946.23115578, 7947.2361809, 7948.24120603, 7949.24623116, 7950.25125628, 7951.25628141, 7952.26130653, 7953.26633166, 7954.27135678, 7955.27638191, 7956.28140704, 7957.28643216, 7958.29145729, 7959.29648241, 7960.30150754, 7961.30653266, 7962.31155779, 7963.31658291, 7964.32160804, 7965.32663317, 7966.33165829, 7967.33668342, 7968.34170854, 7969.34673367, 7970.35175879, 7971.35678392, 7972.36180905, 7973.36683417, 7974.3718593, 7975.37688442, 7976.38190955, 7977.38693467, 7978.3919598, 7979.39698492, 7980.40201005, 7981.40703518, 7982.4120603, 7983.41708543, 7984.42211055, 7985.42713568, 7986.4321608, 7987.43718593, 7988.44221106, 7989.44723618, 7990.45226131, 7991.45728643, 7992.46231156, 7993.46733668, 7994.47236181, 7995.47738693, 7996.48241206, 7997.48743719, 7998.49246231, 7999.49748744, 8000.50251256, 8001.50753769, 8002.51256281, 8003.51758794, 8004.52261307, 8005.52763819, 8006.53266332, 8007.53768844, 8008.54271357, 8009.54773869, 8010.55276382, 8011.55778894, 8012.56281407, 8013.5678392, 8014.57286432, 8015.57788945, 8016.58291457, 8017.5879397, 8018.59296482, 8019.59798995, 8020.60301508, 8021.6080402, 8022.61306533, 8023.61809045, 8024.62311558, 8025.6281407, 8026.63316583, 8027.63819095, 8028.64321608, 8029.64824121, 8030.65326633, 8031.65829146, 8032.66331658, 8033.66834171, 8034.67336683, 8035.67839196, 8036.68341709, 8037.68844221, 8038.69346734, 8039.69849246, 8040.70351759, 8041.70854271, 8042.71356784, 8043.71859296, 8044.72361809, 8045.72864322, 8046.73366834, 8047.73869347, 8048.74371859, 8049.74874372, 8050.75376884, 8051.75879397, 8052.7638191, 8053.76884422, 8054.77386935, 8055.77889447, 8056.7839196, 8057.78894472, 8058.79396985, 8059.79899497, 8060.8040201, 8061.80904523, 8062.81407035, 8063.81909548, 8064.8241206, 8065.82914573, 8066.83417085, 8067.83919598, 8068.84422111, 8069.84924623, 8070.85427136, 8071.85929648, 8072.86432161, 8073.86934673, 8074.87437186, 8075.87939698, 8076.88442211, 8077.88944724, 8078.89447236, 8079.89949749, 8080.90452261, 8081.90954774, 8082.91457286, 8083.91959799, 8084.92462312, 8085.92964824, 8086.93467337, 8087.93969849, 8088.94472362, 8089.94974874, 8090.95477387, 8091.95979899, 8092.96482412, 8093.96984925, 8094.97487437, 8095.9798995, 8096.98492462, 8097.98994975, 8098.99497487, 8100.]), calculation_method=0, thickness=1e-05, crystal_descriptor='Si', material_constants_library=None)[source]
- xoppylib.power.power1d_calc_monochromators.power1d_calc_multilayer_monochromator(filename, energies=array([7900., 7901.00502513, 7902.01005025, 7903.01507538, 7904.0201005, 7905.02512563, 7906.03015075, 7907.03517588, 7908.04020101, 7909.04522613, 7910.05025126, 7911.05527638, 7912.06030151, 7913.06532663, 7914.07035176, 7915.07537688, 7916.08040201, 7917.08542714, 7918.09045226, 7919.09547739, 7920.10050251, 7921.10552764, 7922.11055276, 7923.11557789, 7924.12060302, 7925.12562814, 7926.13065327, 7927.13567839, 7928.14070352, 7929.14572864, 7930.15075377, 7931.15577889, 7932.16080402, 7933.16582915, 7934.17085427, 7935.1758794, 7936.18090452, 7937.18592965, 7938.19095477, 7939.1959799, 7940.20100503, 7941.20603015, 7942.21105528, 7943.2160804, 7944.22110553, 7945.22613065, 7946.23115578, 7947.2361809, 7948.24120603, 7949.24623116, 7950.25125628, 7951.25628141, 7952.26130653, 7953.26633166, 7954.27135678, 7955.27638191, 7956.28140704, 7957.28643216, 7958.29145729, 7959.29648241, 7960.30150754, 7961.30653266, 7962.31155779, 7963.31658291, 7964.32160804, 7965.32663317, 7966.33165829, 7967.33668342, 7968.34170854, 7969.34673367, 7970.35175879, 7971.35678392, 7972.36180905, 7973.36683417, 7974.3718593, 7975.37688442, 7976.38190955, 7977.38693467, 7978.3919598, 7979.39698492, 7980.40201005, 7981.40703518, 7982.4120603, 7983.41708543, 7984.42211055, 7985.42713568, 7986.4321608, 7987.43718593, 7988.44221106, 7989.44723618, 7990.45226131, 7991.45728643, 7992.46231156, 7993.46733668, 7994.47236181, 7995.47738693, 7996.48241206, 7997.48743719, 7998.49246231, 7999.49748744, 8000.50251256, 8001.50753769, 8002.51256281, 8003.51758794, 8004.52261307, 8005.52763819, 8006.53266332, 8007.53768844, 8008.54271357, 8009.54773869, 8010.55276382, 8011.55778894, 8012.56281407, 8013.5678392, 8014.57286432, 8015.57788945, 8016.58291457, 8017.5879397, 8018.59296482, 8019.59798995, 8020.60301508, 8021.6080402, 8022.61306533, 8023.61809045, 8024.62311558, 8025.6281407, 8026.63316583, 8027.63819095, 8028.64321608, 8029.64824121, 8030.65326633, 8031.65829146, 8032.66331658, 8033.66834171, 8034.67336683, 8035.67839196, 8036.68341709, 8037.68844221, 8038.69346734, 8039.69849246, 8040.70351759, 8041.70854271, 8042.71356784, 8043.71859296, 8044.72361809, 8045.72864322, 8046.73366834, 8047.73869347, 8048.74371859, 8049.74874372, 8050.75376884, 8051.75879397, 8052.7638191, 8053.76884422, 8054.77386935, 8055.77889447, 8056.7839196, 8057.78894472, 8058.79396985, 8059.79899497, 8060.8040201, 8061.80904523, 8062.81407035, 8063.81909548, 8064.8241206, 8065.82914573, 8066.83417085, 8067.83919598, 8068.84422111, 8069.84924623, 8070.85427136, 8071.85929648, 8072.86432161, 8073.86934673, 8074.87437186, 8075.87939698, 8076.88442211, 8077.88944724, 8078.89447236, 8079.89949749, 8080.90452261, 8081.90954774, 8082.91457286, 8083.91959799, 8084.92462312, 8085.92964824, 8086.93467337, 8087.93969849, 8088.94472362, 8089.94974874, 8090.95477387, 8091.95979899, 8092.96482412, 8093.96984925, 8094.97487437, 8095.9798995, 8096.98492462, 8097.98994975, 8098.99497487, 8100.]), grazing_angle_deg=0.4, material_constants_library=None, verbose=1)[source]
xoppylib.power.power3d module
3D power density calculations for synchrotron radiation sources.
- xoppylib.power.power3d.apply_transmittance_to_incident_beam(transmittance, p0, e0, h0, v0, flags=0, hgap=1000.0, vgap=1000.0, hgapcenter=0.0, vgapcenter=0.0, hmag=1.0, vmag=1.0, interpolation_flag=0, interpolation_factor_h=1.0, interpolation_factor_v=1.0, slit_crop=0)[source]
- xoppylib.power.power3d.calculate_component_absorbance_and_transmittance(e0, h0, v0, substance='Si', thick=0.5, angle=3.5, defection=1, dens='?', roughness=0.0, flags=0, hgap=1000.0, vgap=1000.0, hgapcenter=0.0, vgapcenter=0.0, gapshape=0, hmag=1.0, vmag=1.0, hrot=0.0, vrot=0.0, thin_object_file='', thin_object_thickness_outside_file_area=0.0, thin_object_back_profile_flag=0, thin_object_back_profile_file='', multilayer_file='', external_reflectivity_file='', verbose=1, material_constants_library=None)[source]
- xoppylib.power.power3d.info_total_power(p, e, v, h, transmittance, absorbance, EL1_FLAG=1, method=2)[source]
- xoppylib.power.power3d.write_h5_file(calculated_data, input_beam_content, filename='tmp.txt', EL1_FLAG=1, EL1_HMAG=1.0, EL1_VMAG=1.0)[source]
xoppylib.power.xoppy_calc_power module
XOPPY integrated power and flux calculator for optical elements.
xoppylib.power.xoppy_calc_power_monochromator module
XOPPY power calculator for monochromator beamlines.
- xoppylib.power.xoppy_calc_power_monochromator.xoppy_calc_power_monochromator(energies=None, source=None, TYPE=0, ENER_SELECTED=8000.0, METHOD=0, THICK=1.0, ML_H5_FILE='', ML_GRAZING_ANGLE_DEG=0.4, N_REFLECTIONS=1, FILE_DUMP=0, polarization=0, external_reflectivity_file='', output_file='monochromator.spec', crystal_descriptor='Si', h_miller=1, k_miller=1, l_miller=1, material_constants_library=None)[source]