Astropy Lesson 1: Introduction to FITS File Handling
Вставка
- Опубліковано 17 вер 2024
- This is the first in a series of videos where I will be teaching you how to use Astropy on Linux, Windows, or macOS. In this video, I cover the basics of which programs you'll need, and how to open and view the data stored in FITS image files.
SOFTWARE
Visual Studio Code ............ code.visualstu...
Python ................................ www.python.org...
Having trouble finding FITS files to work with? Find some here: archive.stsci....
EXAMPLE CODE
Here's a link to my GitHub repository with sample Astronomy codes. Download 'L1_fits-handling.ipynb' for the code used in this video: github.com/lai...
ACKNOWLEDGEMENT
This work made use of Astropy (www.astropy.org) a community-developed core Python package and an ecosystem of tools and resources for astronomy (Astropy, 2013, 2018, 2022).
I have begun undergraduate research with astropy and photutils for photometric data analysis. These videos are helpful!
I like it Man , looking forward for the next video please continue.
Glad you liked it! It might be awhile before I can get the next video out, but it’s in the works :)
great help !! looking forward for next videos
i like it man ! hope you continue it
This is awesome! Thank you Micah
Your video is so great. Thank you so much!
Thanks soo much for the tutorial, your channel is awesome 👍
Please make more such videos on fits and data reduction
the volume is to low. cant hear you
I’m sorry about that. Have you tried turning up the volume on your speakers/ headphones?
I agree very low volume. I have tried on multiple devices with 100% volume
Micah!
It's jhoooon marstooon!
Hello, jhooon marstooon!! 👋
thank you for this video it helps me a lot , but i have a question , can astropy fit light curves using spectral models ? please answer me
Hi! Sorry I haven't replied to your comment--I just moved apartments, and haven't had much time to upkeep my channel! You can use the Gammapy package to model light curves. Here's a link to a tutorial that might be useful: docs.gammapy.org/0.9/notebooks/light_curve.html hope this helps!
why you not add NGC 2323 ? can you provide this data ?
Good day sir! I would like to ask about where you downloaded the fits file. I tried downloading mine at MAST yet it says "none" when I tried the image_data part. Thank you!
I found mine here archive.stsci.edu/prepds/hugs/
I've tried doing this with jpeg images that I converted to FITS but apparently they're only a "RGB" images so trying to submit only a length and height alone does not work. In particular I was looking for a way to make the y-axis display anything other than a zero height while the x-axis displayed just fine. And when I pass values in the image_data brackets theres three of them that need to put in.
It sounds like your fits image may be corrupted or is not formatted in a way that Astropy expects. Astropy expects images in a 2D array, not RGB images. I would suggest finding a fits image that has been prepared for data extraction rather than converting a jpeg into a fits image yourself.
@@mic_n_ike If I wanted to prepare images for data extraction myself would that be possible.
@@Orange-qc6ub that depends on what you’re trying to do. If you’re talking about taking a regular jpeg and making it into something that can be manipulated with Astropy, that process would be very involved, and I don’t think I would know exactly how to do it. Fits files contain something called a header, which is a very messy text block. You would probably need to make the header up by hand, because a jpeg would not have one. You would also have to find some way to transform the RGB jpeg into a 2D array.
it's asking for license in windows to set up visual studio Code,I'm so confused what should I do
You shouldn’t need a license to use VS code, it is an open source software. Please ensure that you are installing the correct application. You can follow the link in the video description to the official download page, or if you are running Windows 11 you can install VS code directly from the Microsoft store. Additionally, please ensure that you are running a legitimate version of windows.
@@mic_n_ike it's showing,pip is not recognized as a file,..
@@ananyaghosh6592 at what point does it say “pip is not recognized as a file?”
I am not clear as to where or in which folder or directory should i save the downloaded FITS file?
It doesn’t matter where you download the fits file, all that matters is that your fits file and your Jupyter notebook are saved in the same folder on your computer :)
@@mic_n_ike thanks.
i cant get the code to read the fits file properly
This is a common issue. Make sure both the Jupyter notebook and the FITS file are saved in your working folder. The FITS file can be saved in a subdirectory within your working folder, but if this is the case, you must include the sub folder name when calling the fits file. For example, if your working folder is “ASTRONOMY” and you have your fits file saved in a folder called “FITS_FILES”, you must make sure your Jupyter notebook is saved directly under “ASTRONOMY” and that the folder “FITS_FILES” is also saved under “ASTRONOMY”. Then, to open your fits file, type “fits.open(“FITS_FILES/ngc1261.fits”)”
@mic_n_ike I'm using pycharm . Yes the file is in the working folder.
@@mic_n_ike but the problem is it is compressed.
@@rverm1000 I’m afraid I’m not familiar with PyCharm, but it sounds like you might just need to extract the downloaded fits file with a program like 7zip