Which should I use: Python-sgp4, PyEphem, python-skyfield [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 12 months ago.
Improve this question
The landscape of Python tools that seem to accomplish the task of propagating Earth satellites/celestial bodies is confusing. Depending on what you're trying to do, PyEphem or Python-SGP4 may be more suitable. Which of these should I use if:
I want ECEF/ECI coordinates of an Earth satellite
I want general sky coordinates of a celestial object
Near Earth vs. far away objects
Want to use two-line element sets
Do any of these accomplish precise orbit determination? If not, where do I go/what resources are there out there for precise orbit determination?
I kind of know the answers here. For instance, POD is not part of any of these libraries. These computations seem to be very involved. POD for many objects are available from IGS. The main reason I ask is for documentation purposes. I'm not familiar with python-skyfield, but I have a hunch it accomplishes what these other two do. --Brandon Rhodes, I await your expertise :)

Michael mentioned it in his comment, but PyEphem I believe is deprecated as of the current Python 3 version. That being said, if you are to use TLEs, SGP4 was made to handle TLEs in particular. The non-keplerian and non-newtonian terms you see in TLEs are specifically passed into the SGP4 propagator (B* drag, second derivative of mean motion, etc.). Once you get outside of Earth neighborhood (beyond GEO), SGP4 is not meant to handle these cases. SGP4 in of itself is inherently a near-earth propagator that does not scale well on an inter-planetary or even cis-lunar regime. In fact, if you are to have both apogee and perigee extend beyond GEO, I would tend to avoid SGP4.
It is important to note that SGP4 outputs things in a TEME frame (true equator mean equinox). This is an inertial frame. If you want ECEF coordinates, you will need to find a package that converts you from inertial to fixed frames. Regardless of whether or not you desired earth-fixed coordinates, I highly recommend making this conversion so you can then convert to your inertial frame of choice.

Related

Pandas deep dive [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last year.
Improve this question
I'm very familiar with pandas and using it on a daily basis.
Recently I made couple of projects where I needed to build things in a very efficient way and I needed to understand the fundamentals pandas is built on.
I'm looking for a book/material where I can understand pandas better in term of efficiency.
Any recommendations?
If you're already familiar with Pandas (e.g. you can fairly quickly write up a syntax to accomplish a task XYZ, and you know of a few different approaches to accomplish most common tasks), then I would suggest the better approach is to benchmark your options yourself.
You could use timeit for that. You're likely to get a much better insight into things this way for one, and then you'll also be building a basis on which you can add later as you identify specific needs. No need for very fancy coding, just dump a bunch of test cases with timeit in a file. It doesn't need to take that long, and is more re-usable/adaptable than reading some thing on some test case in a benchmark that may or not actually mirror the behavior of your actual data.
From quick Google searches I did earlier, what you'll find on this topic as far as I know are very broad recommendations that you likely already know about - user proper datatypes (int are faster than floats), avoid for-loops and use vectorized notations instead, etc. Those are good advices, but based on your level of understanding of Pandas, it sounds like you're already past that level of advice.

Python library for Intelligent Data generation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I have a system which is configurable. It has 3 parameters
Parameter1 - can vary between [0, 2^30]
Parameter2 - can vary between [0, 2^30]
Parameter3 - can vary between [0, 2^12]
I have a python code which when given a set of valid numbers corresponding to (parameter1, parameter2, parameter3) can configure the system and after few mins return a number say a score for the configuration.
Suppose the aim to maximize the score. Is there a python library to generate the parameters with constraints intelligently.
Thanks in advance
This is a bounded optimization problem. Depending on how the "system" is structured different optimization strategies will behave differently well.
My suggestions is to either look at scipy.optimize.minimize or a genetic algorithm. I know there are multiple GA implementations in Python, but I haven't tried them.
Since a single evaluation takes on the order of minutes, you are looking at long optimization times though.
If you can compute the gradient to your score function, and if it is well-behaved (i.e. convex) then the scipy.optimize.minimize is probably your best bet. Otherwise you might have better luck with a GA.

Linear algebra with Pyomo [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm trying put my optimization problem into Pyomo, but it is strongly dependent upon standard linear algebra operations - qr, inverse, transpose, product. Actually, this is Kalman filter problem; recursive linear algebra for long time series. I failed to find pyomo functions to implement it like I could in tensor flow. Is it possible?
Connected questions:
Am I right that numpy target function is practically not usable in pyomo?
Is there a better free optimization solution for the purpose? (scipy cannot approach efficiency of Matlab by far, tensor flow is extremely slow for particular problem, though I do not see why, algorithmic differentiation in Matlab was reasonably fast though not fast enough)
Many thanks,
Vladimir
Pyomo is mainly a package for optimization. i.e. specifying data -> building problem -> sending to the solver -> wait for solver's results -> retrieving solution. Even if it can handle matrix-like data, it cannot manipulate it with matrix operations. This should be done using a good external library, before you send your data to Pyomo. Once you have all your matrixes ready to be used as data in your optimization model, then you can use Pyomo for optimization.
That being said, you should look into finding a library that fits your needs to build your data, since your data values must be static, once you provide it as an input to your model.
Also, keep in mind that Pyomo, like any optimization tools, is deterministic. It is not meant to do data analysis or data description, but to provide a way to find one optimal solution of a mathematical problem. In your case, Pyomo is not meant to do the Kalman filter problem, but to give you the solution of minimizing the mean square error.

Noise Reduction in an Audio file using Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
We can perform noise reduction using Open-source Software like Audacity, which is commonly used for the purpose. Please click the below link for reference.
denoising with audacity image
Is there a python library that can perform a similar function?
If you want to reduce noise the audacity way, to my understanding, you should program your algorithm using scipy filters provided by scipy library.
Besides that pyaudio is one dedicated library for audio analysis and here is a kickstart tutorial.
If you are not restricted only to Python, you can check out on Essentia. This is by far an exhaustive library for music and audio analysis.
Nutshell: While python libraries provide functionalities, it is you who should code your noise reduction algorithm (tailored to your needs). May be you can follow the audacity's approach.
You can refer this question for better, technical/implementation, clarity: Noise reduction on wave file
Good luck! Try to be precise and post questions focusing on implementation pertaining to programming languages rather than generic things.
As a general guideline:
Understand the behavior of your noise and then you can choose your noise removal strategy accordingly.May be you need a simple low pass filter or high-pass filter.

Stepinfo in Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am trying to determine the following step characteristics for a step response in Python:
RiseTime
SettlingTime
SettlingMin
SettlingMax
Overshoot
Undershoot
Peak
PeakTime
Matlab offers me the function stepinfo, but I am unable to find a suitable alternative in Python. I did try to roll my own using numpy and scipy, but I haven't had much luck yet, my knowledge of signal processing is lacking.
Most information that I can find on the internet look rather complicated but I do like to learn more about this. If any one could recommend me a good book or other source to learn more from I would appreciate it! Thank you!
This is the step response that I currently have:
This discussion suggests a sort of implementation:
def step_info(t,yout):
print "OS: %f%s"%((yout.max()/yout[-1]-1)*100,'%')
print "Tr: %fs"%(t[next(i for i in range(0,len(yout)-1) if yout[i]>yout[-1]*.90)]-t[0])
print "Ts: %fs"%(t[next(len(yout)-i for i in range(2,len(yout)-1) if abs(yout[-i]/yout[-1])>1.02)]-t[0])
Then you need to use numpy functions in the Signal Processing section to get the other information that you want.
Could you not just implement the formulas? (Assuming that this is a second order system / has two dominant poles and can be approximated as second order)
For rise and settling time there are a few different approximations, so the internet is your friend.
You could also figure out the damped frequency (from the maxima and minima of your plot data), and use that to figure out the natural frequency:
There are a handful of formulas that relate these various quantities, depending on what you know.

Categories