Skip to main content

This is a package that keeps all the Machine learning Utils in the Software Team.

Project description

SARAO Machine Learning Utility functions

Machine Learning utils is a library for a convenient experience. It consists of helper functions for creating astronomy/machine learning tools.

Installation

pip install katmlutils

Example 1

from katmlutils.utils import get_night_window
from datetime import datetime

# Get the night window for the proposed date
nightwindow = get_night_window(datetime.datetime.now())

nightwindow

Example 2

from katmlutils.utils import get_UTC_sunrise_sunset_times
from datetime import datetime

date = datetime.today()

num_days = 7
sunrise_sunset_times = get_UTC_sunrise_sunset_times(date, num_days)
for entry in sunrise_sunset_times:
    print(
        f"Date: {entry['date']}, Sunrise: {entry['sunrise']}, Sunset: {entry['sunset']}"
    )

Example 3

from katmlutils.utils import SKA_LATITUDE, SKA_LONGITUDE, MINUTES_IN_SIDEREAL_DAY, MINUTES_IN_SOLAR_DAY

print(f"SKA Latitude: {SKA_LATITUDE} degrees")
print(f"SKA Longitude: {SKA_LONGITUDE} degrees") 
print(f"Minutes in Sidereal Day: {MINUTES_IN_SIDEREAL_DAY}")
print(f"Minutes in Solar Day: {MINUTES_IN_SOLAR_DAY}")

Example 4

from katmlutils.utils import SKA_LONGITUDE, lst_to_utc
from datetime import datetime

date = datetime.now()

# Example Usage of lst_to_utc function with float input
lst_time = 1 + 59 / 60 + 0 / 3600
utc_time = lst_to_utc(date, lst_time, SKA_LONGITUDE)
print(f"UTC Time: {int(utc_time)}:{int((utc_time % 1) * 60):02}")

# Example Usage of lst_to_utc function with time input
lst_time = time(12, 30, 45)
utc_time = lst_to_utc(date, lst_time, SKA_LONGITUDE)
print(f"UTC Time: {utc_time}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

katmlutils-0.0.9.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

katmlutils-0.0.9-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file katmlutils-0.0.9.tar.gz.

File metadata

  • Download URL: katmlutils-0.0.9.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for katmlutils-0.0.9.tar.gz
Algorithm Hash digest
SHA256 632514488c53f4d0ec8839d3a33dfdbff64dcad8e2e5c10ad7e77c3c8d2db6d0
MD5 c14c57378fd107e3779fa3cf25e2b1cb
BLAKE2b-256 0b81c8710eff8f8652ceaefea1c8a3ad5242c1fff2ba191ecf0a25ce364323ee

See more details on using hashes here.

File details

Details for the file katmlutils-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: katmlutils-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for katmlutils-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7c0252b9ec7ba497cf5101462d6db5e458b3b263b8ecc718f9d4e7c500ff8483
MD5 80676432a15b74a9ffafb0a91c43f221
BLAKE2b-256 854d7d30d52bd72df0fd3bf052138c1832f6cc8bb992e5e9fd7306ce376ee28c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page