Scientists have found a way to use alcohol to measure magnetic fields in space and learn more about how enormous stars form, as well as the planets around them.

They were relying on alcohol in its simplest form: methanol, an organic chemical that is considered one of the building blocks of life. Magnetic fields, which are a crucial but poorly understood factor in star formation, strongly affect the molecules of methanol that are floating in the space around them. Studying the methanol, therefore, can reveal information about the invisible magnetic fields.

Although this relationship has been previously explored, the team of scientists behind new research, published in the journal Nature Astronomy, created a model of how methanol interacts with magnetic fields.

In the dense, central area where a huge star is forming, methanol molecules beam bright microwave radiation — microwave lasers, also known as masers — that moves based on the layout of a magnetic field. That gives scientists a way of measuring the field’s strength and design.

Methanol and other molecules also signal to scientists the temperature, pressure and other factors in the star formation location.

“We developed a model of how methanol behaves in magnetic fields, starting from the principles of quantum mechanics,” researcher Boy Lankhaar said in a statement from the Chalmers University of Technology.

The astrochemical model can be applied to astronomers’ observations to help them understand the growth in different parts of the universe.

“With our new understanding of how methanol is affected by magnetic fields, we can finally start to interpret what we see,” researcher Wouter Vlemmings said in the statement.

That information could reveal some secrets of the most massive star formations. In turn, that affects what we know about how planets form in those solar systems.

“When the biggest and heaviest stars are born, we know that magnetic fields play an important role,” Lankhaar said. “But just how magnetic fields affect the process is a subject of debate among researchers. … Now, thanks to our new calculations, we finally know how to [measure them] with methanol.”