Skip to main content

methods to translate Python datetime between solar apparent time and Coordinate Universal Time (UTC)

Project description

solar-apparent-time Python Package

The solar-apparent-time Python package translates Python datetime between solar apparent time and Coordinate Universal Time (UTC).

Gregory H. Halverson (they/them)
gregory.h.halverson@jpl.nasa.gov
NASA Jet Propulsion Laboratory 329G

Installation

This package is available on PyPi as a pip package called solar-apparent-time with dashes.

Usage

Importing

Import this package as solar_apparent_time with under-scores.

import solar_apparent_time

UTC_to_solar(time_UTC: datetime, lon: float) -> datetime

Converts Coordinated Universal Time (UTC) to solar apparent time at given longitude for single time.

Parameters:

  • time_UTC (datetime): The UTC time.
  • lon (float): The longitude in degrees.

Returns:

  • datetime: The solar time at the given longitude.

solar_to_UTC(time_solar: datetime, lon: float) -> datetime

Converts solar apparent time to Coordinated Universal Time (UTC) at given longitude for single time.

Parameters:

  • time_solar (datetime): The solar time.
  • lon (float): The longitude in degrees.

Returns:

  • datetime: The UTC time at the given longitude.

UTC_offset_hours_for_area(geometry: rasters.RasterGeometry) -> rasters.Raster

Calculates the UTC offset in hours for an area defined by a RasterGeometry object from the rasters package.

Parameters:

  • geometry (rasters.RasterGeometry): The raster geometry.

Returns:

  • rasters.Raster: The UTC offset in hours.

solar_day_of_year_for_area(time_UTC: datetime, geometry: rasters.RasterGeometry) -> rasters.Raster

Calculates the day of the year for a given UTC time and an area defined by a RasterGeometry object from the rasters package.

Parameters:

  • time_UTC (datetime): The UTC time.
  • geometry (rasters.RasterGeometry): The raster geometry.

Returns:

  • rasters.Raster: The day of the year.

solar_hour_of_day_for_area(time_UTC: datetime, geometry: rasters.RasterGeometry) -> rasters.Raster

Calculates the hour of the day for a given UTC time and an area defined by a RasterGeometry object from the rasters package.

Parameters:

  • time_UTC (datetime): The UTC time.
  • geometry (rasters.RasterGeometry): The raster geometry.

Returns:

  • rasters.Raster: The hour of the day.

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

solar_apparent_time-1.4.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

solar_apparent_time-1.4.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file solar_apparent_time-1.4.0.tar.gz.

File metadata

  • Download URL: solar_apparent_time-1.4.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for solar_apparent_time-1.4.0.tar.gz
Algorithm Hash digest
SHA256 0d86d52ac7cc877416969f53b04b8efe42d0b398f7a44787053e8349fb562ead
MD5 9a81626e833e2c5c5a10e9c83a8b7700
BLAKE2b-256 431b42d3de47961c46c7a513a30facf0cb709fe147061937824ed74096c96f4f

See more details on using hashes here.

File details

Details for the file solar_apparent_time-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for solar_apparent_time-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a25bfc96eb831151bbddd46a8eeed5f2f60bfd0cf07abf598d766df056c26d3
MD5 a5ae514979dcbb25bb8b4e0a35c68afc
BLAKE2b-256 29d44e89b0ee2a476184e85e282f34ebe44b3402a9b7237203782b3148f3ee6c

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