The PC Spectrum Synthesizer

ABSTRACT Latest revision 2001 January 2.

NEW:
This program is obsolete.
Newest version of SYN.EXE will soon be available
for WIN32 platform
(seems to work in windows95 as well....)

The new FORTRAN COMPILER is from the GNU (MinGW) project.


Text below is obsolete!
A PC program that generates a theoretical spectrum based on a stellar photospheric model is described. The program is interactive and is especially designed for modelling the Fraunhofer spectrum against observational data obtained at the Jungfraujoch solar observatory (data are also available from the Kitt Peak atlas), though the program may be used for any general stellar photospheric analysis.

The program adresses the problem of the determination of the chemical composition of the sun and stars from the observed spectrum. The program may be used in curve-of-growth mode or direct spectrum synthesis mode.

The theory is very basic Astrophysical LTE but there is the usual abality to accept NLTE b's produced by another program. Damping theory is also basic but there is a capability to include damping parameters produced by other programs (eg Anstee and O'Mara Mon.Not.R.Astron.Soc.276, 859, 1995).

Program and Data
The program is syn.exe (169868 bytes)
Jungfraujoch data MUST be stored in C:/JUNG/
The data files are named "Jnnn" where "nnn" is the starting wavelength, eg, J043 has data for the region 4300-4400 angstroms. The zipped files contain data from Jnnn through Jmmm:
J036-J039 (Copy these to C:/JUNG/ and unzip)
J040-J049
J050-J059
J060-J069
J070-J079
J080-J089

