question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getEpochTimestamp returning NaN

See original GitHub issue

When I use the getEpochTimestamp function it returns a NaN. All other get functions are working as expected.

function convertTLE(tle) { const satelliteData = { name: getSatelliteName(tle), semiMajorAxis: getSemiMajorAxis(getMeanMotion(tle)), eccentricity: getEccentricity(tle), inclination: getInclination(tle), rightAscension: getRightAscension(tle), perigee: getPerigee(tle), meanAnomaly: getMeanAnomaly(tle), epoch: getEpochTimestamp(tle), }; console.log(getEpochTimestamp(tle)); return satelliteData; }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
louisjmorgancommented, Jan 6, 2022

I’m using Node v16.13.1 with react and webpack, but all the calculations are contained within a single react component so I’m not sure that’s affecting anything. The console output for the TLE looked normal:

ISS (ZARYA) 1 25544U 98067A 22005.58472471 .00003968 00000+0 77828-4 0 9998 2 25544 51.6440 61.8159 0005338 6.5542 157.7978 15.49868185319960

I’ll try running your test in a basic two file node setup shortly and let you know if it exhibits the same behaviour.

Thanks again for your help, Louis


From: David Calhoun @.> Sent: 06 January 2022 15:25 To: davidcalhoun/tle.js @.> Cc: louisjmorgan @.>; Author @.> Subject: Re: [davidcalhoun/tle.js] getEpochTimestamp returning NaN (Issue #28)

Weird, I’m not sure what’s happening, I can’t reproduce it. I tried it on both Node.js v14.17.5 and v16.13.1 and it works. Added this test, which passes on my side:

test(“getEpochTimestamp 2”, () => { const tle = ISS (ZARYA) 1 25544U 98067A 22005.58472471 .00003968 00000+0 77828-4 0 9998 2 25544 51.6440 61.8159 0005338 6.5542 157.7978 15.49868185319960; expect(getEpochTimestamp(tle)).toEqual(1641391320214); });

— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdavidcalhoun%2Ftle.js%2Fissues%2F28%23issuecomment-1006677251&data=04|01||9973cb920c3c42e85a8608d9d128b73a|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637770795061442366|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000&sdata=kQU9aBbhjAOfmcepffK2gfWofMGoHe5Faf2RZwz7w38%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHX2NRF7NJMSDO5UDMGTALDUUWX5BANCNFSM5LKL2EKQ&data=04|01||9973cb920c3c42e85a8608d9d128b73a|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637770795061442366|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000&sdata=LUVpPjtAVrIZ7glsKI3ZEipchThuarbWavQDbbQpFXQ%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04|01||9973cb920c3c42e85a8608d9d128b73a|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637770795061442366|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000&sdata=4NY2zpFS2MIjFWyOgvuj1lqwdwf2J%2BhTQJMSWJRhpOc%3D&reserved=0 or Androidhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04|01||9973cb920c3c42e85a8608d9d128b73a|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637770795061442366|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000&sdata=oY0HF06wD7AMfcK33apnPGR72apyjKvWLflHxkfbWJg%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

0reactions
davidcalhouncommented, Nov 11, 2022

Closing this out as I’m unable to reproduce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the Date class return NaN? - Stack Overflow
The console shows for example '1404792000000' so the timestamp is good, but the output results in 'NaN-NaN-NaN / 864'. What am I doing...
Read more >
Unix conversion returns Nan if the date is in locale format #5824
Describe the bug Unix conversion returns Nan if the date is in locale format To Reproduce Steps to reproduce the behavior: The below...
Read more >
Date() constructor - JavaScript - MDN Web Docs - Mozilla
The Date() constructor can create a Date instance or return a string representing the current time.
Read more >
pandas.to_datetime — pandas 1.5.2 documentation
Convert argument to datetime. ... If 'ignore' , then invalid parsing will return the input. ... If 'unix' (or POSIX) time; origin is...
Read more >
Nan Loss coming after some time - PyTorch Forums
Just follow the clue and you will find the bug resulting in nan problem. ... I am getting 'nan' loss after 1st epoch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found