npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

solar_terms.js

v0.1.0

Published

solar_terms by js

Downloads

10

Readme

solar_terms.js

二十四节气js实现,采用天文算法,使用VSOP87D进行计算,加入了章动和光行差的修正。

快速使用

const SolarTerms = require("solar_terms.js");
new SolarTerms().getSolarTermsAll(2022).map((UTC) => {
	console.log(moment(UTC).format("YYYY-MM-DD HH:mm:ss"));
});

Api

SolarTerms

new SolarTerms({options})

  • options.eOp eclipticOptions(参考Ecliptic)
  • options.year 指定年,getSolarTermsAll(2022)会覆盖这个配置
  • options.deltaT 计算世界时和力学时时是否忽略差值,默认不忽略
  • SolarTerms.getSolarTermsAll(year) 获取一年份的节气时间
  • SolarTerms.getSolarTerms(year,angel) 获取指定年份,指定黄经对应的儒略日

Ecliptic

new Ecliptic(jd,{options})

  • options.nutation nutation配置项,详见nutation.js
  • options.integrity VSOP87D数据是否简化,默认是
  • options.db VSOP87数据,默认用的是87D.EARTH,可以用别的(用的别的就是算别的天体),计算二十节气用不到别的数据

修正数据说明

VSOP87D-SIMPLE VS VSOP87D-FULL(<> ~ 6S)

<!-- VSOP87D-SIMPLE -->  <!-- VSOP87D-FULL -->
2022-01-05 17:13:04      2022-01-05 17:13:00
2022-01-20 10:38:04      2022-01-20 10:38:04
2022-02-04 04:49:43      2022-02-04 04:49:44
2022-02-19 00:41:57      2022-02-19 00:41:58
2022-03-05 22:42:42      2022-03-05 22:42:42
2022-03-20 23:32:21      2022-03-20 23:32:22
2022-04-05 03:19:11      2022-04-05 03:19:11
2022-04-20 10:23:11      2022-04-20 10:23:14
2022-05-05 20:24:53      2022-05-05 20:24:54
2022-05-21 09:21:31      2022-05-21 09:21:32
2022-06-06 00:24:46      2022-06-06 00:24:45
2022-06-21 17:12:51      2022-06-21 17:12:48
2022-07-07 10:37:00      2022-07-07 10:36:57
2022-07-23 04:05:58      2022-07-23 04:05:56
2022-08-07 20:28:08      2022-08-07 20:28:06
2022-08-23 11:15:07      2022-08-23 11:15:07
2022-09-07 23:31:17      2022-09-07 23:31:15
2022-09-23 09:02:42      2022-09-23 09:02:39
2022-10-08 15:21:30      2022-10-08 15:21:24
2022-10-23 18:34:45      2022-10-23 18:34:38
2022-11-07 18:44:30      2022-11-07 18:44:26
2022-11-22 16:19:28      2022-11-22 16:19:26
2022-12-07 11:45:13      2022-12-07 11:45:13
2022-12-22 05:47:09      2022-12-22 05:47:10

IAU1980 VS IAU2000B(< 1s)

<!-- 2000B -->        <!-- 1980SIMPLE -->
2022-01-05 17:13:04   2022-01-05 17:13:04
2022-01-20 10:38:04   2022-01-20 10:38:04
2022-02-04 04:49:43   2022-02-04 04:49:43
2022-02-19 00:41:57   2022-02-19 00:41:57
2022-03-05 22:42:42   2022-03-05 22:42:42
2022-03-20 23:32:21   2022-03-20 23:32:21
2022-04-05 03:19:11   2022-04-05 03:19:11
2022-04-20 10:23:11   2022-04-20 10:23:11
2022-05-05 20:24:53   2022-05-05 20:24:53
2022-05-21 09:21:31   2022-05-21 09:21:32
2022-06-06 00:24:46   2022-06-06 00:24:46
2022-06-21 17:12:51   2022-06-21 17:12:51
2022-07-07 10:37:00   2022-07-07 10:37:00
2022-07-23 04:05:58   2022-07-23 04:05:58
2022-08-07 20:28:08   2022-08-07 20:28:08
2022-08-23 11:15:07   2022-08-23 11:15:07
2022-09-07 23:31:17   2022-09-07 23:31:17
2022-09-23 09:02:42   2022-09-23 09:02:42
2022-10-08 15:21:30   2022-10-08 15:21:30
2022-10-23 18:34:45   2022-10-23 18:34:44
2022-11-07 18:44:30   2022-11-07 18:44:30
2022-11-22 16:19:28   2022-11-22 16:19:28
2022-12-07 11:45:13   2022-12-07 11:45:13
2022-12-22 05:47:09   2022-12-22 05:47:08

与官方公布数据差异

基本控制在1~2分钟以内,主要因为世界时和力学时的差值计算公式造成,理论上没有完全合适的公式,差值只能通过观测得到。但是2分钟的差别完全不影响判断节气的日期。