Kitt peak data are also available:
K040-K049 (Copy these to C:/KPNO/ and unzip)
K050-K059
K060-K069
K070-K079
(Jungfraujoch is default, to get KPNO enter "A" (Atlas) then "K".
This has not been tested yet, Under test NOW.......
Sample data file here and Holweger/Muller model here (put in same folder as syn.exe). From the Dos prompt enter "SYN FE5247" and see what happens. (Or enter SYN then, after the program loads, at the SYN=> prompt enter "FE5247" or "FE5247.DAT". You must do this if you start via a windows shortcut to syn.exe).

Curiously, SYN runs better under WINDOWS (including 95) in a DOS partition than under DOS 6. Also, you can "drag" SYN.EXE onto the desktop and click the icon to run. You can cut and paste the graphics "in the usual manner".

INTERACTIVE MODE

If all goes well you get a graphics screen like the one on my homepage. You will see a red box around a blue screen, some tic marks (each 0.1A) on top and bottom, perhaps a dotted vertical black line or two (they mark each Å), the observed spectrum (white), the computed spectrum (green) and a (black) difference spectrum (scaled up 5 times), and three lines of text at the bottom that suggests interactive actions such as (H)elp (if you enter h you will get a help screen - enter a second h to return).
The first line also tells you the wavelength grid interval dW= (The atlas interval is 0.002A), the log of the continuum intensity (or flux if you are in flux mode) and the total equivalent width of the computed region.
The second line gives the value of the micro and macroturbulent velocities and disk position. At far left before "cursor" is a number that tells how fast the arrow keys push the cursor around. Use PgUp and PgDn to change the cursor speed (make sure NumLock is off). At present the cursor is a tiny dot that shows after you hit an arrow key.
The bottom line gives the residual intensity and wavelength of the cursor. Data for the line nearest THE cursor follows the "By:" and the parameters for THE line can be changed interactively.

Hit return a few times. The text line toggles between what you saw at first and a prompt line "(S)cale (C)hange...". If you hit S the prompt switches to "Enter scale factor" and you can enter a number that will multiply the vertical scale. If you are working with weak lines or are trying to find a clean part of the spectrum (for the SPAN command) try a scale of 10 or so.

HINT: If you just hit S followed by return (CR) the scale is set to unity, and you might find S followed by CR useful for "cleaning" the plot. Also, I often enter a goofy value that causes the screen to "jump" and S CR fixes things.

Suppose you would like to see what happens if you boost the abundance of one of the lines by a factor of two (the abundance is in the form log(N/NH)+12 so this means you add 0.30103 to the number). Move the cursor to the line, hit a C for (C)hange and enter the new abundance. Try the Ti line at 5247.288: Move the cursor (which is a tiny dot that is hard to see and only appears when you hit one of the arrow keys) until the line appears in the text window, hit a C and (C)hange the 4.880 to 5.18 by simply entering 5.18. Nothing happens yet. You can make more changes but to make the changes "take" you have to enter R for (R)un and a bit of exercise for the floating point processor. After a while a new line appears on the screen and you see the old (green) and new (cyan) computed spectra on the screen and you see what such a parameter change does.

And the wavelengths just never seem to be right. You can (C)HANGE the wavelength of a line by hitting C (yes, (C)hange again) then entering the new wavelength. Unambiguous! Abundances are always less than log(N/NH)+12=14 and wavelengths are always greater than 100Å. Finally, you can change the Van der Waals multiplier by entering the new value as a negative number. You may think this is pretty primitive data entry but I like it so there! If you accidently hit C you can simply hit return and nothing will happen.

(R)emember, you can make many changes to different lines before hitting the time-consuming (R)un command. Of course, you should note what you are doing but a record of your changes will be recorded in FE5247.LIS for later perusal. And when the screen gets cluttered you can (S)cale to clean it up a bit.

(D)ata can be entered "in the usual form" if you hit D. For instance, you could put in an additional line like (see "LINE COMMAND")

         C 1  5247.92  0.123  -4  1 1 0  -3  .015
which should make that unsightly dip around 5247.923 look a lot better. Try it. It is not really carbon, it is a blend of cobalt and chromium but it does look nice! More important, you learn the important fact that elements having a single chemical symbol such as B, C, N, O, etc. MUST be entered as "blank C", the leading blank is very important (I may change this*****).

Note that you seem to have entered an abundance parameter of -3. In fact, the program took this to mean +3 and used this as a guess to compute what the abundance should be to give an equivalent width of 0.015Å. In other words, you invoked the curve-of-growth facility because you had a better idea of what the equivalent width of the feature is (the M.M.H. NBS Mono.61 gives 16mA as the equivalent width for this line) than the abundance. Note that the abundance is now reported as 3.915 and after cleaning the plot you will see that the Area is now .191 (assuming you changed the the Ti abundance back to 5.18 and remember to move the cursor to the vicinity of the line to see this, or type h to see a data list).

If you remembered to load GRAPHICS you can "Print Screen" for a hard copy but the neat screen colors will give the printer a fit! You can change the screen colors with the COLOUR command, e.g., try entering the (D)ata

COLOR 0 1 2 3 4 15
where first number (0) controls the background and black (0) seems best. You can select from several color schemes via the (H)elp command, one for use with Word for Win via cut and paste. My homepage graphic is a cut and paste into Lview then saved as a GIF. There must be a million better ways to do this...

As a final example, why not check and see whether Eddington and Barbier were right. Enter (D)ata mode, then enter MU 0. This will switch to flux mode. Clean the plot (S) and (R)un. You see the old I(0,0) plot and the F(0) plot and of coures they are different. Now clean up the plot again. On the left side you see that Mu=1 is changed to flux (***oops bug-- it will after you "clean"***) and the log(continuum)=-4.837. (Intensities are per wavelength interval and fluxes are per frequency interval, cgs. This is the "standard" way to do it?) Next, enter MU .66667 and (R)un. The two runs look pretty similar, don't they? You see in action that F=I(Mu=2/3) which is the Eddington-Barbier relation for a grey model works pretty well for the sun!

DATA FILES

When SYN.EXE is started, you are asked for an input data filename. This will be a simple text file containing various SYN commands and data. In order to eliminate some duplication, Peter Milford introduced a simple file handler that enables one file to reference another. This is invaluable for the MODEL which typically involves a hundred or so data items. The user invokes this facility via the USE and DONE commands. For example, in FE5247.DAT you find "USE HOLMUL.DAT". So at startup you enter "FE5247" which transfers input to FE5247.DAT. Then FE5247.DAT transfers input to HOLMUL.DAT which contains the MODEL data that is used by other input files. After HOLMUL.DAT is "finished", input is returned to the FE5247.DAT file via the DONE command. And when FE5247.DAT is finally done it could return input to the console via a DONE command (try changing the STOP to DONE). By the way, you will find MIcroturbulent and MAcroturbulent velocities are set in HOLMUL.DAT since these parameters are supposedly known in the sun (but not by me!). You can easilly change this or simply override them by putting in your own values in the line data set (eg FE5247.DAT) after the MODEL HOLMUL.DAT data. Or even play around with variable microturbulence (see below). For stars, (remember to set MU 0) you would probably put these data in the "first" data file.

SYN COMMANDS

Commands for the spectral synthesis program are cued by the first two or in ambiguous cases three letters. For example, the MODEL command is recognized by the first two characters MO which could be confused with the "line" command for molybdenum. The ambiguity is resolved by the third letter D. So the MODEL command can be written MOD or MODEL or MODESTY. The most important thing to remember is that there must be no leading blanks in the command with one notable exception: The so-called "line" command consists of the atomic symbol for the line in question, and in the case of an element whose chemical symbol consists of a single letter ie B,C,N,O,F,P,S,A,V,Y,I,U the leading character must be blank. Finally, the command is terminated by a blank or tab so FE 1 or Ferrum 1 or fearless 1 all are valid ways to start the "line" command for iron. (Note that iron 1 is the command to start neutral iridium!) And mu 1 or mU 1 or Musical 1 sets the program to calculate intensity at disk centre.

If the command record requires data, e.g., COLor, which requires six data items, the data are read in free-field format with data items separated by blank(s) tabs or commas.

Note that if the first two characters of a record are blank or a tab, the record is taken to be a comment. Be sure the "comments" recorded in the permanent record file (filename.lst) really are comments!

COMMAND SUMMARY

COLours Defines the synthesizer screen plot colours. Requires six items using the usual IBM colour palette: 0=black, 1=blue, 7=white, 15=yellow and so on. Default is 1 4 5 7 7 10.

  1. Background colour. Use zero if you are printer-plotting!
  2. Box around screen edge,
  3. Wavelength tic marks,
  4. Line identification,
  5. Observed spectrum,
  6. Synthesized spectrum.
Done
Return to calling data stream (file management). See USE.

Dump
List intermediate calculations in the output file. Default is DUMP which simply eliminates all intermediate printout. Dumps are:

		1) opacity
		2) tau-std, tau, B, S, J-S
		3) line opacity l/gA Nr,s/gA alpha, a, v, gamma at delta=0
		4) saha fractions
		5) model parameters and ionization fractions for opacity
		6) line opacity at all delta-lambda (see 3)
		7)
		8)
		9)
