Convertors ModuleΒΆ
This module contains unit conversion functions used in science and engineering.
Each function follows the FirstUnit_To_SecondUnit() format. Examples:
Kelvin_To_Celsius(k)
Celsius_To_Kelvin(c)
Meter_To_Foot(m)
Coulomb_To_Electron_volt(q)
- PyGamLab.Converters.Angstrom_To_Meter(A)[source]
Convert the given value in angstroms to meters.
- Parameters:
A (float) β The value in angstroms to be converted.
- Returns:
The equivalent value in meters.
- Return type:
float
Examples
>>> Angstrom_To_Meter(1) 1e-10 >>> Angstrom_To_Meter(5e3) 5e-07
- PyGamLab.Converters.Angstrom_To_Micrometer(A)[source]
Convert the given value in angstroms to micrometers.
- Parameters:
A (float) β The value in angstroms to be converted.
- Returns:
The equivalent value in micrometers.
- Return type:
float
Examples
>>> Angstrom_To_Micrometer(10000) 1.0 >>> Angstrom_To_Micrometer(25000) 2.5
- PyGamLab.Converters.Angstrom_To_Millimeter(A)[source]
Convert the given value in angstroms to millimeters.
- Parameters:
A (float) β The value in angstroms to be converted.
- Returns:
The equivalent value in millimeters.
- Return type:
float
Examples
>>> Angstrom_To_Millimeter(1e7) 1.0 >>> Angstrom_To_Millimeter(5e6) 0.5
- PyGamLab.Converters.Angstrom_To_Nanometer(Angstrom_value)[source]
This function converts Angstroms to Nanometers.
- Parameters:
Angstrom_value (int or Float) β Value in angstroms (Γ ).
- Returns:
Nanometer_value β Equivalent value in Nanometers (nm).
- Return type:
int or Float
- PyGamLab.Converters.Atmosphere_To_Pascal(atm)[source]
Convert the given value in atmospheres to pascals.
- Parameters:
atm (float) β The value in atmospheres to be converted.
- Returns:
The equivalent value in pascals.
- Return type:
float
Examples
>>> Atmosphere_To_Pascal(1) 101325.0 >>> Atmosphere_To_Pascal(0.5) 50662.5
- PyGamLab.Converters.Bar_To_Pascal(bar)[source]
Converts bar to pascal.
- Parameters:
bar (float) β bar.
- Returns:
Pa β pascal
- Return type:
float
Example
>>> Bar_To_Pascal(1) 1e-05
- PyGamLab.Converters.Binary_To_Decimal(Num_bin)[source]
Converts a binary number (given as an int, e.g. 1011) to its decimal representation.
- Parameters:
Num_bin (int) β The binary number to convert.
- Returns:
The decimal representation of the binary number.
- Return type:
int
Examples
>>> Binary_To_Decimal(1011) 11 >>> Binary_To_Decimal(11111111) 255
- PyGamLab.Converters.Brinell_To_Rockwell(hb)[source]
convert Brinell hardness (HB) to Rockwell hardness (HRB)
- Parameters:
hb (float) β hardness in Brinell scale.
float (Returns)
Examples
>>> Brinell_To_Rockwell(100) 10.0 >>> Brinell_To_Rockwell(75) 5.0
- PyGamLab.Converters.Byte_To_Kilobyte(b)[source]
Convert the given value in bytes to kilobytes.
- Parameters:
b (int) β The value in bytes to be converted.
- Returns:
The equivalent value in kilobytes.
- Return type:
float
Examples
>>> Byte_To_Kilobyte(1024) 1.0 >>> Byte_To_Kilobyte(512) 0.5
- PyGamLab.Converters.CC_per_Second_To_Liter_per_Minute_Welding_Gas_Flow_Rate_Converter(CC_per_Second)[source]
This function converts the Welding Gas Flow Rate from CC per Second to Liter per Minute.
- Parameters:
CC_per_Second (float) β CC_per_Second is a unit for gas flow rate in welding.
- Return type:
Liter_per_Minute is a unit for gas flow rate in welding.
- PyGamLab.Converters.Calories_To_Joules(cal)[source]
- Parameters:
cal (float) β Calories.
- Returns:
J β Converts calories to joules.
- Return type:
float
- PyGamLab.Converters.Celcius_To_Kelvin(Celcius)[source]
Convert the given temperature in Celsius to Kelvin.
- Parameters:
Celcius (float) β The temperature in Celsius to be converted.
- Returns:
The equivalent temperature in Kelvin.
- Return type:
float
Notes
The temperature in Celsius is offset by 273.15 to convert to Kelvin.
Examples
>>> Celcius_To_Kelvin(0) 273.15 >>> Celcius_To_Kelvin(25) 298.15
- PyGamLab.Converters.Centigrade_To_Fahrenheit(C)[source]
Convert the given temperature in Celsius (Centigrade) to Fahrenheit.
- Parameters:
C (float) β The temperature in Celsius to be converted.
- Returns:
The equivalent temperature in Fahrenheit.
- Return type:
float
Examples
>>> Centigrade_To_Fahrenheit(0) 32.0 >>> Centigrade_To_Fahrenheit(100) 212.0
- PyGamLab.Converters.Centimeter_To_Inch(Centimeter)[source]
- Parameters:
Centimeter (float or int) β One centimeter is equal to 0.393701 inches. number per Centimeter unit.
- Returns:
Inch β number per Inch unit.
- Return type:
float
- PyGamLab.Converters.Centimeter_per_Minute_To_Meter_per_Hour_Welding_Speed_Converter(Centimeter_per_Minute)[source]
This function converts the Welding Speed from Centimeter per Minute to Meter per Hour.
- Parameters:
Centimeter_per_Minute (float) β Centimeter_per_Minute is a unit for welding speed.
- Return type:
Meter_per_Hour is a unit for welding speed.
- PyGamLab.Converters.CmHg_To_Pascal(P1)[source]
Convert the given pressure in centimeters of mercury to pascals.
- Parameters:
P1 (float) β The pressure in centimeters of mercury to be converted.
- Returns:
The equivalent pressure in pascals.
- Return type:
float
Examples
>>> CmHg_To_Pascal(1) 1333.22 >>> CmHg_To_Pascal(0.5) 666.61
- PyGamLab.Converters.Coulomb_To_Electron_Volt(coulomb)[source]
Convert the given value in coulombs to electron volts.
- Parameters:
coulomb (float) β The value in coulombs to be converted.
- Returns:
The equivalent value in electron volts.
- Return type:
float
Notes
1 coulomb = 6.24e18 electron volts.
Examples
>>> Coulomb_To_Electron_Volt(1) 6.24e+18 >>> Coulomb_To_Electron_Volt(1.6e-19) 0.9984
- PyGamLab.Converters.Cubic_Meter_To_Liter(number_in_Cubic_Meter)[source]
This function converts cubic meters to liters.
- Parameters:
number_in_Cubic_Meter (int or float) β Number per cubic meter unit.
Liter (int or float) β Number per liter unit.
- PyGamLab.Converters.Current_Density_To_Mpy(Current_density, density, masschange, valency)[source]
- Current_densityfloat
Current density .(microA/cm2)
- densityfloat
Material Density (g/cm3).
- masschangefloat
amount of matter already corroded (g)
- valencyintiger
How positive is the charge of the Material
corrosion rate in mpy
- PyGamLab.Converters.Decimal_To_Binary(Num_dec)[source]
Converts a decimal number to its binary representation.
- Parameters:
Num_dec (int) β The decimal number to convert.
- Returns:
The binary representation of the decimal number.
- Return type:
int
Examples
>>> Decimal_To_Binary(11) 1011 >>> Decimal_To_Binary(255) 11111111
- PyGamLab.Converters.Degree_To_Radian(deg)[source]
Converts values of angle from degree to radian.
- Parameters:
deg (float) β The angle value in degrees.
- Returns:
The angle value in radians.
- Return type:
float
Examples
>>> Degree_To_Radian(180) 3.141592653589793 >>> Degree_To_Radian(90) 1.5707963267948966
- PyGamLab.Converters.Electron_volt_To_Coulomb(electron_volt)[source]
Converts energy value from electronvolts to coulombs (assuming it refers to charge equivalent). Note: This conversion is based on the elementary charge.
- Parameters:
electron_volt (float) β The energy value in electronvolts.
- Returns:
The equivalent charge value in coulombs.
- Return type:
float
Examples
>>> Electron_volt_To_Coulomb(1) 1.602e-19 >>> Electron_volt_To_Coulomb(6.241e18) 0.99999842
- PyGamLab.Converters.Electronvolt_To_Joule(e_v)[source]
Converts energy value from electronvolts to joules.
- Parameters:
e_v (float) β The energy value in electronvolts.
- Returns:
The energy value in joules.
- Return type:
float
Examples
>>> Electronvolt_To_Joule(1) 1.6022e-19 >>> Electronvolt_To_Joule(6.241509074e18) 1.0000000001902376
- PyGamLab.Converters.Fabric_GLM_To_GSM(Fabric_GLM, Fabric_Width)[source]
This function converts fabric weight in GLM unit to GSM unit.
- Parameters:
Fabric_GLM (int or float) β Fabric weight per GLM.
Fabric_Width (int or float) β Width of fabric in inches.
- Returns:
Fabric_GSM β Fabric weight in GSM.
- Return type:
float
- PyGamLab.Converters.Fabric_GSM_To_GLM(Fabric_Weight, Fabric_Width)[source]
This function converts fabric weight in GSM unit to GLM unit.
- Fabric_Weightint or float
fabric weight per GSM.
- Fabric_Widthint or float
width of fabric per inches.
- Fabric_GLMint or float
Result.
- PyGamLab.Converters.Fahrenheit_To_Centigrade(F)[source]
Converts a temperature value from Fahrenheit to Centigrade (Celsius).
- Parameters:
F (float) β The temperature value in Fahrenheit.
- Returns:
The temperature value in Centigrade (Celsius).
- Return type:
float
Examples
>>> Fahrenheit_To_Centigrade(32) 0.0 >>> Fahrenheit_To_Centigrade(212) 100.0
- PyGamLab.Converters.Foot_Pound_To_Newton(Foot_Pounds)[source]
# This Conventor convert ft-lbs to Nm
- Parameters:
Foot_Pound (a unit of torque equal to the force of 1 lb acting perpendicularly to)
foot.(ft-lbs) (an axis of rotation at a distance of 1)
- Returns:
Newton_Meters
- Return type:
The newton-metre is the unit of torque.(Nm)
- PyGamLab.Converters.Foot_To_Mile(ft)[source]
Converts a length value from feet to miles.
- Parameters:
ft (float) β The length value in feet.
- Returns:
The length value in miles.
- Return type:
float
Examples
>>> Foot_To_Mile(5280) 1.00000000032 >>> Foot_To_Mile(2640) 0.50000000016
- PyGamLab.Converters.Force_CGS_To_SI(Force_in_CGS)[source]
- Parameters:
Force_In_CGS (float) β give your force value in CGS system.
- Returns:
SI β return your force value in SI system.
- Return type:
float
- PyGamLab.Converters.Force_SI_To_CGS(Force_in_SI)[source]
- Parameters:
Force_in_SI (float) β give your force value in SI system.
- Returns:
CGS β return your force value in CGS system.
- Return type:
float
- PyGamLab.Converters.Gram_To_Mole(g, MW)[source]
This function calaculates the eqivalent amount of substance of a compound in mole(s) base on mass in gram(s).
- Parameters:
g (float) β g is the mass of a compound in gram(s).
MW (float) β MW is the Molecular weight of a compound (gram/mol).
- Returns:
Mole β Mole is the eqivalent amount of substance of a compound in mole(s).
- Return type:
float
- PyGamLab.Converters.Hertz_To_Rpm(a, /)[source]
A converter machine to convert frequency in Hertz(Hz) to frequency in rpm. :type a: :param a: frequency, Hertz(Hz). :type a: int or float :param Returns: :param b: :type b: int or float :param frequency: :param revolution per minute (rpm):
Examples
>>> Hertz_To_Rpm(1) 60 >>> Hertz_To_Rpm(2.5) 150.0
- PyGamLab.Converters.Horsepower_To_Watt(Horsepower)[source]
- Parameters:
Horsepower (float) β give number in horsepower.
- Returns:
watt β return your number in watt.
- Return type:
float
Examples
>>> Horsepower_To_Watt(1) '7.457000e+02' >>> Horsepower_To_Watt(2) '1.491400e+03'
- PyGamLab.Converters.Hour_To_Sec(t)[source]
Converts a time value from hours to seconds.
- Parameters:
t (float) β The time value in hours.
- Returns:
The time value in seconds.
- Return type:
float
Examples
>>> Hour_To_Sec(1) 3600 >>> Hour_To_Sec(2.5) 9000.0
- PyGamLab.Converters.Inch_To_Centimeter(Inch)[source]
- Parameters:
Inch (float or int) β ne inch is equal to 2.54 centimeters. number per Inch unit.
- Returns:
Centimeter β number per Centimeter unit.
- Return type:
float
- PyGamLab.Converters.Inch_To_Meter(In)[source]
Converts a length value from inches to meters.
- Parameters:
In (float) β The length value in inches.
- Returns:
The length value in meters.
- Return type:
float
- PyGamLab.Converters.Joule_To_Electronvolt(Joule)[source]
Converts energy value from joules to electronvolts.
- Parameters:
Joule (float) β The energy value in joules.
- Returns:
The energy value in electronvolts.
- Return type:
float
- PyGamLab.Converters.Joules_Per_Minute_To_Kilowatt(Joules_Per_Minute)[source]
- Parameters:
Joules_Per_Minute (float) β number per Joules unit.
- Returns:
Kilowatt β number per Kilowatt unit.
- Return type:
float
- PyGamLab.Converters.Joules_To_Calories(J)[source]
- Parameters:
J (float) β Joules.
- Returns:
cal β Converts joules to calories.
- Return type:
float
- PyGamLab.Converters.Kelvin_To_Celcius(Kelvin)[source]
This function is used to convert Kelvin to Celsius. The temperature in Celsius is different from the temperature in Kelvin by 273.15.
- Parameters:
Kelvin (float) β The temperature value in Kelvin.
- Returns:
The temperature value in Celsius.
- Return type:
float
Examples
>>> Kelvin_To_Celcius(273.15) 0.0 >>> Kelvin_To_Celcius(298.15) 25.0
- PyGamLab.Converters.Kg_To_Lbm(Kg)[source]
Converts a mass value from kilograms to pounds (lbm).
- Parameters:
Kg (float) β The mass value in kilograms.
- Returns:
The mass value in pounds (lbm).
- Return type:
float
Examples
>>> Kg_To_Lbm(1) 2.20462 >>> Kg_To_Lbm(5) 11.0231
- PyGamLab.Converters.Kg_To_Ton(Kg)[source]
Converts a mass value from kilograms to metric tons.
- Parameters:
Kg (float) β The mass value in kilograms.
- Returns:
The mass value in metric tons.
- Return type:
float
Examples
>>> Kg_To_Ton(1000) 1.0 >>> Kg_To_Ton(250) 0.25
- PyGamLab.Converters.KiloMeter_To_LightYear(km)[source]
Converts a distance value from kilometers to light-years.
- Parameters:
km (float) β The distance value in kilometers.
- Returns:
The distance value in light-years.
- Return type:
float
Examples
>>> KiloMeter_To_LightYear(9460730472801.1) 1.0 >>> round(KiloMeter_To_LightYear(4730365236400.55), 1) 0.5
- PyGamLab.Converters.Kilobyte_To_Byte(kb)[source]
Converts a data size value from kilobytes to bytes.
- Parameters:
kb (float) β The data size value in kilobytes.
- Returns:
The data size value in bytes.
- Return type:
float
Examples
>>> Kilobyte_To_Byte(1) 1024 >>> Kilobyte_To_Byte(0.5) 512.0
- PyGamLab.Converters.Kilogeram_Per_Cubic_Meter_To_Pounds_Per_Cubic_Inch(KgPerCubicMeter)[source]
Converts a density value from kilograms per cubic meter to pounds per cubic inch.
- Parameters:
KgPerCubicMeter (float) β The density value in kilograms per cubic meter.
- Returns:
The density value in pounds per cubic inch.
- Return type:
float
- PyGamLab.Converters.Kilogram_To_Pound(number_in_kilogram)[source]
This function converts the desired number from kilograms to pounds.
- Parameters:
number_in_kilogram (int) β Number per kilogram.
- Returns:
pound β Number per pound.
- Return type:
int
- PyGamLab.Converters.Kilometer_Per_Hour_To_Meter_Per_Second(kph)[source]
Converts a speed value from kilometers per hour to meters per second.
- Parameters:
kph (float) β The speed value in kilometers per hour.
- Returns:
The speed value in meters per second.
- Return type:
float
Examples
>>> Kilometer_Per_Hour_To_Meter_Per_Second(3.6) 1.0 >>> Kilometer_Per_Hour_To_Meter_Per_Second(36) 10.0
- PyGamLab.Converters.Kilowatt_To_Joules_Per_Minute(Kilowatt)[source]
Converts power from kilowatts to joules per minute.
- Parameters:
Kilowatt (float) β The power value in kilowatts.
- Returns:
Joules_Per_Minute β The equivalent power in joules per minute.
- Return type:
float
- PyGamLab.Converters.Kmph_To_Mps(V1)[source]
This function is used to convert kilometers per hour to meters per second.
- Parameters:
V1 (float) β The speed value in kilometers per hour.
- Returns:
The speed value in meters per second.
- Return type:
float
- PyGamLab.Converters.Lbm_To_Kg(Lbm)[source]
Converts a mass value from pounds (lbm) to kilograms.
- Parameters:
Lbm (float) β The mass value in pounds (lbm).
- Returns:
The mass value in kilograms.
- Return type:
float
Examples
>>> Lbm_To_Kg(2.20462) 0.9999996694214878 >>> Lbm_To_Kg(1) 0.4535924254969406
- PyGamLab.Converters.LightYear_To_KiloMeter(ly)[source]
Converts a distance value from light-years to kilometers.
- Parameters:
ly (float) β The distance value in light-years.
- Returns:
The distance value in kilometers.
- Return type:
float
Examples
>>> LightYear_To_KiloMeter(1) 9460730472801.1 >>> LightYear_To_KiloMeter(0.5) 4730365236400.55
- PyGamLab.Converters.Liter_Per_Minute_To_CC_Per_Second_Welding_Gas_Flow_Rate_Converter(Liter_per_Minute)[source]
This function converts the Welding Gas Flow Rate from Liter per Minute to CC per Second.
- Parameters:
Liter_per_Minute (float) β Liter_per_Minute is a unit for gas flow rate in welding.
- Return type:
CC_per_Second is a unit for gas flow rate in welding.
- PyGamLab.Converters.Liter_To_Cubic_Meter(number_in_Liter)[source]
This function converts liters to cubic meters.
- Parameters:
number_in_Liter (int or float) β Number per liter unit.
Cubic_Meter (int or float) β Number per cubic meter unit.
- PyGamLab.Converters.Mass_To_Mole(Mass, Molar_Mass)[source]
- Parameters:
Mass (float) β The mass of substance(g).
Molar_Mass (float) β The mass of one mole of substance (g/mol).
- Returns:
Mole
- Return type:
int
- PyGamLab.Converters.Megapascal_To_Pascal(Megapascal)[source]
#This Conventor Convert Megapascal to Pascal
- Parameters:
Megapascal (1 Megapascal equals 1,000,000 Pascals.)
- Returns:
Pascal
- Return type:
the unit of pressure or stress in SI.
- PyGamLab.Converters.Meter_Per_Hour_To_Centimeter_Per_Minute_Welding_Speed_Converter(Meter_per_Hour)[source]
This function converts the Welding Speed from Meter per Hour to Centimeter per Minute.
- Parameters:
Meter_per_Hour (float) β Meter_per_Hour is a unit for welding speed.
- Return type:
Centimeter_per_Minute is a unit for welding speed.
- PyGamLab.Converters.Meter_Per_Second_To_Kilometer_Per_Hour(mps)[source]
- Parameters:
mps (float) β number in meter per second
kph (float) β number in kilometer per hour
- PyGamLab.Converters.Meter_To_Angstrom(m)[source]
Converts a length value from meters to Angstroms.
- Parameters:
m (float) β The length value in meters.
- Returns:
The length value in Angstroms.
- Return type:
float
- PyGamLab.Converters.Meter_To_MilliMeter(meter)[source]
- Parameters:
meter (int) β enter the length in meter.
- Returns:
milimeter β This function converts meter into milimeter.
- Return type:
int
- PyGamLab.Converters.Meter_To_inch(m)[source]
Converts a length value from meters to inches.
- Parameters:
m (float) β The length value in meters.
- Returns:
The length value in inches.
- Return type:
float
- PyGamLab.Converters.Micrometer_To_Angstrom(um)[source]
Converts a length value from micrometers to Angstroms.
- Parameters:
um (float) β The length value in micrometers.
- Returns:
The length value in Angstroms.
- Return type:
float
- PyGamLab.Converters.Micrometer_To_Nanometer(micrometer)[source]
converting micrometer to nanometer
- Parameters:
micrometer (float,dimension) β DESCRIPTION. The default is 1.
- Returns:
Nanometer β unit(nm)
- Return type:
float,dimension
- PyGamLab.Converters.Mile_To_Foot(mi)[source]
Converts a length value from miles to feet.
- Parameters:
mi (float) β The length value in miles.
- Returns:
The length value in feet.
- Return type:
float
- PyGamLab.Converters.Milimeter_To_Angstrom(mm)[source]
Converts a length value from millimeters to Angstroms.
- Parameters:
mm (float) β The length value in millimeters.
- Returns:
The length value in Angstroms.
- Return type:
float
- PyGamLab.Converters.Miller_To_Millerbrove(u, v, w)[source]
this function converts miller index to miller_brove index
1. u: int Intersection with axis a1
2. v: int Intersection with axis a2
3. w: int Intersection with axis z
Returns β> (miller_brove indexes)
1. l: int Intersection with axis a1
2. m: int Intersection with axis a2
3. n: int Intersection with axis a3
4. o: int Intersection with axis z
- PyGamLab.Converters.Millerbrove_To_Miller(l, m, n, o)[source]
this function converts miller_brove index to miller index
Parameters: (miller_brove indexes)ΒΆ
l: int
Intersection with axis a1
2. m: int Intersection with axis a2
3. n: int Intersection with axis a3
4. o: int Intersection with axis z
Returns β> (miller indexes)
1. u: int Intersection with axis a1
2. v: int Intersection with axis a2
3. w: int Intersection with axis z
- PyGamLab.Converters.MilliMeter_To_Meter(milimeter)[source]
- Parameters:
milimeter (int) β enter the length in milimeter.
- Returns:
meter β This function converts milimeter into meter.
- Return type:
int
- PyGamLab.Converters.Mils_Year_To_Mm_Year(mpy)[source]
Converts a corrosion rate from mils per year (mpy) to millimeters per year (mm/yr). 1 mm/yr = 39.37 mpy
- Parameters:
mpy (float) β The corrosion rate in mils per year.
- Returns:
The corrosion rate in millimeters per year.
- Return type:
float
- PyGamLab.Converters.Minute_To_Second(Minute)[source]
This function converts minutes to seconds
- Parameters:
Minute (int) β units of time in minute
Returns
int β Minute_to_Second
- PyGamLab.Converters.MmHg_To_Pascal(mmHg)[source]
Convert pressure from millimeters of mercury (mmHg) to Pascal (Pa).
- Parameters:
mmHg (float) β Pressure in millimeters of mercury.
- Returns:
Pressure in Pascals.
- Return type:
float
- PyGamLab.Converters.Mm_Year_To_Mils_Year(milpy)[source]
Converts a corrosion rate from millimeters per year (mm/yr) to mils per year (mpy). 1 mm/yr = 39.37 mpy
- Parameters:
milpy (float) β The corrosion rate in millimeters per year.
- Returns:
The corrosion rate in mils per year.
- Return type:
float
- PyGamLab.Converters.Molarity_To_Normality(Molarity, n)[source]
- Parameters:
Molarity (float)
n (int) β Number of moles.
- Return type:
Normality.
- PyGamLab.Converters.Mole_To_Gram(mol, MW)[source]
This function calaculates the eqivalent mass of a compound in gram(s) base on amount of substance in mole(s).
- Parameters:
mol (float) β mol is the eqivalent amount of substance of a compound in mole(s).
MW (float) β MW is the Molecular weight of a compound (gram/mole).
- Returns:
g β g is the eqivalent mass in of a compound in in gram(s).
- Return type:
float
- PyGamLab.Converters.Mole_To_Mass(Mole, Molar_Mass)[source]
- Parameters:
Mole (int)
Molar_Mass (float) β The mass of one mole of substance (g/mol).
- Returns:
Mass (g)
- Return type:
Float.
- PyGamLab.Converters.Moles_To_Percentages(moles)[source]
Calculate weight percentages of each component from their moles.
- Parameters:
moles (dict) β Dictionary where keys are material names and values are the number of moles.
- Returns:
Dictionary where keys are material names and values are weight percentages.
- Return type:
dict
- PyGamLab.Converters.Mpa_To_Psi(Num_Mpa, /)[source]
- Parameters:
Num_Mpa (float) β Megapascals=Newton per square millimetre
- Returns:
Psi β Psi=Pounds force per square inch
- Return type:
float
- PyGamLab.Converters.Mps_To_Kmph(V1)[source]
This function is used to convert meter per second to kilometer per hour.
- Parameters:
V1 (float) β The speed value in meters per second.
- Returns:
The speed value in kilometers per hour.
- Return type:
float
- PyGamLab.Converters.Mpy_To_Current_Density(mpy, density, masschange, valency)[source]
- Parameters:
mpy (float) β corrosion rate in mpy
density (float) β materails density
masschange (float) β amount of mass corroded
valency (int) β how positive is the charge
- Return type:
Current density
- PyGamLab.Converters.Nanometer_To_Angstrom(Nanometer_value)[source]
This function converts Nanometers to Angstroms. 1 Nanometer(nm)= 10 Angstroms(Γ )
- Parameters:
Nanometer_value (int or float) β Value in Nanometers(nm).
- Returns:
Angstrom_value β Equivalent value in Angstroms(Γ ).
- Return type:
int or float
- PyGamLab.Converters.Nanometer_To_Micrometer(nanometer)[source]
converting nanometer to micrometer
- Parameters:
nanometer (float,dimension) β unit (nm) DESCRIPTION. The default is 1.
- Returns:
Micrometer
- Return type:
float,dimension
- PyGamLab.Converters.Newton_To_Foot_Pound(Newton_Meters)[source]
# This Conventor convert Nm to ft-lbs
- Parameters:
Newton_Meters (The newton-metre is the unit of torque.(Nm))
- Returns:
Foot_Pound (a unit of torque equal to the force of 1 lb acting perpendicularly to)
an axis of rotation at a distance of 1 foot.(ft-lbs)
- PyGamLab.Converters.Newton_To_Pound_Force(Newton)[source]
- PyGamLab.Converters.Normality_To_Molarity(Normality, n)[source]
- Parameters:
Normality (float)
n (int) β Number of moles.
- Return type:
Molarity.
- PyGamLab.Converters.Pascal_To_Atmosphere(Pa)[source]
Converts a pressure value from Pascals to atmospheres.
- Parameters:
Pa (float) β The pressure value in Pascals.
- Returns:
The pressure value in atmospheres.
- Return type:
float
- PyGamLab.Converters.Pascal_To_Bar(Pa)[source]
- Parameters:
Pa (float) β Pascal.
- Returns:
bar β Converts pascal to bar.
- Return type:
float
- PyGamLab.Converters.Pascal_To_CmHg(P1)[source]
This function is used to convert Pascal to centimeter mercury.
- Parameters:
P1 (float) β The pressure value in Pascals.
- Returns:
The pressure value in centimeters of mercury (cmHg).
- Return type:
float
- PyGamLab.Converters.Pascal_To_Megapascal(Pascal)[source]
# This Conventor Convert Pascal to Megapascal
- Parameters:
Pascal (the unit of pressure or stress in SI.)
- Returns:
Megapascal
- Return type:
1 Megapascal equals 1,000,000 Pascals.
- PyGamLab.Converters.Pascal_To_MmHg(p)[source]
This function convert pascal to mmHg
- Parameters:
p (float) β pressure (Pa).
- Return type:
None.
- PyGamLab.Converters.Pascal_To_Torr(pa)[source]
This function converts Pascal to Torr.
- Parameters:
pa (float) β The pressure value in Pascals.
- Returns:
The pressure value in Torr.
- Return type:
float
- PyGamLab.Converters.Percent_To_Ppm(a)[source]
Converts a concentration value from percent to parts per million (ppm).
- Parameters:
a (float) β The ion percent in brine.
- Returns:
The ion concentration in ppm in brine.
- Return type:
float
- PyGamLab.Converters.Percentages_To_Moles(total, percentages)[source]
Calculates the number of moles of each component in a mixture given their percentages by weight and the total weight.
- Parameters:
total (float) β The total weight of the mixture.
percentages (dict) β A dictionary where keys are the names of the materials and values are their weight percentages.
- Returns:
A dictionary where keys are the names of the materials and values are their corresponding number of moles.
- Return type:
dict
- PyGamLab.Converters.Pound_Force_To_Newton(Pound_Force)[source]
- PyGamLab.Converters.Pound_To_Kilogram(number_in_pound)[source]
This function converts the desired number from pounds to kilograms.
- Parameters:
number_in_pound (int) β Number per pound.
- Returns:
kilogram β Number per kilogram.
- Return type:
int
- PyGamLab.Converters.Pounds_Per_Cubic_Inch_To_Kilogeram_Per_Cubic_Meter(LbPerCubicInch)[source]
Converts a density value from pounds per cubic inch to kilograms per cubic meter.
- Parameters:
LbPerCubicInch (float) β The density value in pounds per cubic inch.
- Returns:
The density value in kilograms per cubic meter.
- Return type:
float
- PyGamLab.Converters.Ppm_To_Percent(a)[source]
Converts a concentration value from parts per million (ppm) to percent.
- Parameters:
a (float) β The ion concentration in ppm in brine.
- Returns:
The ion percent in brine.
- Return type:
float
- PyGamLab.Converters.Ppm_To_Weightpercent(ppm)[source]
This function is used to convert ppm (parts per million) to weight percent.
- Parameters:
ppm (float) β The concentration in ppm.
- Returns:
The concentration in weight percent.
- Return type:
float
- PyGamLab.Converters.Psi_To_Mpa(Num_Psi, /)[source]
- Parameters:
Num_Psi (float) β Psi = Pounds force per square inch
- Returns:
Mpa β Megapascals=Newton per square millimetre
- Return type:
float
- PyGamLab.Converters.Radian_To_Degrees(num)[source]
This function is used to convert radians to degrees.
- Parameters:
num (float) β The angle value in radians.
- Returns:
The angle value in degrees.
- Return type:
float
- PyGamLab.Converters.Rockwell_To_Brinell(hrb)[source]
Convert Rockwell hardness (HRB) to Brinell hardness (HB).
- Parameters:
hrb (float) β Hardness in Rockwell B scale.
- Returns:
Hardness in Brinell scale.
- Return type:
float
- PyGamLab.Converters.Rpm_To_Hertz(b, /)[source]
- A converter machine to convert frequency in rpm to frequency in Herta(Hz).
- bint or float
frequency, revolution per minute (rpm).
Returns a, frequency, Hertz(Hz)
- PyGamLab.Converters.Sec_To_Hour(t)[source]
Converts a time value from seconds to hours.
- Parameters:
t (float) β The time value in seconds.
- Returns:
The time value in hours.
- Return type:
float
- PyGamLab.Converters.Second_To_Minute(Second)[source]
- This function converts seconds to minutes
Parameters
- Secondint
units of time in seconds
Returns int
Second_to_Minute
- PyGamLab.Converters.Square_Cm_To_Square_meter(a)[source]
- Parameters:
a (int) β Square_Cm
-------
c (int) β Square_Meter
- PyGamLab.Converters.Square_Meter_To_Square_Cm(b)[source]
- Parameters:
b (int) β Square_meter
-------
c (int) β Square_Cm
- PyGamLab.Converters.Ton_To_Kg(Ton)[source]
Converts a mass value from metric tons to kilograms.
- Parameters:
Ton (float) β The mass value in metric tons.
- Returns:
The mass value in kilograms.
- Return type:
float
- PyGamLab.Converters.Torr_To_Pascal(torr)[source]
This function converts Torr to Pascal.
- Parameters:
torr (float) β The pressure value in Torr.
- Returns:
The pressure value in Pascals.
- Return type:
float
- PyGamLab.Converters.Viscosity_To_Pas(poise)[source]
Converts dynamic viscosity from Poise (P) to Pascal-seconds (PaΒ·s).
- Parameters:
poise (float) β The dynamic viscosity in Poise.
- Returns:
The dynamic viscosity in Pascal-seconds.
- Return type:
float
- PyGamLab.Converters.Viscosity_To_Poise(pa_s)[source]
Converts dynamic viscosity from Pascal-seconds (PaΒ·s) to Poise (P).
- Parameters:
pa_s (float) β The dynamic viscosity in Pascal-seconds.
- Returns:
The dynamic viscosity in Poise.
- Return type:
float
- PyGamLab.Converters.Watt_To_Horsepower(Watt)[source]
- Parameters:
Watt (float) β give number in Watt.
- Returns:
Horsepower β return number in Horsepower.
- Return type:
float
- PyGamLab.Converters.Weightpercent_To_ppm(num)[source]
This function is used to convert weight percent to ppm (parts per million).
- Parameters:
num (float) β The concentration in weight percent.
- Returns:
The concentration in ppm.
- Return type:
float
- PyGamLab.Converters.Yarn_Count_To_Other_System(Yarn_Count, Current_System='tex', Desired_System='den')[source]
This function converts yarn count values in different systems.
- Parameters:
Yarn_Count (int or float) β Number of yarn count.
Current_System (str, optional) β Current yarn count system. The default is βtexβ.
Desired_System (str, optional) β Expected yarn count system. The default is βdenβ.
Yarn_Count β Result.