Closed AshaJain21 closed 2 years ago
nan
values are (correctly) denoting a time at which the satellite no longer has a valid position.nan
is a meaningful result. I'll go see if the message can be turned off.An update: I can't get that error to appear here on my machine. (I thought for a moment I'd seen it, but it was an unrelated warning.) On my version of NumPy, arctan(nan, nan)
comes out silently and cleanly as nan
without any unnecessary drama. Even if:
PYTHONWARNINGS=d
environment variable.import numpy
followed by numpy.seterr('raise')
.@AshaJain21 — Let's compare NumPy versions. Is yours newer or older than numpy==1.15.4
?
Hi Brandon, thanks for the quick replies. I have numpy 1.20.1
according to pip list
in my juypter notebook.TLEtoLatLong.pdf
In testing some more, I get a silent failing sometimes when I initialize an EarthSatellite from a tle directly but always get the warning explicitly when I initialize an EarthSatellite with an explicit definition of SatRec() as shown below:
satrec = Satrec()
satrec.sgp4init(
WGS72, # gravity model
'i', # 'a' = old AFSPC mode, 'i' = improved mode
int(satellite_info['norad'].values[0]), # satnum: Satellite number
epoch_difference_days, # epoch: days since 1949 December 31 00:00 UT
satellite_info['bstar'].values[0], # bstar: drag coefficient (/earth radii)
satellite_info['dn_o2'].values[0], # ndot: ballistic coefficient (revs/day)
satellite_info['ddn_o6'].values[0], # nddot: second derivative of mean motion (revs/day^3)
satellite_info['ecc'].values[0], # ecco: eccentricity[TLEtoLatLong.pdf](https://github.com/skyfielders/python-skyfield/files/7864484/TLEtoLatLong.pdf) satellite_info['argp'].values[0]* (np.pi/180), # argpo: argument of perigee (radians)
satellite_info['inc'].values[0]* (np.pi/180), # inclo: inclination (radians)
satellite_info['M'].values[0]* (np.pi/180), # mo: mean anomaly (radians)
satellite_info['n'].values[0]* (2*np.pi) / (24*60), # no_kozai: mean motion (radians/minute)
satellite_info['raan'].values[0]* (np.pi/180), # nodeo: right ascension of ascending node (radians)
)
satellite = EarthSatellite.from_satrec(satrec, ts)
Attached is a copy of the juypter notebook exported to a .pdf file (thus the file is not run-ready)
I'm happy that you've discovered a reliable way to induce the warning to print! Could you provide a small script that does so? Without a satellite_info
data structure I can't run you example code.
Definitely, attached is a simple script. Note that I had to add the .txt extension to allow the file to attach, so please remove that extension. I was not able to test and run the file due to current issues on my computer, but I will upload the output once I am able to.
Hello, I am propagating reentered satellites from their latest TLE to their predicted reentry time, and for several satellites I get the error: invalid value encountered in double_scalars lon = (arctan2(y, x) - pi) % tau - pi. I believe this error may be because aractan2 is returning a nan value (possibly because x and y are nonsensical) but I am unsure why x and y are invalid or how to fix it. I have checked that the TLE's are within 5 days of the predicted reentry time.
For example, the error occurs when propagating Starlink-2638 (catalog #48477 epoch 2021-06-02 21:34:18 UTC) to June 3rd 2021 12:19:00 UTC, using the following python code:
The output of the code above:
The full error is:
Thanks for the help!