so "DUMP 1 3 5" activates dumps 1,3 and 5. "DUMP" clears all.

Grid
The GRID command initiates the synthesis. It needs three data items:

                1) Wmin, the starting wavelength (A),
                2) Wmax, the final wavelength,
                3) dW,  the grid spacing.
        ****Watch for change here****        
Computation time is proportional to (Wmax-Wmin)/dW. Note that the maximum number of grid points (Wmax-Wmin)/dW < 2001. Clearly, you start with a coarse grid then shrink dW as the region improves.

Macroturbulence
Value of macroturbulent velocity, km/s. Can often be used to simulate instrumental profile.

Microturbulence
Value of microturbulent velocity, km/s. Nobody really believes in microturbulence but everybody uses it. It is possible to employ depth-dependent microturbulence by MICRO -1 a b c d which sets Vmic(Xo)=a+b*Xo between Xo=c and Xo=d so for a complete description you may need several of these. { Xo=log(tauo) }

MODel
Indicates that the following records contain data for the photospheric model. Each record contains five items:

  1. Log of standard optical depth. The model MUST be tabulated at equal intervals. Units as usual are cgs.
  2. Temperature or theta=5040/T
  3. Log(gas pressure Pg) (or Pg)
  4. Log(electron pressure Pe) (or Pe)
  5. Log(Standard opacity Ko)
