{"id":14970800,"url":"https://github.com/sdrazen/astro-calculator","last_synced_at":"2026-02-28T01:42:51.813Z","repository":{"id":59484609,"uuid":"537561089","full_name":"sdrazen/astro-calculator","owner":"sdrazen","description":"Performs astronomical calculations and conversions","archived":false,"fork":false,"pushed_at":"2022-09-16T17:41:02.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-13T01:20:45.596Z","etag":null,"topics":["altitude","astro","astronomy","azimuth","calculation","conversion","converter","coordinate","declination","degree","formulae","right-ascension"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdrazen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-16T17:40:08.000Z","updated_at":"2023-07-13T21:49:07.000Z","dependencies_parsed_at":"2022-09-17T20:11:49.948Z","dependency_job_id":null,"html_url":"https://github.com/sdrazen/astro-calculator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sdrazen/astro-calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdrazen%2Fastro-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdrazen%2Fastro-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdrazen%2Fastro-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdrazen%2Fastro-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdrazen","download_url":"https://codeload.github.com/sdrazen/astro-calculator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdrazen%2Fastro-calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29922280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["altitude","astro","astronomy","azimuth","calculation","conversion","converter","coordinate","declination","degree","formulae","right-ascension"],"created_at":"2024-09-24T13:44:10.228Z","updated_at":"2026-02-28T01:42:51.795Z","avatar_url":"https://github.com/sdrazen.png","language":"JavaScript","readme":"# Astro Calculator\n\nThis npm package performs astronomical calculations and conversions. If you are attempting to write an app which has to do with astronomy, this package can be of great help as you don't have to search for formulae or methods to perform a certain astronomical calculation or conversion.\n\n## Installing\n\n```bash\nnpm install astro-calculator\n```\n\n## Getting started\n\nThis package provides following functionalities (all parameters are of type `number`):\n\n- `getDaysFromJ2000`: calculates number of days from 2000-01-01 at noon until now\n  - `parameters`: year, month, day, hours, minutes\n  - `returns`: number\n- `getLocalSiderialTime`: calculates local siderial time\n  - `parameters`: year, month, day, hours, minutes, LON\n  - `returns`: number\n- `getHourAngle`: calculates hour angle\n  - `parameters`: localSiderialTime, RA\n  - `returns`: number\n- `getAltAz`: calculates altitude and azimuth\n  - `parameters`: RA, DEC, LAT, LON, year, month, day, hours, minutes (RA - hours decimal; DEC, LAT, LON - degrees decimal)\n  - `returns`: array of numbers - [Alt, Az] as degrees decimal\n- `isLeapYear`: determines if year is leap or not\n  - `parameters`: year\n  - `returns`: boolean\n- `convertToHours`: converts to hours\n  - `parameters`: hours, minutes, seconds\n  - `returns`: number\n- `convertToDegreesDecimal`: converts to degrees decimal\n  - `parameters`: degrees, minutes, seconds\n  - `returns`: number\n- `convertRAToDegreesDecimal`: converts RA to degrees decimmal\n  - `parameters`: RA\n  - `returns`: number\n- `convertDegreesToRadians`: converts degrees to radians\n  - `parameters`: degrees\n  - `returns`: number\n- `convertRadiansToDegrees`: converts radians to degrees\n  - `parameters`: radians\n  - `returns`: number\n- `convertDegreesDecimalToDegreesMinutesSeconds`: converts degrees decimal to degrees, minutes and seconds\n  - `parameters`: degrees\n  - `returns`: array of numbers - [deg, min, sec]\n\n## Usage\n\nJust import the package and use its functions with appropriate parameters, like so:\n\n```javascript\nconst ac = require(\"../astro-calculator\");\n\nlet getDaysFromJ2000 = ac.getDaysFromJ2000(2022, 9, 16, 18, 32);\nlet getLocalSiderialTime = ac.getLocalSiderialTime(2022, 9, 16, 18, 32, 16.03);\nlet getHourAngle = ac.getHourAngle(8549.15, 6.45);\nlet getAltAz = ac.getAltAz(6.45, 29, 45.81, 15.97, 2022, 9, 16, 17, 01);\nlet isLeapYear = ac.isLeapYear(2022);\nlet convertToHours = ac.convertToHours(18, 30, 21);\nlet convertToDegreesDecimal = ac.convertToDegreesDecimal(123, 29, 33);\nlet convertRAToDegreesDecimal = ac.convertRAToDegreesDecimal(6.45);\nlet convertDegreesToRadians = ac.convertDegreesToRadians(36.87);\nlet convertRadiansToDegrees = ac.convertRadiansToDegrees(0.6435);\nlet convertDegreesDecimalToDegreesMinutesSeconds = ac.convertDegreesDecimalToDegreesMinutesSeconds(123.38);\n\nconsole.log(\"getDaysFromJ2000: \" + getDaysFromJ2000);\nconsole.log(\"getLocalSiderialTime: \" + getLocalSiderialTime);\nconsole.log(\"getHourAngle: \" + getHourAngle);\nconsole.log(\"getAltAz: \" + getAltAz);\nconsole.log(\"isLeapYear: \" + isLeapYear);\nconsole.log(\"convertToHours: \" + convertToHours);\nconsole.log(\"convertToDegreesDecimal: \" + convertToDegreesDecimal);\nconsole.log(\"convertRAToDegreesDecimal: \" + convertRAToDegreesDecimal);\nconsole.log(\"convertDegreesToRadians: \" + convertDegreesToRadians);\nconsole.log(\"convertRadiansToDegrees: \" + convertRadiansToDegrees);\nconsole.log(\"convertDegreesDecimalToDegreesMinutesSeconds: \" + convertDegreesDecimalToDegreesMinutesSeconds);\n```\n\nand results look like this in the console:\n\n```\ngetDaysFromJ2000: 8294.272222222222\ngetLocalSiderialTime: 8569.714533016668\ngetHourAngle: 8542.699999999999\ngetAltAz: -14.650875603437063,351.0514900218268\nisLeapYear: false\nconvertToHours: 18.50583333333333\nconvertToDegreesDecimal: 123.4925\nconvertRAToDegreesDecimal: 96.75\nconvertDegreesToRadians: 0.6435028952103092\nconvertRadiansToDegrees: 36.86983411666847\nconvertDegreesDecimalToDegreesMinutesSeconds: 123,22,48\n```\n\n**Note**: When asked for time (hour and minues) in parameters of functions for example (`getAltAz`), remember to provide UTC time, not your local current time. This, of course, doesn't apply to the function `convertToHours` which will convert to hours any value of hours, minutes and seconds you provide it to convert - that's another story because it has nothing to do with calculating siderial time, hour angle or alt/az.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdrazen%2Fastro-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdrazen%2Fastro-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdrazen%2Fastro-calculator/lists"}