nanograv / enterprise_extensions

A set of extension codes, utilities, and scripts for the enterprise PTA analysis framework.
MIT License
27 stars 60 forks source link

Set default values of constants in white_noise_block #226

Open mattpitkin opened 8 months ago

mattpitkin commented 8 months ago

Currently, in the white_noise_block function, if vary=False the efac, equad and ecorr values are set as Constant parameters without a given value for that constant. This means that the constant value will default to None. The docstring suggests that the constant values can be set later, but in a function such as model_singlepsr_noise, if white_vary=False these constants don't get set and subsequent likelihood calls on the returned pta object fail due to the constants returning None.

This PR attempts to fix this by setting some default values for the constants. In this case a value of 1.0 for efac and -inf for both equad and ecorr. This (assuming I understand things correctly!) would mean that the likelihood just uses the TOA errors as given as the standard deviations in the likelihood calculation (without any scaling, additional component, or correlation).

See also https://github.com/nanograv/enterprise/pull/379.

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 37.29%. Comparing base (d91baf2) to head (70f9434).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/226/graphs/tree.svg?width=650&height=150&src=pr&token=HTKG5WS0VZ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv)](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv) ```diff @@ Coverage Diff @@ ## master #226 +/- ## ======================================= Coverage 37.29% 37.29% ======================================= Files 20 20 Lines 3974 3974 ======================================= Hits 1482 1482 Misses 2492 2492 ``` | [Files](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/226?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv) | Coverage Δ | | |---|---|---| | [enterprise\_extensions/blocks.py](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv#diff-ZW50ZXJwcmlzZV9leHRlbnNpb25zL2Jsb2Nrcy5weQ==) | `44.41% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/226?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/226?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv). Last update [d91baf2...70f9434](https://app.codecov.io/gh/nanograv/enterprise_extensions/pull/226?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nanograv).