waqasbhatti / astrobase

Python modules for light curve work and variable star astronomy
MIT License
55 stars 12 forks source link

add timeutils.get_epochs_given_midtimes_and_period #68

Closed lgbouma closed 5 years ago

lgbouma commented 5 years ago

this is a function I'm using enough in O-C analyses to probably merit inclusion in astrobase!

output for some hot jupiter looks like:

[2018-11-17T21:28:33Z - INFO] epochs before rounding
[2018-11-17T21:28:33Z - INFO]
array([-1009.00224837,  -972.00275174,  -781.00255249,  -757.00164922,
        -686.00157302,  -511.00533079,  -509.00129477,  -509.00135769,
        -509.00127939,  -496.0013521 ,  -495.00467641,  -450.99885974,
        -435.00152128,  -435.00132064,  -428.00020764,  -302.0011899 ,
        -302.00126611,  -302.00082286,  -302.00074526,  -265.00076414,
        -265.00129337,  -265.00061732,  -230.00078162,  -230.00161287,
        -226.00287059,  -223.00123534,  -214.0018282 ,  -214.00029643,
        -184.00240078,  -174.99837804,  -160.99881429,     0.        ,
          16.00037333,    30.00010976,    31.99863672,    52.99747338,
          71.99843537,    76.00092144,   303.99839063,   317.99776421,
         496.99977768,   526.99827527,   531.99903032,   538.99931976,
        1039.00062072,  1039.99985442,  1041.00009306,  1041.99979561,
        1043.00142119,  1043.99936648,  1045.00087235,  1046.00055897,
        1046.99952124,  1048.9992327 ,  1050.00039681,  1051.00024242,
        1051.99957449,  1053.00024336,  1053.9992794 ,  1055.00101936,
        1056.00111892,  1056.99956115])
[2018-11-17T21:28:33Z - INFO] epochs after rounding
[2018-11-17T21:28:33Z - INFO]
array([-1009.,  -972.,  -781.,  -757.,  -686.,  -511.,  -509.,  -509.,
        -509.,  -496.,  -495.,  -451.,  -435.,  -435.,  -428.,  -302.,
        -302.,  -302.,  -302.,  -265.,  -265.,  -265.,  -230.,  -230.,
        -226.,  -223.,  -214.,  -214.,  -184.,  -175.,  -161.,     0.,
          16.,    30.,    32.,    53.,    72.,    76.,   304.,   318.,
         497.,   527.,   532.,   539.,  1039.,  1040.,  1041.,  1042.,
        1043.,  1044.,  1045.,  1046.,  1047.,  1049.,  1050.,  1051.,
        1052.,  1053.,  1054.,  1055.,  1056.,  1057.])
lgbouma commented 5 years ago

now ready to merge! sorry for needed bug-fix.

waqasbhatti commented 5 years ago

Merged. Thanks!