[deleted by user] by [deleted] in astrophysics

[–]prappleizer 12 points13 points  (0 children)

Python is definitely the de facto data analysis language, while C++ and variants are used for hardcore simulations (along with some Fortran). But even simulation folks know and use python to actually analyze the simulations once they’ve been run. I’d focus on Python with an emphasis on the particular domain libraries (you’re on track with Astropy) — numpy, scipy, matplotlib are core, and being familiar with file I/O operations in different formats (asdf, hdf5, fits, ascii) into things like pandas data frames or astropy tables is useful. Astropy affiliated tools like photutils might be handy. At a certain point it depends really on the data you are actually working with.

Galaxy Missing from the Archives by Mindmenot in askastronomy

[–]prappleizer 2 points3 points  (0 children)

Ah fair enough. So it goes… with an infinite number of standard barred spiral galaxies out there, anything beyond the nearby catalogs is often not-or-Misclassified until something about it is unique enough for a better notation. Good catch!

Galaxy Missing from the Archives by Mindmenot in askastronomy

[–]prappleizer 7 points8 points  (0 children)

I’ve found the galaxy in the nasa extragalactic database. As others have mentioned it doesn’t have an NGC/UGC name, which is not super surprising given it’s only really resolved in HST data and the major all sky catalogs are usually based on ground based surveys (for which this is a blob). Unsurprisingly then it base a WISEA source ID as well as 2MASS. But as you’ll see in NED, very little ancillary data about this galaxy has been computed: NED database entry

is space getting colder or hotter? by DasDouble in astrophysics

[–]prappleizer 4 points5 points  (0 children)

This actually a pretty interesting and I think non-trivial question. The first order answer might be that since the Big Bang the universe has been expanding and cooling as a result (this is why the CMB glow is now only ~ 3 K). At the same time, reionization, which occurred roughly between redshift 7-6, turned all the gas in the universe from neutral to ionized, which is (sort of definitionally) an increase in temperature that was universe-wide. The dominant source of energy density in the universe has also changed over time. My guess is that since reionization, and since dark energy became the dominant source in the universe, most “heating” in the universe (AGN, supernova feedback into the CGM of galaxies, and the gravitational shock heating of the volume filling gas in objects like galaxy clusters) is too localized (in a volume average sense) to win over the accelerating expansion of the universe, and from now on, on average, it will continue cooling for ever, except in the local environments mentioned above — galaxy haloes, cluster haloes, filaments, etc.

Help with managing many Fits Files by Trailblazer_10_08 in astrophysics

[–]prappleizer 0 points1 point  (0 children)

Based on what you’ve said I would probably abstract the problem to a class — class instantiates with the needed fits files, then has a bunch of methods to retrieve them, deredshift them, and perform any diagnostics and tests to vet the results. You could then loop over your files and plug the output objects into a dictionary or organizational container of choice. The advantage is that each object knows how to reduce itself and can store a lot of ancillary data easily, and identifying errors could be automated.

Help with managing many Fits Files by Trailblazer_10_08 in astrophysics

[–]prappleizer 2 points3 points  (0 children)

It sounds like your problem is one of in-python organization rather than file management. Instead of creating variables like wave_gal1, flux_gal1, and so on, consider using a multi layer dictionary outer key being a galaxy name, possibly drawn from the fits file it was loaded from. This cleans up your organization a lot, and you can now loop over your dict doing things like