All logarithms to base ten. The model is crudely terminated by an entry less than -90 in item 1 (Xo<90). The maximum number of layers or strata is *****57***** (see STRATA.NOX).

MU
Disk position, Mu=cos(theta). MU=1 for disk center (default). Note that if 0<MU<=1 intensity is calculated, if MU=0 flux is calculated. So if you are working on stellar data you need a MU 0 command and I would recommend putting this right in the MODEL files so you dont forget.

Read
Continue reading input stream. See SKIP.

Skip
Skip over data until a READ command is encountered. Useful in curve-of-growth mode or data debugging.

Span
Recently changed. May have a bug if you set "SPan wavelength". This should force the program to normalize the computed and observed spectra at "wavelength". If this number is >50000 it scales the observed data, so SPAN 99500 would multiply the observed spectrum by a factor 0.995. I like to interactively scale 10 (to really magnify the continuum) then use Kommand to enter SPan 99990 or whatever to diddle the continuum (or is this really called cheating?)

Stop
Stop program gracefully. In interactive mode I exit by typing K followed by Q.

SYS
Shell (immediate) to DOS command prompt. Useful for using the DOS DIRectory command.

Use
Switch input stream. Requires full pathname if the file is not in the same directory as SYN.EXE and extension e.g.,

USE C:/MODELS/HOT/T14500.G40

The"LINE COMMAND"
If the first two characters of a record are not blank and are not a valid command, SYN presumes that you are trying to include a line to be synthesized. The line is recognized by its atomic symbol so you better be a bit familiar with the periodic table, e.g., lead (plumbum) is Pb, iron (ferrum) is Fe, gold (aurum) is Au and so on. If the two non blank characters do not comprise a valid chemical symbol, the program issues a nasty "INVALID COMMAND" warning and simply grinds to a halt*****under review. In fact I am not quite sure what it does right now... I will check this out.*******

NOTE that single symbol elements such as B, C, F, I, K, etc. REQUIRE that the first character be blank******underreview.

The "line command" requires, in addition to the chemical symbol,

  1. Ionization stage, 1=neutral, 2=ionized, 3=doubly ionized eg Fe 2, K 1 etc.
  2. Wavelength (double precision) in angstroms (Å).
  3. Excitation potential of the lower level in electron volts or, if you are not near the ground state, kaisers (8066 cm-1 per eV).
  4. Log(gf) the line strength. Often I let this equal zero and fit the line by adjusting the abundance parameter (8) since the line intensity is the product of gf and N/N(H).
  5. Radiation damping. If this is <100 we simply multiply the classical damping constant by this entry. If >100 then the reciprocal lifetime is used (it should be something like ten to the seventh or eighth s-1).
  6. Van der Waals damping. If this is less than 50 we simply multiply the simple Lindholm-Foley (ignoring l values) result by this entry.
    If negative, then the simple L-F theory is used with the entry taken to be delta r-bar squared.
    If the entry is over 50 the Anstee/O'Mara loc. sit. theory is used in the form sss.aa where sss is sigma (which should be between 100 and 1000) and .aa is alpha (usually about .25).
  7. Stark damping, simple theory again with entry being level displacement in cm-1 per 100kV field.
  8. The abundance parameter, log[N(element)/N(hydrogen)]+12. The +12 was put in long ago so that all these numbers would be positive. That was a good thing because if you don't know what the abundance is (That is what we are looking for!) but you do know what the equivalent width of the line is, then the program can calculate the abundance parameter by the curve-of-growth method. Simply enter the NEGATIVE of your best-guess abundance and include the optional (9):
  9. Equivalent width, measured in Angstroms (optional unless the abundance parameter is negative).

To exit
enter q (Quit) (twice?) to get to syn=>. one more q and you are back to DOS or Windows. When you are at syn> you can "do" another data file: >use 5859 for example.
For a quick exit just K Q

After you have finished tweaking the data, you will find a file filename.LIS that contains a record of what you did. The last (R)un is what you are probably interested in. The revised line data will be found at the end of the file. You can copy the revised line data over the original filename.DAT using a text editor.