StarFISH Patchsets

(return to Homepage)
Patchsets are recent improvements to the codebase that have not yet been placed in a release. To use these patchsets, you must have the most recent released version of StarFISH, which is currently StarFISH-1.1-p1.
How To Use Patchsets
  1. Save each file in the set to the appropriate directory. For example, if the file is named sfhcode/sfh.patch, you should place it in your SFH/sfhcode directory.
  2. For each *.patch file, go to its directory and run the command patch -p0 < filename.patch. This will apply the changes encoded in the patch.
  3. Run make in each source-code directory which has been patched.

Email me if you have problems.

List Of Available Patchsets
BUGFIX: Use NINT() instead of INT()+1

For unknown reasons, on some UNIX variants (including Linux), the quantity int((2.0-1.0)/0.1) is evaluated as 9 instead of 10. As a workaround, I would add +1 to such int() statements. However, on architectures which evaluate the equation properly (such as Solaris), this obviously causes problems. The fix is to simply use nint() instead of int()+1. I thought I had already fixed all of these, but Tom Brown found one more instance. Thanks, Tom.

Better Handling of *.h Dependency in Makefiles

Prior to this patch, if you modified one of the *.h files, you would have to type make clean, then make, to ensure that the new parameters were propagated into the program. This patchset fixes the Makefiles so that they will automatically recompile any source-code files that depend on the *.h file, so you just have to type make after modifying the *.h file.

Accept TAB Characters as Whitespace

When reading input files, StarFISH considers the first "word" in each line to be the data, and it uses SPACE characters to define the boundaries of this "word". This patch generalizes the string parser so that TAB characters can also be used as whitespace. Without this patch, the TAB character would be considered part of the data word.

Mike Barker's Scatter Function

By default, StarFISH uses a rather complex algorithm to add photometric errors to the synthetic CMDs. It involves binning the AST results into 2-dimensional histograms, which are re-expressed as cumulative functions, and these are interpolated in the CMD to the position of each synthetic star.

As an alternative, Mike Barker came up with a more straightforward scheme, in which the algorithm simply identifies the artificial star which is closest to the model star in the CMD plane, and adopts the scattering and dropout state of that artificial star. I find that this algorithm is not only simpler, but runs faster and produces better synthetic CMDs. Thanks for contributing it, Mike!

After installing the patchset, simply set the err_method parameter in the synth.dat file to "2" to use it. This is the parameter whose comment reads 0 = use AST errs; 1 = use analytic err model.

Faster Error Determination

Confidence intervals on each SFH are determined by deviating from the best-fit position in parameter space. This involves choosing a parameter-space direction and moving in that direction until a threshhold increase in chi-squared is reached. This is done for many thousands of parameter-space directions. Sometimes, a single step in a given direction changes chi-squared very slowly, so a large number of steps is required to cross the chi-squared threshhold. This patch will increase the step-size when it detects that the step has resulted in a very small increase in chi-squared. This significantly reduces the time required to determine the confidence intervals.

Compact Screen Output

As StarFISH converges toward the best fit, it reports the curent chi-squared value to the screen. This usually results in a large number of lines being dumped to the terminal. This patch adds a C routine to output the chi-squared values to the screen without adding newlines, so the total output to the terminal is a much smaller number of lines.