{"id":15687177,"url":"https://github.com/jepler/wwvbpy","last_synced_at":"2025-04-30T07:22:30.839Z","repository":{"id":16993776,"uuid":"77753953","full_name":"jepler/wwvbpy","owner":"jepler","description":"Generate WWVB timecodes for any desired time","archived":false,"fork":false,"pushed_at":"2025-04-28T20:23:30.000Z","size":625,"stargazers_count":10,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-28T21:37:17.943Z","etag":null,"topics":["hacktoberfest","python","wwvb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jepler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-31T19:47:18.000Z","updated_at":"2025-04-24T16:35:19.000Z","dependencies_parsed_at":"2023-12-02T11:22:57.640Z","dependency_job_id":"a3a7bb25-eb19-4f16-9099-7e7a986d37be","html_url":"https://github.com/jepler/wwvbpy","commit_stats":{"total_commits":447,"total_committers":5,"mean_commits":89.4,"dds":0.29082774049217,"last_synced_commit":"d7a8dbb6dbd0150d2eee89850a1ed7c8bc14855f"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jepler%2Fwwvbpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jepler%2Fwwvbpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jepler%2Fwwvbpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jepler%2Fwwvbpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jepler","download_url":"https://codeload.github.com/jepler/wwvbpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251395877,"owners_count":21582944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","python","wwvb"],"created_at":"2024-10-03T17:44:37.368Z","updated_at":"2025-04-30T07:22:30.813Z","avatar_url":"https://github.com/jepler.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2021-2024 Jeff Epler\n\nSPDX-License-Identifier: GPL-3.0-only\n--\u003e\n[![Test wwvbgen](https://github.com/jepler/wwvbpy/actions/workflows/test.yml/badge.svg)](https://github.com/jepler/wwvbpy/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/jepler/wwvbpy/branch/main/graph/badge.svg?token=Exx0c3Gp65)](https://codecov.io/gh/jepler/wwvbpy)\n[![Update DUT1 data](https://github.com/jepler/wwvbpy/actions/workflows/cron.yml/badge.svg)](https://github.com/jepler/wwvbpy/actions/workflows/cron.yml)\n[![PyPI](https://img.shields.io/pypi/v/wwvb)](https://pypi.org/project/wwvb)\n[![CodeQL](https://github.com/jepler/wwvbpy/actions/workflows/codeql.yml/badge.svg)](https://github.com/jepler/wwvbpy/actions/workflows/codeql.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/jepler/wwvbpy/main.svg)](https://results.pre-commit.ci/latest/github/jepler/wwvbpy/main)\n\n# Purpose\n\nwwvbpy generates WWVB timecodes for any desired time.  These timecodes\nmay be useful in testing WWVB decoder software.\n\nWhere possible, wwvbpy uses existing facilities for calendar and time\nmanipulation (datetime and dateutil).\n\nIt uses DUT1/leap second data derived from IERS Bulletin \"A\" and from NIST's\n\"Leap second and UT1-UTC information\" page.  With regular updates to\nthe \"iersdata\", wwvbpy should be able to correctly encode the time anywhere\nwithin the 100-year WWVB epoch.  (yes, WWVB uses a 2-digit year! In order to\nwork with historical data, the epoch is arbitrarily assumed to run from 1970 to\n2069.)\n\nPrograms include:\n * `wwvbgen`, the main commandline generator program\n * `wwvbdecode`, the main commandline decoder program\n * `wwvbtk`, visualize the simulated WWVB signal in real-time using Tkinter\n * `dut1table`, print the full history of dut1 values, including estimated future values\n * `updateiers`, download the latest dut1 data including prospective data from IERS and NIST\n\nThe package includes:\n * `wwvb`, for generating WWVB timecodes\n * `wwvb.decode`, a generator-based state machine for decoding WWVB timecodes (amplitude modulation only)\n * `uwwvb`, a version of the decoder intended for use on constrained environments such as [CircuitPython](https://circuitpython.org).\n\n# Development status\n\nThe author (@jepler) occasionally develops and maintains this project, but\nissues are not likely to be acted on.  They would be interested in adding\nco-maintainer(s).\n\n\n# WWVB Timecodes\n\nThe National Institute of Standards and Technology operates the WWVB time\nsignal service near Fort Collins, Colorado.  The signal can be received in most\nof the continental US.  Each minute, the signal transmits the current time,\nincluding information about leap years, daylight saving time, and leap seconds.\nThe signal is composed of an amplitude channel and a phase modulation channel.\n\nThe amplitude channel can be visualized as a sequence of (usually) 60 symbols,\nwhich by default wwvbgen displays as 0, 1, or 2.  The 0s and 1s encode\ninformation like the current day of the year, while the 2s appear in fixed\nlocations to allow a receiver to determine the start of a minute.\n\nThe phase channel (which is displayed with `--channel=phase` or\n`--channel=both`) consists of the same number of symbols per minute.  This\nchannel is substantially more complicated than the phase channel.  It encodes\nthe current time as minute-of-the-century, provides extended DST information,\nand includes error-correction information not available in the amplitude\nchannel.\n\n# Usage\n\n~~~~\nUsage: python -m wwvb.gen [OPTIONS] [TIMESPEC]...\n\n  Generate WWVB timecodes\n\n  TIMESPEC: one of \"year yday hour minute\" or \"year month day hour minute\", or\n  else the current minute\n\nOptions:\n  -i, --iers / -I, --no-iers      Whether to use IESR data for DUT1 and LS.\n                                  (Default: --iers)\n  -s, --leap-second               Force a positive leap second at the end of\n                                  the GMT month (Implies --no-iers)\n  -n, --negative-leap-second      Force a negative leap second at the end of\n                                  the GMT month (Implies --no-iers)\n  -S, --no-leap-second            Force no leap second at the end of the month\n                                  (Implies --no-iers)\n  -d, --dut1 INTEGER              Force the DUT1 value (Implies --no-iers)\n  -m, --minutes INTEGER           Number of minutes to show (default: 10)\n  --style [bar|cradek|default|duration|json|sextant]\n                                  Style of output\n  -t, --all-timecodes / -T, --no-all-timecodes\n                                  Show the 'WWVB timecode' line before each\n                                  minute\n  --channel [amplitude|phase|both]\n                                  Modulation to show (default: amplitude)\n  --help                          Show this message and exit.\n~~~~\n\nFor example, to display the leap second that occurred at the end of 1998,\n~~~~\n$ python wwvbgen.py -m 7 1998 365 23 56\nWWVB timecode: year=98 days=365 hour=23 min=56 dst=0 ut1=-300 ly=0 ls=1\n'98+365 23:56  210100110200100001120011001102010100010200110100121000001002\n'98+365 23:57  210100111200100001120011001102010100010200110100121000001002\n'98+365 23:58  210101000200100001120011001102010100010200110100121000001002\n'98+365 23:59  2101010012001000011200110011020101000102001101001210000010022\n'99+001 00:00  200000000200000000020000000002000100101201110100121001000002\n'99+001 00:01  200000001200000000020000000002000100101201110100121001000002\n'99+001 00:02  200000010200000000020000000002000100101201110100121001000002\n~~~~\n(the leap second is the extra digit at the end of the 23:59 line; that minute\nconsists of 61 seconds, instead of the normal 60)\n\n\n# How wwvbpy handles DUT1 data\n\nwwvbpy stores a compact representation of DUT1 values in `wwvb/iersdata_dist.py` or `wwvb_iersdata.py`.\nIn this representation, one value is used for one day (0000UTC through 2359UTC).\nThe letters `a` through `u` represent offsets of -1.0s through +1.0s\nin 0.1s increments; `k` represents 0s.  (In practice, only a smaller range\nof values, typically -0.7s to +0.8s, is seen)\n\nFor 2001 through 2019, NIST has published the actual DUT1 values broadcast,\nand the date of each change, though it in the format of an HTML\ntable and not designed for machine readability:\n\nhttps://www.nist.gov/pml/time-and-frequency-division/atomic-standards/leap-second-and-ut1-utc-information\n\nNIST does not update the value daily and does not seem to follow any\nspecific rounding rule.  Rather, in WWVB \"the resolution of the DUT1\ncorrection is 0.1 s, and represents an average value for an extended\nrange of dates. Therefore, it will not agree exactly with the weekly\nUT1-UTC(NIST) values shown in the earlier table, which have 1 ms\nresolution and are updated weekly.\"  Like wwvbpy's compact\nrepresentation of DUT1 values, the real WWVB does not appear to ever\nbroadcast DUT1=-0.0.\n\nFor a larger range of dates spanning 1973 through approximately one year from\nnow, IERS publishes historical and prospective UT1-UTC values to multiple\ndecimal places, in a machine readable fixed length format.\n\nwwvbpy merges the WWVB and IERS datasets, favoring the WWVB dataset for dates when it is available. There are some caveats to this, which are mostly commented in the `wwvb/updateiers.py` script.\n\n`wwvb/iersdata_dist.py` is updated monthly from github actions or with `iersdata --dist` from within the wwvbpy source tree. However, at this time, releases are not regularly made from the updated information.\n\nA site or user version of the file, `wwvb_iersdata.py` can be created or updated with `iersdata --site` or `iersdata --user`.  If the distributed iersdata is out of date, the generator will prompt you to run the update command.\n\nLeap seconds are inferred from the DUT1 data as follows: If X and Y are the\n1-digit-rounded DUT1 values for consecutive dates, and `X*Y\u003c0`, then there is a\nleap second at the end of day X.  The direction of the leap second can be\ninferred from the sign of X, a 59-second minute if X is positive and a\n61-second minute if it is negative.  As long\nas DUT1 changes slowly enough during other times that there is at least one day\nof DUT1=+0.0, no incorrect (negative) leapsecond will be inferred. (something\nthat should remain true for the next few centuries, until the length of the day\nis 100ms different from 86400 seconds)\n\n\n# The phase modulation channel\n\nThis should be considered more experimental than the AM channel, as the\ntests only cover a single reference minute.  Further tests could be informed\nby the [other implementation I know of](http://www.leapsecond.com/tools/wwvb_pm.c), except that implementation appears incomplete.\n\n\n# Testing wwvbpy\n\nRun the testsuite, check coverage \u0026 type annotations with `gmake`.\n\nThere are several test suites:\n * `testwwvb.py`: Check output against expected values.  Uses hard coded leap seconds.  Tests amplitude and phase data, though the phase testcases are dubious as they were also generated by wwvbpy.\n * `testuwwvb.py`: Test the reduced-functionality version against the main version\n * `testls.py`: Check the IERS data through 2020-1-1 for expected leap seconds\n * `testpm.py`: Check the phase modulation data against a test case from NIST documentation\n * `testcli.py`: Check the commandline programs work as expected (limited tests to get 100% coverage)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjepler%2Fwwvbpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjepler%2Fwwvbpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjepler%2Fwwvbpy/lists"}