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

Refactoring and Multiprocessing #21

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
3c0fa9c
Add halo_model param description to docstring
lorenzomag Jul 14, 2024
b0fe5f2
Add basic file
lorenzomag Jul 22, 2024
a40921d
Moved Ibe's model
lorenzomag Jul 22, 2024
9ce21df
Added Cox model package at tag
lorenzomag Jul 22, 2024
b851471
Moving submodule
lorenzomag Aug 6, 2024
328478a
Updating import statements
lorenzomag Aug 6, 2024
5ad10fc
Add utility function to preformat data for Cox's interpolators
lorenzomag Aug 6, 2024
ef27b65
Wrapper module to include Cox's package
lorenzomag Aug 6, 2024
28ba5d8
Add docstring to cox_wrapper.py
lorenzomag Aug 6, 2024
6fc1f86
Implemented Peter Cox et al. Migdal model
lorenzomag Aug 6, 2024
e4a5802
Remove debug print statement
lorenzomag Aug 6, 2024
502fa08
Add dockstrings
lorenzomag Aug 6, 2024
6128b40
Update tutorial notebook for Migdal
lorenzomag Aug 6, 2024
8bde989
Remove typing.Self for python3.9
lorenzomag Aug 6, 2024
e0d51d4
Require seaborn
lorenzomag Aug 6, 2024
f8e8684
Add output to notebook
lorenzomag Aug 6, 2024
9e6db2f
Revert "Remove typing.Self for python3.9"
lorenzomag Aug 6, 2024
5b608a5
Revert "Require seaborn"
lorenzomag Aug 6, 2024
e6d05cc
Require Python3.11
lorenzomag Aug 6, 2024
ea47279
Require importlib package for Cox model
lorenzomag Aug 6, 2024
1eed196
Add __init__.py in tests to fix module structure
lorenzomag Aug 6, 2024
853c4f0
Add all content of data/ for build
lorenzomag Aug 6, 2024
c95fdbe
Add deprecation warning for old func
lorenzomag Aug 6, 2024
986937d
Fix typing
lorenzomag Aug 7, 2024
176bf94
Reduce required python3 version to 3.9
lorenzomag Aug 7, 2024
fd9c56e
Update notebook output
lorenzomag Aug 7, 2024
df7d904
Update pytest.yml
lorenzomag Aug 7, 2024
c1d26c0
Update pytest.yml + fix test
lorenzomag Aug 7, 2024
a7c2e0d
Downgrade jinja for pytest.yml
lorenzomag Aug 7, 2024
d2b44da
Update pytest.yml
lorenzomag Aug 7, 2024
180e391
Update pytest.yml
lorenzomag Aug 7, 2024
062f66b
Add j2000 to datetime utility function
lorenzomag Aug 8, 2024
3bf17b6
Add j2000_to_datetime pytest
lorenzomag Aug 8, 2024
1679466
Update pytest.yml
lorenzomag Aug 7, 2024
97fcd25
Update pytest.yml + fix test
lorenzomag Aug 7, 2024
03f61dd
Downgrade jinja for pytest.yml
lorenzomag Aug 7, 2024
f5db5f7
Update pytest.yml
lorenzomag Aug 7, 2024
8866e90
Update pytest.yml
lorenzomag Aug 7, 2024
e5d38ef
Revert "Update pytest.yml"
lorenzomag Aug 8, 2024
c9d9d42
Revert "Update pytest.yml"
lorenzomag Aug 8, 2024
e579c2f
Revert "Downgrade jinja for pytest.yml"
lorenzomag Aug 8, 2024
7859f3e
Revert "Update pytest.yml + fix test"
lorenzomag Aug 8, 2024
687bc5e
Revert "Update pytest.yml"
lorenzomag Aug 8, 2024
834ebea
Merge branch 'j2000_to_datetime'
lorenzomag Aug 8, 2024
8693a69
Merge branch 'update_cicd'
lorenzomag Aug 8, 2024
0aeec68
Add j2000 to datetime utility function
lorenzomag Aug 8, 2024
9088162
Add j2000_to_datetime pytest
lorenzomag Aug 8, 2024
020d015
Add halo_model param description to docstring
lorenzomag Jul 14, 2024
3e4ad01
Add basic file
lorenzomag Jul 22, 2024
393ef75
Moved Ibe's model
lorenzomag Jul 22, 2024
6af8458
Added Cox model package at tag
lorenzomag Jul 22, 2024
453eb5b
Moving submodule
lorenzomag Aug 6, 2024
6254779
Updating import statements
lorenzomag Aug 6, 2024
5dc19ac
Add utility function to preformat data for Cox's interpolators
lorenzomag Aug 6, 2024
c9a703a
Wrapper module to include Cox's package
lorenzomag Aug 6, 2024
331f4b8
Add docstring to cox_wrapper.py
lorenzomag Aug 6, 2024
2050efc
Implemented Peter Cox et al. Migdal model
lorenzomag Aug 6, 2024
0978c49
Remove debug print statement
lorenzomag Aug 6, 2024
d4b33d2
Add dockstrings
lorenzomag Aug 6, 2024
4fcb1bd
Update tutorial notebook for Migdal
lorenzomag Aug 6, 2024
0380e5a
Remove typing.Self for python3.9
lorenzomag Aug 6, 2024
381a30d
Require seaborn
lorenzomag Aug 6, 2024
1113870
Add output to notebook
lorenzomag Aug 6, 2024
28e67a3
Revert "Remove typing.Self for python3.9"
lorenzomag Aug 6, 2024
cc39206
Revert "Require seaborn"
lorenzomag Aug 6, 2024
0b79d66
Require Python3.11
lorenzomag Aug 6, 2024
a0ada21
Require importlib package for Cox model
lorenzomag Aug 6, 2024
426a0ed
Add __init__.py in tests to fix module structure
lorenzomag Aug 6, 2024
7b3fbc9
Add all content of data/ for build
lorenzomag Aug 6, 2024
f59cc33
Add deprecation warning for old func
lorenzomag Aug 6, 2024
fa79a1a
Fix typing
lorenzomag Aug 7, 2024
e69cc84
Reduce required python3 version to 3.9
lorenzomag Aug 7, 2024
65430fa
Update notebook output
lorenzomag Aug 7, 2024
c71e0c6
Revert "Update pytest.yml"
lorenzomag Aug 8, 2024
1714627
Revert "Update pytest.yml"
lorenzomag Aug 8, 2024
07ca8ba
Revert "Downgrade jinja for pytest.yml"
lorenzomag Aug 8, 2024
5955350
Revert "Update pytest.yml + fix test"
lorenzomag Aug 8, 2024
3033247
Revert "Update pytest.yml"
lorenzomag Aug 8, 2024
86d8f2c
Merge branch 'migdal_cox_model' of github.com:lorenzomag/wimprates in…
lorenzomag Aug 9, 2024
5286f6c
Rebase on update_cicd
lorenzomag Aug 9, 2024
a7c985c
Merge branch 'migdal_cox_model'
lorenzomag Aug 11, 2024
b4a8e7c
Merge branch 'j2000_to_datetime'
lorenzomag Aug 11, 2024
fa88982
Merge branch 'j2000_to_datetime' of github.com:lorenzomag/wimprates i…
lorenzomag Aug 11, 2024
9adc858
Merge branch 'j2000_to_datetime'
lorenzomag Aug 11, 2024
ca17367
Merge branch 'JelleAalbers:master' into master
lorenzomag Aug 11, 2024
22e9ffe
Round j2000_to_datetime output to fix pytest
lorenzomag Aug 15, 2024
c071c3b
Reduce precision of j2000_to_datetime return to seconds
lorenzomag Aug 15, 2024
cfbd5de
Ignore notebooks in root dir
lorenzomag Aug 15, 2024
22e70fa
Remove overhead on import
lorenzomag Aug 15, 2024
3ab6231
Implement optional multiprocessing for Migdal
lorenzomag Aug 15, 2024
411bfd6
Make Multiprocessing loop more Pythonic
lorenzomag Aug 15, 2024
a0e4d87
Cache Cox Model instance during runtime
lorenzomag Aug 15, 2024
8e6c595
Add caching functionality to save and load results
lorenzomag Aug 15, 2024
3996166
Round j2000_to_datetime output to fix pytest
lorenzomag Aug 15, 2024
98c52f5
Reduce precision of j2000_to_datetime return to seconds
lorenzomag Aug 15, 2024
c5573f8
Merge branch 'j2000_to_datetime'
lorenzomag Aug 15, 2024
f25c5ff
Remove overhead on import
lorenzomag Aug 15, 2024
e6ac016
Implement optional multiprocessing for Migdal
lorenzomag Aug 15, 2024
8c3e5eb
Make Multiprocessing loop more Pythonic
lorenzomag Aug 15, 2024
bfa4394
Cache Cox Model instance during runtime
lorenzomag Aug 15, 2024
623ed89
Add caching functionality to save and load results
lorenzomag Aug 15, 2024
1d7ab55
Merge branch 'optimisation' of github.com:lorenzomag/wimprates into o…
lorenzomag Aug 15, 2024
0034cb4
Update Notebook + remove redundant arg in Cox interpolator
lorenzomag Oct 8, 2024
62e11e9
Add figure needed for notebook tutorial
lorenzomag Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add j2000 to datetime utility function
lorenzomag committed Aug 9, 2024
commit 0aeec6830cc6f045d55a28dc9879e35c9453496c
11 changes: 11 additions & 0 deletions wimprates/halo.py
Original file line number Diff line number Diff line change
@@ -67,6 +67,17 @@ def j2000_from_ymd(year, month, day_of_month):
+ np.floor(30.61 * (m + 1))
+ day_of_month - 730563.5)

@export
def j2000_to_datetime(j2000_date):
"""
Returns date in np.datetime64 instance from the fractional number of days since J2000.0 epoch.
It is effectively the inverse of the j2000 function.
"""
zero_value = pd.to_datetime("2000-01-01T12:00").value

nanoseconds_per_day = nu.day / nu.ns
_date = pd.to_datetime(j2000_date * nanoseconds_per_day).value
return pd.to_datetime(_date + zero_value)

@export
def earth_velocity(t, v_0 = None):