diff --git a/modules/icing/moon_phase.py b/modules/icing/moon_phase.py index d5e2c069bd9d17a2d68225b56ac85738c5409679..8251f841f8a9c60846327125a0aeb4efb341580d 100644 --- a/modules/icing/moon_phase.py +++ b/modules/icing/moon_phase.py @@ -32,40 +32,6 @@ def moon_phase(dt_obj_s, phs_deg=50): return (phase.degrees > phs_deg) & (phase.degrees < 360-phs_deg) -# dt_str_0: start datetime string in format YYYY-MM-DD_HH:MM -# num_steps with increment of days, hours, minutes or seconds -# return num_steps+1 lists of datetime strings and timestamps for the times eries -def make_times(dt_str_0, num_steps, days=None, hours=None, minutes=None, seconds=None): - if days is not None: - inc = 86400*days - elif hours is not None: - inc = 3600*hours - elif minutes is not None: - inc = 60*minutes - else: - inc = seconds - - dt_obj_s = [] - ts_s = [] - dto_0 = datetime.datetime.strptime(dt_str_0, '%Y-%m-%d_%H:%M').replace(tzinfo=timezone.utc) - ts_0 = dto_0.timestamp() - - dt_obj_s.append(dto_0) - ts_s.append(ts_0) - dto_last = dto_0 - for k in range(num_steps): - dt_obj = dto_last + datetime.timedelta(seconds=inc) - dt_obj_s.append(dt_obj) - ts_s.append(dt_obj.timestamp()) - dto_last = dt_obj - - return dt_obj_s, ts_s - - -def make_hist(ts_s, edges): - h = np.histogram(ts_s, bins=edges) - return h -