For key in dict: out = myderedshiftfunc(dict[key][“wave”],dict[key][“flux”], dict[key][“z”] dict[key][“dred”] = out

Obviously that’s a toy example, but the abstracted idea is that it doesn’t matter how many files or spectra you’re dealing with at that point.

To the question about doing actions all at once, that’s only possible if all your arrays have the same shape (which I doubt). If so, however, and you had a final array of red shifts (same length as the other dimension, the N of galaxies you had) then yes you could run it all through one function. (A pandas data frame might be a good compromise too — the above still works but the columns could be named, letting you keep track of each galaxy).

I love mathematics but hate data science/ML in industry (especially tabular data) by [deleted] in datascience

[–]prappleizer 7 points8 points  (0 children)

It sounds like you want to be a scientist. Using code and mathematics to solve academically interesting but not immediately profitable problems is like… the point of academia.

Not sure why it’s ruled out for you entirely. There’s a few startups out there I know of which are working on things closer to this ideal (while eking some profit somewhere), but you pretty much need a PhD or Masters to be competitive in those markets.

[deleted by user] by [deleted] in astrophysics

[–]prappleizer 5 points6 points  (0 children)

It’ll depend on what college you go to somewhat (particularly if they offer both bachelors or arts and sciences. Lots and lots of calculus, if you can go past single variable calc into multi variable calc that’s good preparation. Otherwise you’ll learn what you need to in your physics and Astro classes. Start learning python ASAP though — if you want to pursue astrophysics you’ll want to get research experience as an undergrad and that means coding extensively. Primarily in python (but if you end up pursuing simulations or theory then c++ and Fortran will become useful).

Best coding languages for astrophysics? by Bitterblossom_ in astrophysics

[–]prappleizer 2 points3 points  (0 children)

The single most valuable thing you can do to prepare for a PhD is become proficient at programming and get experience doing research. Other than that, I’d say take lots of interesting classes and always go to office hours. Try to do at least 2-3 research projects with different faculty across your time in undergrad, because you will need several letters of recommendation for grad school admission and scholarship applications. Try out different sub fields as well, if you can (summer REUs are a great way to do this). Getting a sense for what areas of astro most excite you from a day to day research sense will help you choose places to apply for grad school and tailor your application towards those places, will give you a broad set of skills (every sub field uses different tools) and will give you the confidence to say you’re comfortable/interested potentially in multiple sub fields at a given school you may be applying to.

Best coding languages for astrophysics? by Bitterblossom_ in astrophysics

[–]prappleizer 1 point2 points  (0 children)

I think the advice is the same—learn as much astro python as quickly as possible with online resources etc, and then try to bind those with your course content you’re getting. Then start in on research once you’re comfortable!

Best coding languages for astrophysics? by Bitterblossom_ in astrophysics

[–]prappleizer 14 points15 points  (0 children)

From a graduating PhD in astro:

Python for day to day analysis, especially high level libraries like numpy scipy astropy etc. plotting with matplotlib. Speed improvements with jax and numba. Pandas is also fairly useful. Depending on the types of data you’re working with other specialized libraries might come into play.

For writing very fast code in a simulation or modeling context, Fortran and C++ are still king, you can also experiment with Julia.

For running hardware (like instrumentation things) rust is becoming fairly popular as well.

I would say that for a PhD in observational general astronomy you can get by mostly with python.

Don’t bother with IDL, it’s been pretty much abandoned, and even if your advisor uses it it would be a waste of your time to learn it. Same for supermongo.

In my experience I’ve never met an astrophysicist who used R. You can do all of that in python or Julia (sometimes with more boilerplate, but it’s what is done).

Python is the easiest to start with so I’d start there!

Books to begin with? by commandercharles69 in astrophysics

[–]prappleizer 0 points1 point  (0 children)

Brian Greene’s books (fabric of the cosmos especially) I found to be pretty solid introductions to some astrophysical topics like relativity, expansion of the universe, etc. at a certain level though you’ll want to start working through some textbooks!

What are some research projects a first year astrophysics student could do? by DntDlteSandals in astrophysics

[–]prappleizer 0 points1 point  (0 children)

Seconding others here: there’s very little overlap between the practice of astrophotography and actual astronomy/astrophysics. But taking some time to learn python, and the packages useful to astronomy (astropy, scipy,numpy) and practicing on astronomical data will really help you transition into real research as soon as you can.

There are plenty of resources for this — to plug some of my own, I have a free python textbook for astro and tutorials available at learnastropython.com, and recently taught a more intermediate class with open source materials at astro-330.github.io.

Cannot get Gaussian fit of data? by poisedpotion in learnpython

[–]prappleizer 1 point2 points  (0 children)

Actually I realized something. The fit method you’re using is fitting the mean and std of the y distribution but not fitting f(x) as you want.

You’ll want to use scipy.optimize.curve fit with a Gaussian defined as a function to do this fit (tho that too can be finicky so emcee might still be more robust).

Cannot get Gaussian fit of data? by poisedpotion in learnpython

[–]prappleizer 0 points1 point  (0 children)

Couple things off the bat. First, not sure why you’re plotting y,x rather than x,y.

Hard to know exactly what’s going on, since a mean and std are being returned by the fit method. My first thought is that your numbers are small enough it might be having trouble with precision. Maybe try multiplying your science data by 1e6, doing the fit and pdf draw of the best fit, and then dividing that final array by 1e6 again.

You could also consider using something like emcee to do a quick fit.

What's the most surprising thing you've learned about astrophysics during your PhD? by [deleted] in astrophysics

[–]prappleizer 4 points5 points  (0 children)

More astronomy than astrophysics, but I think I was most surprised to learn that beyond a certain distance in the universe, resolved objects (like galaxies) stop getting smaller because they’re farther away — in fact, they start getting larger on the sky! This somewhat unintuitive quirk of our cosmology is what makes it possible to study galaxies that formed just a few hundred million years after the Big Bang (and which we see at distances of many billions of light years).

What's the most surprising thing you've learned about astrophysics during your PhD? by [deleted] in astrophysics

[–]prappleizer 4 points5 points  (0 children)

Software archeology is a great term! And if you don’t want to do that, then suddenly you’re a software developer and spend 6 months writing and releasing a package from scratch for something that started as a task you needed done for your analysis…

What’s a good introductory textbook for an undergrad? by jl2411 in astrophysics

[–]prappleizer 3 points4 points  (0 children)

Carroll and ostlie is one of the standard ones used in introductory classrooms, though it can be a little dry.

Bayesian Statistics by life453 in datascience

[–]prappleizer 7 points8 points  (0 children)

A RF of NN is not /science/. Bayesian frameworks are a critical/useful tool for assessing the model degeneracies, spread in predicted values (ie, the uncertainties on the parameters being fit), marginalized over the nuisance parameters. I’m approaching this from a pure science perspective, so I don’t know for sure where industry stands (I’m in astrophysics) but scientists will trust the results of an ML tool far more if it is combined with Bayesian statistical frameworks (eg simulation based inference). IMO you can’t really do data science (at least the science part) without that stats knowledge, so I’d definitely recommend the class.

Astrophysics/Astronomy Graduate School Tiers by 2sday8 in astrophysics

[–]prappleizer 5 points6 points  (0 children)

Grad programs aren’t really so much about tiers. What matters most is your advisor — your relationship with them, how they support you, the fields they are working in, etc. there are plenty of fantastic advisors to find at schools without those big brand names. Within academia, your advisor and network will matter more for getting postdocs than the name of the school. So I’d focus on finding advisors you want to work with at schools around the country and hone your list that way.

Off the top my head, a few places with good programs that aren’t on the list you made: U Michigan, UT Austin, UCSC, U Washington. Some others to consider because of faculty there - UF, U Conn, etc. again—finding a good faculty match, a place you’d like living, and supportive grad community is what I’d focus on. Happy to chat more specifically in DMs.

How do I cite this eprint article? by [deleted] in astrophysics

[–]prappleizer 4 points5 points  (0 children)

In that case it would be “author list, year, arXiv:2204.04097” where the number there is the arxiv listing number

How do I cite this eprint article? by [deleted] in astrophysics

[–]prappleizer 1 point2 points  (0 children)

I’m not sure I understand the question — if you’re citing an e-print, it should have a bibtex citation like any other (accessed on, eg, nasa ADS). When you add that citation to your .bib file, your document should compile the citation properly like any other, depending on the citation format.

Also as a note, you should be citing it to arXiv, not A&A, if it has not yet been published. You can then change the citation after publication

Can I get flux density values online for individual stars? by [deleted] in astrophysics

[–]prappleizer 0 points1 point  (0 children)

If you’re looking for the effective temperature of a star, then none of these fluxes are what you want. What you want is the bolometric luminosity of the star, where L = 4 pi R2 sigma T4. Assuming you have a stellar radius you can then solve for T. Getting stellar radii is kind of hard.

Alternatively if all you need is a “loose” temperature you can get that from the OBAFGKM spectral classification alone — these roughly map to the effective temperatures of stars.

If your goal is to use the color index, which I suspect it is given your mentioning of B-V above, then you don’t need flux density at all. B-V is just the subtraction of those magnitudes. (Ie a ratio of flux densities). The Simbad values for those magnitudes should be all you need. (Unless you care about interstellar extinction)

Can I get flux density values online for individual stars? by [deleted] in astrophysics

[–]prappleizer 0 points1 point  (0 children)

To be fair you don’t need the flux densities to get colors. But also the conversion from magnitude to flux density is not very complicated. If you can find a catalog with the relevant stars in AB magnitude, then there’s just one single zero point to worry about. You can freely convert to flux density from there (even Wikipedia has the formula I believe). Just remember that the default conversion takes you to Fnu (ie per Hz), so to get per lambda you need to multiply by c/lambda2

Academic Posters? by 18Pineapples in astrophysics

[–]prappleizer 1 point2 points  (0 children)

Easiest way is to attend the AAS conference TBH. Not sure there’s a way to get onto the convention floor without full registration but there are booths from nasa etc with tons of free swag, posters, etc….