Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emissivity compiling and loading. #62

Merged
merged 74 commits into from
Oct 6, 2020
Merged

Commits on Jun 2, 2020

  1. Created CSP archistecture and basic sfh class

    The complex stellar population subpackage is meant to combine bpass 
    variables with a stelalr formation history to generate more complex 
    populations. To this end, we're implementing a stellar formation history 
    class. The basic SFH class for custom SFH is implemented using scipy 
    splines. This basic class is also tested.
    maxbriel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    4100544 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2020

  1. Configuration menu
    Copy the full SHA
    f2d0f86 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6828272 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3cc2a5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    29a8d1e View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2020

  1. Adds at_time function to the event rate class

    This method allows for the calculation of the event rate at a given lookback time. It uses the BPASS binning for this. 
    
    This method is much faster, but suffers from a lack of accuracy.
    maxbriel committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    95c6cb0 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2020

  1. Configuration menu
    Copy the full SHA
    536b6b9 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2020

  1. Implements calculate spectrum at_time and over_time functions

    Both functions are implemented for the BPASS spectra. 
    However, the method is similar to the BPASS event rate calculation, which is sub optimal for the spectra calculation. It takes an extremely long time to do the calculation. A for loop of 100000 iterations is present, because each wavelength is seen as it's own "event type". It should be possible to remove this by implementing a function to take the separate wavelengths as a single unit. It would be interesting so see the influence of putting the for loop within a numba function, but thinking about restructuring the function is probably better. 
    
    Including a "caching" of the BPASS spectra into a pickled DataFrame. 
    
    
    
    Additional test files are required for this to run.
    maxbriel committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    9e95635 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f22c615 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2020

  1. fixed hrd plot

    HeloiseS committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    e1bf600 View commit details
    Browse the repository at this point in the history
  2. adding csp folder

    HeloiseS committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    070282b View commit details
    Browse the repository at this point in the history
  3. fixed merge conflict

    HeloiseS committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    a881b36 View commit details
    Browse the repository at this point in the history
  4. minor changes

    HeloiseS committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    dfb88cb View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2020

  1. Configuration menu
    Copy the full SHA
    9d4d49d View commit details
    Browse the repository at this point in the history
  2. added a hokitype error

    HeloiseS committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    5c1fb9a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    276c1de View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d2f93d9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    71f3604 View commit details
    Browse the repository at this point in the history
  6. Updated the tests

    maxbriel committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    36bd68b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6475bbd View commit details
    Browse the repository at this point in the history
  8. bla

    HeloiseS committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    760144d View commit details
    Browse the repository at this point in the history
  9. Adjust tests and docstrings

    maxbriel committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    551b8e7 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2020

  1. Adjust eventrate functions to take lists of functions

    Instead of requiring a scipy interpolated spline as input. These functions now take a list of functions as input for the stellar formation and metallicity history. 
    
    This adjustment has been made by using `numpy.interp` instead of scipy.interpolate. Furthermore, instead of scipy's spline integration `numpy.trapz` is now used to calculate the mass per bin.
    maxbriel committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    14d7f4b View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2020

  1. fix merge comflict

    HeloiseS committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    810f560 View commit details
    Browse the repository at this point in the history
  2. Disabled spectra test

    maxbriel committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    41f4f9a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cb1f7b8 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2020

  1. Configuration menu
    Copy the full SHA
    ee720e2 View commit details
    Browse the repository at this point in the history
  2. fixing CI

    HeloiseS committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    fa26ff5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    02f820a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    23893b5 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2020

  1. upload files for remote work

    maxbriel committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    666b351 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2020

  1. Improve testing and functions

    - Adds BPASS IMFS to the constants
    - Adds check to BPASS IMFS
    - Adds test for `data_compiler.SpectraData`
    - Reduces data usage for rate tests
    maxbriel committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    4bc4c20 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2020

  1. Add SpectraCompiler test

    Uses `unittest.mock` to allow for a smaller DataFrame to be used.
    maxbriel committed Jun 26, 2020
    Configuration menu
    Copy the full SHA
    224af19 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9520ebd View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2020

  1. Update SpectraCompiler

    The compiler now outputs the BPASS spectra as a 3D `numpy.ndarray` this minimises storage and allows for faster and less memory hungry operations than the MultiIndex pandas DataFrame. 
    
    The tests are updated accordingly and using unittest.mock a single spectra file is use. (This could be simulated too)
    maxbriel committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    9e0c487 View commit details
    Browse the repository at this point in the history
  2. Documentation update + SFH input

    The documentation now shows the size and shape of each input and output variable. 
    
    The `_over_time` and `_at_time` for `CSPSpectra` and `CSPEventRate` are now able to take the `SFH` object as an input.
    maxbriel committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    81ba83f View commit details
    Browse the repository at this point in the history
  3. Removed CSP from utils due to cyclical import

    The CSP class in `utils` was importing the SFH class, which was importing the `utils` module. Therefore, failing importing. Thus, the CSP class has been moved to a separate file
    maxbriel committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    cbd3a89 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2020

  1. Configuration menu
    Copy the full SHA
    2b08f82 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a81f7d View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. Configuration menu
    Copy the full SHA
    1dad9b4 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2020

  1. Configuration menu
    Copy the full SHA
    9a7429f View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2020

  1. at_time new default sample rate + load functions moved to hoki.load

    at_time now uses 1000 as the default sample rate. 
    The BPASS bins can still be used is a negative number is given. 
    The `load_spectra` and `load_rates` have been moved to `hoki.load` and renamed to `all_spectra` and `all_rates`, respectively.
    tests have been adjusted accordingly
    maxbriel committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    1d22aef View commit details
    Browse the repository at this point in the history
  2. Fixed typo

    maxbriel committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    67cc7c7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cd64e00 View commit details
    Browse the repository at this point in the history
  4. Removes cyclical import

    maxbriel committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    2a41a9a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7085eb4 View commit details
    Browse the repository at this point in the history
  6. Getting tox to work

    maxbriel committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    dca1a03 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2020

  1. private optimised mass_per_time_bin calculation

    Implements 2 new functions:
    - A custom numba trapezoidal function
    - A optimised mass_per_bin function for non-function-based data
    maxbriel committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    ece0273 View commit details
    Browse the repository at this point in the history
  2. Refactored Event Rate calculation from array data

    The original event rate calculation took functions as in input. This becomes cumbersome when you have data at specific time values. This calculation is done by taking a 2D matrix with time points on one axis and BPASS metallicities on the other. The values of the matrix describes the SFR at that moment in time. 
    
    The calculate_rate_over_time function has been adjusted to use this new function.
    maxbriel committed Jul 31, 2020
    Configuration menu
    Copy the full SHA
    bccb99f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bed60cf View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2020

  1. Configuration menu
    Copy the full SHA
    285c508 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a8d6d72 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2020

  1. Merge pull request HeloiseS#58 from findesgh/csp

    Small bugfix in `all_spectra`
    The binary `kwarg` was not passed on to `SpectraCompiler` from `load.all_spectra`.
    maxbriel committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    94b8534 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2020

  1. Fix SpectraCompiler

    maxbriel committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    31031b9 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2020

  1. BUG: use np instead of pd in SpectraCompiler.

    Martin Glatzle committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    6bc3f73 View commit details
    Browse the repository at this point in the history
  2. BUG: fix index and make test pass.

    Martin Glatzle committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    7a54cdf View commit details
    Browse the repository at this point in the history
  3. BUG: fix another regression bug.

    Martin Glatzle committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    1e9556e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0edb23e View commit details
    Browse the repository at this point in the history
  5. Fix further regression bug.

    Martin Glatzle committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    4ec8dab View commit details
    Browse the repository at this point in the history
  6. Clean up loading module

    maxbriel committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    0a2e307 View commit details
    Browse the repository at this point in the history
  7. Updates mass per bin calculation for vectorized funciton input

    mass_per_bin now takes a normal python callable and a vectorized function as input. 
    The latter boosts performance significantly
    maxbriel committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    bdba1cb View commit details
    Browse the repository at this point in the history
  8. Renames CSPEventRate functions and adds grid functions

    - CSPEventRate functions are now called:
        - calculate_rate_over_time -> over_time
        - calculate_rate_at_time -> at_time
    new functions: 
        - grid_over_time: calculates the rates from a 2D SFH (per BPASS metallicity) from  time_points to time bins
         - grid_at_time: calculate the event rate at a specific moment in lookback time from a 2D SFH grid
    maxbriel committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    be7b9fa View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f9a5a10 View commit details
    Browse the repository at this point in the history
  10. Merge pull request HeloiseS#60 from findesgh/csp_fix2

    * BUG: use np instead of pd in SpectraCompiler.
    * BUG: fix index and make test pass.
    * BUG: fix another regression bug.
    * Fix further regression bug.
    
    Authored-by: Martin Glatzle <mglatzle@mpa-garching.mpg.de>
    maxbriel committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    30485f5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0c74851 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2020

  1. Configuration menu
    Copy the full SHA
    498a3ed View commit details
    Browse the repository at this point in the history
  2. Set default sample rate for at_time

    Also includes some docstring updates
    maxbriel committed Aug 29, 2020
    Configuration menu
    Copy the full SHA
    ad2bc98 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f727fd7 View commit details
    Browse the repository at this point in the history
  4. Adds grid functions for the spectra calculation

    CSPSpectra now has the following functions: 
    Public: 
    - at_time: at time with function input
    - over_time: over lb time with function input
    - grid_at_time: at time with SFH grid input
    - grid_over_time: over lb time with SFH grid input
    Private: 
    - grid_rate_calculator_at_time
    - grid_rate_calculator_over_time
    
    The grid_rate_calculators_* are numba functions that  have the grid_* around them as wrappers for the input and output
    maxbriel committed Aug 29, 2020
    Configuration menu
    Copy the full SHA
    466efab View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2020

  1. Configuration menu
    Copy the full SHA
    6e81cc0 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2020

  1. Emissivity compiling and loading.

    Martin Glatzle committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    2a6c95f View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2020

  1. Rename func, add existence of metallicity files, remove try/except

    Try/except has been replace by a if/else with a file check.
    maxbriel committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    6c883e1 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2020

  1. Configuration menu
    Copy the full SHA
    0c8e094 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a1187cd View commit details
    Browse the repository at this point in the history