richteague / eddy Goto Github PK
View Code? Open in Web Editor NEWPython tools to recover precise rotation profiles of disks.
License: MIT License
Python tools to recover precise rotation profiles of disks.
License: MIT License
Line 267 of fit_cube.py currently reads
to_return += [np.percentile(samples, [16, 60, 84], axis=0)]
The 60 should presumably be 50.
Hi Richard, I'm having my class use eddy in a problem set for a planet formation seminar but they were having problems with it. I just uninstalled and installed it again to see if I could reproduce their problem and I now find it broken too! It is missing the default_parameters.yml file. (If I get this file from github directly and copy it to the eddy directory in site-packages, all is fine but this is probably not what you want.)
Anyway, thanks for a very cool package!
On my fork (commit 9f361f3), I've changed the default behavior of one of the emcee calls to use a specific multithreading package rather than be single-threaded.
Pros: runs faster if you have 'billiard' installed
Cons: eats up all your CPUs, though you can always 'nice' your python call. There may be a way to throttle it, but I haven't taken the effort
Feel free to pull the change if you like it.
As title.
Need to run a quick optimize before the emcee run for the GP method.
Tidy up and properly run the tutorial notebooks to include in the documentation.
Make some tests.
Hello Dr. Teague! My name is Shreya Karthikeyan, and I am using the package eddy for my research at the University of Florida on protoplanetary disks. I've been able to utilize other packages of yours with no problem, but I've been running into an issue with the 'rotationmap' class in eddy. I installed eddy but rotationmap is simply not available when I list the available functions. Is this a common issue? Does it depend on the version of eddy that I installed?
Thank you in advance.
Often (mostly) the plot_river
function fails to properly find the correct maxima. Should check the gridding.
Use Eqn. 2 from https://arxiv.org/pdf/2104.09530.pdf to allow for self-gravity to be included in the fitting.
Posteriors are wildly underestimated, likely due to the poor (non-existent) handling of uncertainties. Try and implement a GP to model the covariance matrix and then marginalize over its hyper-parameters to see if that improves the returned posteriors.
The parameter tilt
should not be necessary as it is the difference between a positive and negative inclination. This should also help with the convergence of the fit (maybe).
When I try to create an ensemble of spectra using the gaussian_ensemble function, it works when when the optical depth tau is set to its default (None), but crashes whenever tau is set to a value. This is true regardless of the value. The error message that I get is
ValueError Traceback (most recent call last)
in
----> 1 spectra,theta,velax = gaussian_ensemble(vrot=1500.,tau=5.0)
/Volumes/Untitled2/eddy/eddy/modelling.py in gaussian_ensemble(vrot, Tb, dV, tau, rms, dV_chan, N, oversample, PAmin, PAmax, linear_sample, plot, return_ensemble)
68 spectra = np.array(spectra)
69 else:
---> 70 spectra = _thick_line(velax[None, :], v_los[:, None], dV, Tex, tau)
71 else:
72 if oversample:
/Volumes/Untitled2/eddy/eddy/modelling.py in _thick_line(x, x0, dx, Tex, tau, N)
232 """Optically thick line profile."""
233 if not N:
--> 234 return Tex * (1. - np.exp(-_gaussian(x, x0, dx, tau, N=1)))
235 xx = np.linspace(x[0], x[-1], x.size * int(N))
236 yy = Tex * (1. - np.exp(-_gaussian(xx, x0, dx, tau, N=False)))
/Volumes/Untitled2/eddy/eddy/modelling.py in _gaussian(x, x0, dx, A, N)
224 if not N:
225 return A * np.exp(-np.power((x - x0) / dx, 2))
--> 226 xx = np.linspace(x[0], x[-1], x.size * int(N))
227 yy = A * np.exp(-np.power((xx - x0) / dx, 2))
228 return np.array([np.average(yy[i*N:(i+1)*N]) for i in range(x.size)])
~/anaconda2/envs/python3/lib/python3.7/site-packages/numpy/core/function_base.py in linspace(start, stop, num, endpoint, retstep, dtype)
122 if num > 1:
123 step = delta / div
--> 124 if step == 0:
125 # Special handling for denormal numbers, gh-5437
126 y /= div
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Hello Dr. Richard. I'm Francisco Urbina, an astronomy student from Chile, currently working as an intern for the NRAO. I was trying to use eddy for my research project in debris disks, but got an error I couldn't fix and I don't know if it is an usual one or maybe it's something different. I'll copy the code I've been using and the error on a txt file.
In case you are wondering, I'm using python 3.9.7 and anaconda for package managenement.
Thanks in advance for your reply.
Implement multiple-ellipse fitting as is common in extra-galactic studies (e.g. https://ui.adsabs.harvard.edu/#abs/2006MNRAS.366..787K/abstract). This may allow us to distinguish between radial flows and warps.
Currentlyevaluate_models
only takes a posterior samples. This should be changed so it can also accept 16th, 50th and 84th percentiles to draw models from (assuming a simple Gaussian posterior).
Something in scipy.optimize.minimize?
Make documentation available via ReadTheDocs.
One thing that would be helpful in the Jupyter notebooks is an example, or more explicit description, of how to estimate the rotation velocity from actual data. The gaussian_ensemble class is very nice for testing the code, but once the testing is done the next step is to apply this to real data. The information on how to do this is contained throughout the various notebooks, but a section that explicitly lays out how to estimate rotation velocities from actual data would be a huge benefit for anyone trying to apply this code to their data.
If it is easy, I would suggest using the TW Hya CO data that is already used in the 'Fitting Rotation Maps' notebook as an example in the 'Inferring Rotation Maps...' notebooks to explicitly demonstrate how someone could create the necessary spectra, theta, and velax arrays, how to use these arrays to create an annulus object, and then how to use the annulus object to infer the rotation velocity. Barring this, a simple step-by-step list (e.g. (1) create an array of spectra at a range of azimuthal angles from your data with shape N x M, (2) make an array of the azimuthal angles with shape N, etc.) would help someone that is skimming the notebooks looking for instructions on how to apply this code to their data.
Include a 1/r^2 weighting for the fitting to account for larger number of pixels in the outer disk.
As title.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.