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.5.3.tar.gz (11.7 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.5.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: solar_apparent_time-1.5.3.tar.gz
  • Upload date:
  • Size: 11.7 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.5.3.tar.gz
Algorithm Hash digest
SHA256 057c3b2ee8cdc7114aa248e8a6e62776576297cab1d51187fe79cb66ddec55fd
MD5 50f22e4bcb7b16f42f0958fe024d31a8
BLAKE2b-256 fb36d8bb5c7adb7b9ba9d210aec69ff00de6419138cfbc04191cc57954083b75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solar_apparent_time-1.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 342acc376bb352958699d498125ef5a25d24967135db5f6a972db6f7de6609dd
MD5 aa6978439cbb44a9e1f91459442474ca
BLAKE2b-256 5bfecb70d4558fa41d15343f9267fcafba350789c389c3671bac651669168c64

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