Sunday, June 12, 2011

Star clusters for Celestia

Although Celestia currently can display Globular Clusters, they're individual objects and not composed of discrete Stars.

Long ago, a Celestian calling himself Rassilon wrote a cluster generator. In addition to defining a random collection of stars, it'll define planetary systems around some of them if that's desired. Unfortunately, it hasn't been updated for a long time, and runs only under Windows.

An open-source, scientifically accurate cluster generator, McLuster, is available which uses monte-carlo techniques to define various types clusters of stars. It's intended primarily for generating inputs for the NSTARS family of programs, which are used to study the gravitational development of clusters. For more information about McLuster, see http://www.astro.uni-bonn.de/~akuepper/mcluster/mcluster.html

I've written a Fortran-77 program of my own, called MCL2STC, which translates the output of McLuster into Celestia's STC (STar Catalog) format.

They don't generate any planetary systems, and both programs are controlled by command-line: they don't include a Graphical User Interface.

I've packaged the two programs together and made them available in
http://www.lepp.cornell.edu/~seb/celestia/files/mcl2stc.zip
It's about 1.5MB and expands to about 4MB. It's so large because it includes Cygwin runtime libraries for use under Windows. I've included the f77 source code for mcl2stc, so it can be built under other operating systems. The source code for McLuster is available on the Web site mentioned above.

The picture below shows two types of clusters generated by McLuster, translated by mcl2stc, and displayed by Celestia. The one on the left is about 50 mega-years old, while the smaller one is about 4 giga-years old -- most of its hot, young stars have disappeared, leaving cooler, yellower ones.



In response to the comment about compilation problems: the current version of MCL2STC must be compiled using the older g77 compiler. It is not compatible with either gfortran or g95. A compatible version is being worked on, but won't be available for a while, probably several months.

2 comments:

NiteSkyGirl said...

NICE PROGRAM !!!!!

Tom said...

I can't compile mcl2stc.f on Linux. (McLuster itself compiled with no trouble). I get

$ gfortran mcl2stc.f
mcl2stc.f:32.65:

data atypes/'low mass','main seq','hertz gap','1st gnt br',
1
Error: Syntax error in DATA statement at (1)
mcl2stc.f:33.7:

1 'corehelium','1st as.gnt','2nd as.gnt','m.seq.hel.',
1
Error: Invalid character in name at (1)
mcl2stc.f:34.7:

1 'hgap hel.','gnt.br hel','hel wd','co wd','on wd',
1
Error: Invalid character in name at (1)
mcl2stc.f:35.7:

1 'neut. star','black hole','snr',5*'-'/
1
Error: Invalid character in name at (1)
mcl2stc.f:49.47:

open(unit=3,file=filename(:lenf)//'.txt',
1
Error: Syntax error in OPEN statement at (1)
mcl2stc.f:50.7:

1 form='formatted',type='old',recl=512)
1
Error: Invalid character in name at (1)
mcl2stc.f:81.1:

d print *, 'star # ',n
1
Error: Non-numeric character in statement label at (1)
mcl2stc.f:82.1:

d print *, ( 'f',i,': ',fields(i),i=1,21)
1
Error: Non-numeric character in statement label at (1)
mcl2stc.f:99.1:

d print *,n,nc, ntype
1
Error: Non-numeric character in statement label at (1)
mcl2stc.f:108.1:

d print *, xmass, xlum,vmag,t
1
Error: Non-numeric character in statement label at (1)
mcl2stc.f:114.1:

d print *, ' type = ',atype
1
Error: Non-numeric character in statement label at (1)
mcl2stc.f:124.72:

call gen_stc(x,y,z,atype,vmag,
1
Error: Syntax error in argument list at (1)
mcl2stc.f:125.7:

1 ara0,adec0,adist0,filename,cluname)
1
Error: Invalid character in name at (1)
mcl2stc.f:146.72:

subroutine gen_stc(x,y,z,atype,xmag,
1
Error: Invalid character in name at (1)
mcl2stc.f:147.7:

1 ara0,adec0,adist0,filename,cluname)
1
Error: Invalid character in name at (1)
mcl2stc.f:1.72:

program mcl2stc
1
mcl2stc.f:152.72:

character*20 ara0,adec0,adist0,filename,cluname
2
Error: Two main PROGRAMs at (1) and (2)