[main.py]: Tested modifications to simulate_cmd.py

- no major changes in this version, just a first commit
  for branch 'binaries'
[myanalysis] Implement Transformation Method

- Previously, simuate_cmd.py used rejection sampling to produce
  mock samples.

- Have now implemented transformation method by calculating cumulative
  mass distribution, and then finding the inverse from spline interpolation.

- To use rejection, need to specify rejection_sampling = 1 at beginning of module.

- Tested transformation method and added additional diagnostic
  plots: both methods result in the same LFs, so both methods are
  working appropriately.

- Transformation method fails when the cumulative F^-1(M) inverse
  function becomes almost vertical. This happens only when dN/dM's
  slope becomes very very close to zero, as in the case of lognormal
  with a small sigma. For all other cases, when F(M) grows gradually,
  no problem. Hence transform method can work for all cases except
  when testing small sigma_c or fitting likelihood with small sigma_c.
[simulate_cmd.py] Generating binaries given fb

- See more details in research blog.

- simulate_cmd.py now generates a binary star if the kwarg fb is
  passed and is greater than zero. if 'fb' is passed, 'alpha_sec'
  must also be passed

- fb = binary fraction, i.e. fraction of systems for which to
  generate a secondary star, goes from 0.0 to 1.0. We assume
  that fb is a single parameter independent of system metallicity,
  primary mass, system age, etc.

- alpha_sec: The secondary star distribution is produced by rejection
  sampling with a power-law IMF. The power law is of the form:
  dN/dM2 = k M2^-(alpha_sec), so alpha_sec = 2.35 is for an exponent
  of -2.35.

- Mass bounds for secondary.
  mass_max_sec = M1 = mass of primary for a given primary
  mass_min_sec = iso['mass'].min() = minimum isochrone mass.
    !!important: mass_min_sec NOT equal to mass_min for
    creating a distribution of M1. The reason is that in the
    case of rejection sampling, I choose a minimum M1 that is
    significantly lower than the faint magnitude cut-off but
    not typically as faint as the low mass end of the isochrone,
    otherwise too many mock samples have to be created. this is
    moot for transformation method, but in certain cases I will
    still need to use the rejection method (low sigma_c, lognormal imf).

- Note that the secondary mass is computed using rejection sampling, no
  point in doing transformation method for a single star.

- No triple+ systems included in simulation.
[simulate_cmd]: Add more binary diagnostic plots

- Plot three panels when testing == 1 and simulate_cmd
  simulates a non-zero binary fraction.

- Plot 1: distribution of mass ratios for binaries.
- PLot 2: mass distribution for M_1, and separately for M_2.
- PLot 3: scatter plot showing M_1 vs M_2.
test_binary_sampling, first commit

- tests multiple algorithms for creating binary samples,
  including sampling from full imf and sampling secondaries
  from a restricted IMF with M2 < M1.

- plots mass distribution of primaries-only, secondaries-only,
  primaries+secondaries, primaries AND secondaries, and
  binary mass ratio distributions for each type of sampling.

- [to do:] flat secondary distribution has not been tested yet.
plot_dN_dM

- modified to calculate samples using rejection sampling, which
  is easier to modify when testing various binary sampling algorithms,
  albeit slower.
myanalysis

- small changes
main.py: minor change only
lf_parsec_darth

compares LF of Dartmouth and PARSEC isochrones for same set of
IMF parameters.
plot_eda and plot_eda_ferr

- plot output best-fit parameters as a function of number of stars
  in isochrone, limiting magnitude, photometric errors.
remove getenv-HOME refs
Merge branch 'binaries'