Image copyright NASA/F. Pereira Santos Image caption The team was able to map differences in the polarization of dust grains within the central portion of the cloud

A Nasa telescope housed on a converted jumbo jet has yielded important insights into how stars are born from collapsing gas and dust.

Measurements by the Sofia observatory underline the importance of magnetic fields for star formation.

Astronomers used an instrument on Sofia to study one of the closest stellar nurseries to Earth - Rho Ophiuchi A.

They discussed details of the work at the 231st American Astronomical Society meeting.

"Understanding how stars and planets are formed is one of the greatest challenges of modern astronomy," said co-author Fabio Santos, from Northwestern University in Evanston, Illinois.

"We know that stars and planets are formed in giant clouds of molecular gas and dust that exist in the plane of the Milky Way galaxy."

The basic idea is that these clouds contract under their own gravity. Becoming ever more dense, they fragment into gaseous clumps and, from there, dense structures called "cores" are formed.

It is within these dense cores of dust and gas that infant stars are found.

Image copyright Bill Saxton, NRAO/AUI/NSF Image caption A graphic illustrating the formation of stars and planets from clouds of molecular gas and dust

But the devil is in the detail: "It's a very complicated process," said Dr Santos.

The astronomers trained Sofia's HAWC+ instrument on Rho Ophiuchi A, which is actively forming hundreds of young stars. Many of which will probably become stars like our Sun, complete with their own planetary systems.

HAWC+ is sensitive to emission in the far-infrared portion of the electromagnetic spectrum. Data from the instrument allowed researchers to show that dust grains in the cloud were aligned with magnetic fields.

Furthermore, they found that changes in the way dust aligned along field lines were closely related to differences in the density of the star-forming cloud. The measurement represents the first of its kind - and Sofia is uniquely equipped to perform such observations.

The result supports an existing theory called Radiative Alignment Torque (RAT).

Dr Santos explained: "The interstellar grains need radiation to align efficiently. It is expected that the grains in the outskirts of the cloud receive more radiation so they should be better aligned (with magnetic fields).

"As you go to the darker (and denser) parts of the cloud, the grains receive less radiation - so they are not very well aligned anymore."

But how does all this help better explain how stars and planets form?

"The cloud has mass, and therefore it has gravity. So you would think that it should just contract and create stars in there. But there are more things involved - one of these other things are magnetic fields," Dr Santos told me here at the astronomy meeting in National Harbor, just outside Washington DC.

"You can think of the magnetic field as this net of lines that is mixed together with the material in the cloud. Whenever the cloud contracts, it brings the field lines together. So, it acts as a kind of tension that holds the material together.

"There is an idea that if you have very strong magnetic fields in some parts of the galaxy, you could run into a situation where gravity will not be able to overcome this magnetic tension. So you won't be able to form any stars... the magnetic field lines don't let the material collapse."

Image copyright NASA Image caption A door in the aft fuselage gives Sofia's 2.5m-wide telescope access to the sky

At the other end of the spectrum, weaker magnetic fields should in theory be overcome by gravity, initiating star formation.

Understanding patterns in the magnetic fields of star-forming regions might help us predict how they will evolve in future. The strength of the magnetic fields in space could also influence how massive stars grow to be, and, potentially, whether planetary systems can form around them, Dr Santos added.

The US-German Sofia (Stratospheric Observatory for Infrared Astronomy) observatory is based around a modified Boeing 747SP aircraft. While flying at altitudes of about 12km (41,000ft), a large door in the aft fuselage is opened, allowing a 2.5m diameter telescope to observe the sky.

The aircraft can rise above most of the water vapour in the Earth's atmosphere - which can block some infrared wavelengths from reaching the ground.

The project is managed for Nasa by the Universities Space Research Association (USRA), while the German parts of the venture are managed by a special organization - the DSI (Deutsches SOFIA Institut).

Follow Paul on Twitter.