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

Refine/revamp hydro mass profile product #1275

Merged
merged 85 commits into from
Nov 22, 2024

Commits on Nov 19, 2024

  1. Began the creation of the revamped hydrostatic mass profile - essenti…

    …ally will be a carbon copy of how the entropy profile works (I revamped that some months ago). The init is simply copied over, and no other methods are currently present (class is named NewHydrostaticMass for now, so I can easily look at the old one).
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    6707bf9 View commit details
    Browse the repository at this point in the history
  2. Building out the bones of the revamped hydrostatic mass profile - als…

    …o improved some docstrings in the SpecificEntropy profile class.
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    9e3cb44 View commit details
    Browse the repository at this point in the history
  3. Swept through the hydro mass profile class and mildly improved some d…

    …ocstrings and type hints.
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    4da4ed4 View commit details
    Browse the repository at this point in the history
  4. Starting to get the new hydrostatic mass profile to full functionalit…

    …y - the first part of the 'mass' method is essentially the same as the entropy method of SpecificEntropy, handling all the different ways we can get density and temperature information. The next part thing need to is implement derivative calculation, then add the actual hydrostatic mass calculation (making sure to support radius uncertainties like the old one did). For issue #1260
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    2dc01c8 View commit details
    Browse the repository at this point in the history
  5. Hopefully set up the radius distribution creation in the mass method …

    …of the revamped hydrostatic mass profile. For issue #1260
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    fe06a33 View commit details
    Browse the repository at this point in the history
  6. Missed some bits to convert to mass (rather than the original entropy…

    … setup) in the new hydro mass profile init. Also improved over the original, as apparently for the mass profile values the radius uncertainties were not being passed. For issue #1260
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    9b60704 View commit details
    Browse the repository at this point in the history
  7. Working through the mass method the new hydro mass class, slowly incl…

    …uding radii errors - have added it to the density model realisation approach (as it was in the original hydrostatic mass profile calculation). For issue #1260
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    7d400e3 View commit details
    Browse the repository at this point in the history
  8. The density interpolating option in the new hydro mass class 'mass()'…

    … method should now use the radius distribution rather than a single value. For issue #1260
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    91c144b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5e9b800 View commit details
    Browse the repository at this point in the history
  10. Added density derivative calculation back into the new hydro mass pro…

    …file calculations - only for the smooth model mode currently. For issue #1260
    DavidT3 committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    9cddd3e View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. Trying to use the numerical gradient measurement from numpy to measur…

    …e the density gradient from non-interpolated data points in the new hydro mass setup. For issue #1260
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    d68c7a5 View commit details
    Browse the repository at this point in the history
  2. Now trying to use the interpolated density profile data to numericall…

    …y determine the density gradient. For issue #1260
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    a531414 View commit details
    Browse the repository at this point in the history
  3. Still trying to make numerical differentiation of data points work fo…

    …r the new mass profile calculation
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    21508c2 View commit details
    Browse the repository at this point in the history
  4. Bodging in the temperature derivatives now (apart from the no-interpo…

    …lation but mismatched bins scenario) for the new hydrostatic mass calculation. For issue #1260
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    eafcd5f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    edbbc42 View commit details
    Browse the repository at this point in the history
  6. Need to make sure that temperature is in Kelvin rather than keV - was…

    … the opposite to the entropy calculation as we tend to use keV for that, so the conversion I copied over was going the wrong way around. For issue #1260
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    6d2f35c View commit details
    Browse the repository at this point in the history
  7. Was trying to convert the temperature gradient to Kelvin rather than …

    …K/{insert distance unit}... think I might be tired. For issue #1260
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    3defee4 View commit details
    Browse the repository at this point in the history
  8. Figuring out why there is a shape mismatch between the mass distribut…

    …ion array and the radii array (could well be a matrix transpose that I removed earlier - added it back in to test). For issue #1260
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    05c7e93 View commit details
    Browse the repository at this point in the history
  9. Added an 'allow_unphysical' flag to the declaration of the new mass p…

    …rofile class - means no error will be raised if negative mass is measured. Indirectly for issue #1260 (will now do the same for entropy whilst I think about it).
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    ae110a4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2593f2e View commit details
    Browse the repository at this point in the history
  11. Changed the BaseAggregateProfile init to just check that the x and y …

    …units are the same, rather than explicitly look at the Python instance type. For issue #1260
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    cf8e060 View commit details
    Browse the repository at this point in the history
  12. Added a basic XGA-model implementation of the NFW profile (integrated…

    … for cumulative mass rather than mass density) - this will be useful for fitting hydrostatic mass profiles. For issue #1260 (sort of)
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    9a13f6e View commit details
    Browse the repository at this point in the history
  13. Made sure to add the new mass model section of XGA models to the dict…

    …ionaries which let profiles look up what models they are allowed to be fit with. For issue #1260 (sort of)
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    786b0ca View commit details
    Browse the repository at this point in the history
  14. Corrected a small mistake in the NFW mass model - had a dimensionless…

    … prior in there when there should not have been. For issue #1260 (sort of)
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    5664985 View commit details
    Browse the repository at this point in the history
  15. The 'nice' parameter name for the NFW density parameter had the \rho …

    …latex code outside of a math environment so it didn't render properly.
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    15c94b4 View commit details
    Browse the repository at this point in the history
  16. Don't know that the NFW model units are working like I thought they w…

    …ould. Putting in a stupid test
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    76a2e7f View commit details
    Browse the repository at this point in the history
  17. Don't know that the NFW model units are working like I thought they w…

    …ould. Putting in a stupid test
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    d572f3a View commit details
    Browse the repository at this point in the history
  18. Don't know that the NFW model units are working like I thought they w…

    …ould. Putting in a stupid test
    DavidT3 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    960751b View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    176e923 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    d7cb341 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2024

  1. Changing the start parameters and priors for NFW to the msun/kpc^3 un…

    …it - this really shouldn't matter and clearly I need to fix how models deal with units. Really just want a fit working though, for issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    1721844 View commit details
    Browse the repository at this point in the history
  2. Trying something for the new hydrostatic mass profile measurements - …

    …setting any value in the mass distribution less than zero to be NaN. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    6337fa4 View commit details
    Browse the repository at this point in the history
  3. That went fairly badly - #1260

    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    3ac7a9f View commit details
    Browse the repository at this point in the history
  4. Fixed a docstring typo

    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    590e994 View commit details
    Browse the repository at this point in the history
  5. Attempting to understand what is going on with profile fitting and pa…

    …rameter units. There are dimensionless parameters used in the fitting process - as I assume using quantities was causing problems when I developed it, but how then am I gonna solve the problem of the model prediction being in the wrong unit to compare to the data?
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    a017962 View commit details
    Browse the repository at this point in the history
  6. I am attempting to address this problem completely by ensuring that t…

    …he data of a profile are converted to the current output unit of the model. For issue #1267
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    5955d16 View commit details
    Browse the repository at this point in the history
  7. Returning the NFW profile to the original start parameters and priors…

    … that were causing problems, to see if the fix works. For issue #1267 (and indirectly for issue #1260)
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    80b116d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8e4b130 View commit details
    Browse the repository at this point in the history
  9. still nope, think perhaps because the NLLS fit is doing the same sort…

    … of thing as emcee. For issue #1267
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    1c5a0a1 View commit details
    Browse the repository at this point in the history
  10. Converting the data for regression in the emcee and nlls fit methods …

    …of BaseProfile1D to what I FINALLY HOPE is the right unit. For issue #1267
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    dd422ef View commit details
    Browse the repository at this point in the history
  11. I swear I'm not doing this on purpose... I was passing the start para…

    …meters incorrectly to the model to get the raw output unit. (by the way, beforehand I was actually using the model self call method, which actually auto-converts the output to the set unit of the model, so wasn't helping us here). For issue #1267
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    4b63a26 View commit details
    Browse the repository at this point in the history
  12. Make sure to convert the output from a model's get_realisations metho…

    …d to the specified y unit of the model. For issue #1267
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    5c8ee21 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8b0cb40 View commit details
    Browse the repository at this point in the history
  14. nevermind - anyway just need to add the last derivatives of temperatu…

    …re and density. These are for the cases where there are more radii points for the mass profile than there are radii or density, and no interpolation. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    ae93196 View commit details
    Browse the repository at this point in the history
  15. Added first attempt at temp/dens gradient for temp/dens profiles with…

    … mismatched radii and interpolation turned off (in the new hydrostatic mass profile implementation). For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    b9a2294 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    49241bf View commit details
    Browse the repository at this point in the history
  17. Ridiculous amount of matrix transposing going on to make numerical de…

    …rivates work on the non-interpolation case. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    4d05376 View commit details
    Browse the repository at this point in the history
  18. May have been using the wrong radii values for numerical derivative o…

    …f temp and dens non-interpolation mode in the new hydro mass implementation. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    10b1e5c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e6a7464 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    a78e3fe View commit details
    Browse the repository at this point in the history
  21. Hopefully made the getdist corner plots in the BaseProfile method inc…

    …lude the unit in the labels. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    89394c7 View commit details
    Browse the repository at this point in the history
  22. Making getdist axis labels in BaseProfile include the nicely rendered…

    … unit in a square bracket. For issue #1260 indirectly.
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    477eb71 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    818edd4 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    160dab2 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    189b2dd View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    de4c655 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    a409f65 View commit details
    Browse the repository at this point in the history
  28. Attempting an improvement to the par_dist_view method of BaseModel so…

    … that it provides a label of the value/error on each parameter.
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    00912d9 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    c483a7a View commit details
    Browse the repository at this point in the history
  30. Hopefully make big long numbers in the labels of the par_dist_view me…

    …thod be formatted more nicely.
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    4d48231 View commit details
    Browse the repository at this point in the history
  31. Hopefully make big long numbers in the labels of the par_dist_view me…

    …thod be formatted EVEN more nicely.
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    8494c78 View commit details
    Browse the repository at this point in the history
  32. Corrected a label latex error I added in the view_mass_dist method of…

    … the new hydro mass profile class. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    34a56f9 View commit details
    Browse the repository at this point in the history
  33. Working to make the new hydro mass profile class 'mass' method actual…

    …ly measure masses at custom radii properly. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    268b031 View commit details
    Browse the repository at this point in the history
  34. Maybe made sure that the mass() method of the new hydrostatic mass pr…

    …ofile class can calculate distributions for a single radius input. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    59d171d View commit details
    Browse the repository at this point in the history
  35. Maybe made sure that the mass() method of the new hydrostatic mass pr…

    …ofile class can calculate distributions for a single radius input. SECOND ATTEMPT. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    8d9f92e View commit details
    Browse the repository at this point in the history
  36. Still messing around getting the custom radius interpolated-data-poin…

    …t-method mass measurement working. For issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    7562aee View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    140371a View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    e092061 View commit details
    Browse the repository at this point in the history
  39. Transposing will save me

    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    eabd87c View commit details
    Browse the repository at this point in the history
  40. Transposing has not saved me

    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    99b171e View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    cb13442 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    fea3855 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    630db4d View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    34db680 View commit details
    Browse the repository at this point in the history
  45. Things seem to be working now - but the temp and dens der are the wro…

    …ng way around axis wise
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    aa5875c View commit details
    Browse the repository at this point in the history
  46. Added an error to rad_check so that no-one can try to extrapolate dat…

    …a-point-driven mass profiles. Indirectly for issue #1260
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    03ca704 View commit details
    Browse the repository at this point in the history
  47. Added a not implemented error to the gas density profile mass calcula…

    …tor to say that we can't yet calculate mass without a fitted model (though will add that). For issue #1271 (and indirectly #1260)
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    4324c7e View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    5180a86 View commit details
    Browse the repository at this point in the history
  49. Altering the baryon_fraction_profile method of new hydro mass so that…

    … it can take custom radii (though radii 'errs' aren't working yet).
    DavidT3 committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    25f1574 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2024

  1. Added a remove_model_fit method to BaseProfile1D. Indirectly for issue

    …#1260, to let the new hydro mass profile refit a model if the number of samples doesn't match that specified in the init
    DavidT3 committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    1c2a8c7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7c55de2 View commit details
    Browse the repository at this point in the history
  3. Think that maybe models will be refit if mismatching number of sample…

    …s is found when declaring a mass profile now. For issue #1260
    DavidT3 committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    1b6dcb7 View commit details
    Browse the repository at this point in the history
  4. The model refitting in new hydro mass profile didn't work because the…

    … models can either be strings or model instances. Indirectly for issue #1260
    DavidT3 committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    6211a01 View commit details
    Browse the repository at this point in the history
  5. The model refitting in new hydro mass profile didn't work because the…

    … models can either be strings or model instances. Indirectly for issue #1260
    DavidT3 committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    e17aee0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4a1a25b View commit details
    Browse the repository at this point in the history