flux_to_flareclass

sunpy.instr.goes.flux_to_flareclass(goesflux: Unit("W / m2"))[source] [edit on github]

Converts X-ray flux into the corresponding GOES flare class.

Parameters

flux (Quantity) – X-ray flux between 1 and 8 Angstroms (usually measured by GOES) as measured at the Earth in W/m^2

Returns

flareclass (str) – The flare class e.g.: ‘X3.2’, ‘M1.5’, ‘A9.6’.

Raises

ValueError – Flux cannot be negative.

References

Solar Flare Classification

Examples

>>> from sunpy.instr.goes import flux_to_flareclass
>>> import astropy.units as u
>>> flux_to_flareclass(1e-08 * u.watt/u.m**2)
'A1'
>>> flux_to_flareclass(4.7e-06 * u.watt/u.m**2)
'C4.7'
>>> flux_to_flareclass(0.00024 * u.watt/u.m**2)
'X2.4'
>>> flux_to_flareclass(7.8e-09 * u.watt/u.m**2)
'A0.78'
>>> flux_to_flareclass(0.00682 * u.watt/u.m**2)
'X68.2'