pipeline.domain.fluxmeasurement.FluxDensity
- class FluxDensity(value: int | float | Decimal = 0, units: dict = {'Jy': Decimal('1'), 'name': 'JANSKY', 'symbol': 'Jy'})[source]
Bases:
ComparableUnitMethods
Converts this measure of flux density to the new units.
Returns the magnitude of this flux density in otherUnits.
Attributes
valueunits- __init__(value: int | float | Decimal = 0, units: dict = {'Jy': Decimal('1'), 'name': 'JANSKY', 'symbol': 'Jy'}) None[source]
Create a new flux density with the given magnitude and units.
If called without arguments, the constructor will create a default frequency of 0 Janskys
- Parameters:
value -- The magnitude for this flux density.
units -- The new units for this flux density.
- convert_to(newUnits: dict = {'Jy': Decimal('1'), 'name': 'JANSKY', 'symbol': 'Jy'}) FluxDensity[source]
Converts this measure of flux density to the new units. After this method is complete this flux density will have units of units and its value will have been converted accordingly.
- Parameters:
newUnits -- The new units for this flux density (default: Jy).
- Returns:
This flux density. The reason for this return type is to allow code of this nature:
janskies = myFluxDensity.convert_to(FluxDensityUnits.JANSKY)
- to_units(otherUnits: dict = {'Jy': Decimal('1'), 'name': 'JANSKY', 'symbol': 'Jy'}) Decimal[source]
Returns the magnitude of this flux density in otherUnits.
Note that this method does not alter the state of this flux density. Contrast this with convert_to(FluxDensityUnits).
- Parameters:
otherUnits -- The units in which to express this flux density's magnitude.
- Returns:
This flux density's value converted to otherUnits.