› Forums › Variable Stars › Introducing MetroPSF – a program for ensemble photometry
- This topic has 47 replies, 6 voices, and was last updated 2 years, 12 months ago by Maxim Usatov.
-
AuthorPosts
-
8 April 2021 at 8:38 pm #574940Maxim UsatovParticipant
Hi All,
I would like to share a small program I wrote, currently called MetroPSF for the lack of better name, for differential ensemble PSF-fitting photometry. Initially wrote a small script to double-check the results I was getting through Astrometrica for the SN 2021gmj, however, thought it may be useful for public, so releasing the source code. It’s a prototype, so the code quality is pretty low, but the results it produces should be ready for analysis. I would appreciate any feedback and suggestions. I thought I’d check if this is of interest to public at all by making a preliminary “alpha” release.
The READ ME file with a brief description and installation instructions as well as the latest version of the program can be found here:
The installation process may seem a bit strange, but it all boils down to installing Python interpreter which is pretty much automatic process, and using pip to install libraries, which is also automatic. This takes a few minutes on both Windows and Unix-like platforms.
MetroPSF works with VizieR and Astrometry.net for retrieving catalogs and solving, and the READ ME file describes a quick use case to familiarize with the interface. The screen shot of the program in action is below – on NGC 3310 with SN 2021gmj.
Maxim
Attachments:
9 April 2021 at 8:09 pm #584066Michael O’ConnellParticipantHi Maxim,
I downloaded the program, extracted it to a directory on my C: drive and installed Python
(I admit to not knowing anything about Python)
However, I’m unclear how to run “pip install -r requirements.txt”
Is that via the command prompt? It just gave an error ‘pip is not recognised…’
Regards,
Michael.
9 April 2021 at 8:16 pm #584067Michael O’ConnellParticipantIgnore that. Got it going now.
Even though I installed python, it didn’t seem to register properly as a program.
I had to go to the Microsoft store to download and install it from there.
Strange!
9 April 2021 at 8:40 pm #584068Maxim UsatovParticipantMichael,
Glad it works. Windows is doing these constant changes – head goes round. Any feedback is much appreciated. Let me know if you’ll have any questions. Version 0.12 is already in the making with the ability to subtract VSX stars from the ensemble and report VSX sources nearby.
Maxim
9 April 2021 at 8:41 pm #584069Michael O’ConnellParticipantI can get the program to run now, but when I open an image, only the FITS header loads in the lower panel – the image itself does not load.
I note that the Command Prompt window states the following:
WARNING: Astrometry.net API key not found in configuration file [astroquery.astrometry_net.core]
WARNING: You need to manually edit the configuration file and add it [astroquery.astrometry_net.core]
WARNING: You may also register it for this session with AstrometryNet.key = ‘XXXXXXXX’ [astroquery.astrometry_net.core]
Exception in Tkinter callback
Traceback (most recent call last):
File “C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0libtkinter__init__.py”, line 1892, in __call__
return self.func(*args)
File “C:metropsfmetropsf.py”, line 593, in update_histogram_high
self.update_display()
File “C:metropsfmetropsf.py”, line 502, in update_display
self.display_image()
File “C:metropsfmetropsf.py”, line 91, in display_image
generate_FITS_thumbnail(self.histogram_slider_low, self.histogram_slider_high, self.zoom_level)
File “C:metropsfmetropsf.py”, line 57, in generate_FITS_thumbnail
generated_image = Image.fromarray(image_data)
NameError: name ‘image_data’ is not defined
9 April 2021 at 9:18 pm #584070Maxim UsatovParticipantVery strange. If you could send me the FITS to maxim.usatov at bcsatellite.net I could take a look what’s up with it. So far it did load all FITS files fine on both of my FreeBSD and Windows computers coming from different remote telescopes.
9 April 2021 at 9:57 pm #584071Nick JamesParticipantI get the same problem trying to install 3.9.4 direct from the Python website into a fresh Win 10 20H2 instance in a VM. Trying to run pip from Powershell gives a “command not recognised” error. Installing from the MS Store worked. The rest of the install then ran smoothly although it did moan about ‘wheel’ not being installed as per the attached screenshot and has various warnings (see screenshot). I’m assuming these are benign. I’ll try out the program now.
9 April 2021 at 10:06 pm #584072Nick JamesParticipantYes, I get the same on Win 10. FITS data but no image. See the attached screenshot. FITS file is attached. Note that it is a gzip compressed fits but I can only attach files with an extension .fits so you may need to change that to fit.gz to get it to work.
9 April 2021 at 10:09 pm #584073Nick JamesParticipantI’ve just converted the FITS that I was using from int16 to float32 and it now works. I have an image. I’ll play around a bit more.
9 April 2021 at 10:28 pm #584074Michael O’ConnellParticipantYes, that works for me now as well. Thanks Nick!
@Maxim: Is there any chance we would get this program to open 8-fits files directly please?
I have a little project in mind involving images from the Global Meteor Network pi camera.
Thanks,
Michael.
10 April 2021 at 12:34 am #584075Maxim UsatovParticipantNick, Michael, thank you very much. This one should open Nick’s FITS fine:
http://trafyx.com/wp-content/uploads/2021/04/metropsf-0.12.zip
10 April 2021 at 12:34 am #584076Maxim UsatovParticipantSorry, for some reason replied in the wrong thread. This version should open Nick’s FITS fine:
10 April 2021 at 6:56 am #584077Nick JamesParticipantMaxim – Thanks that works fine, see attachment. I’ll have a look through your documentation later and will do some experiments on known fields.
10 April 2021 at 9:57 am #584079Maxim UsatovParticipantNick, great! Please don’t hesitate to submit feature requests. I am trying to feel where to take this next. Perhaps, command-line processing… Definitely need a way to save all the settings.
10 April 2021 at 3:04 pm #584080Michael O’ConnellParticipantTo clarify my above point, I get a long error message just when the program opens.
The error is contained in a separate window to the main application.
Also occurs with V0.12 shared above.
Anyone else get it?
WARNING: Astrometry.net API key not found in configuration file [astroquery.astrometry_net.core]
WARNING: You need to manually edit the configuration file and add it [astroquery.astrometry_net.core]
WARNING: You may also register it for this session with AstrometryNet.key = ‘XXXXXXXX’ [astroquery.astrometry_net.core]
Exception in Tkinter callback
Traceback (most recent call last):
File “C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0libtkinter__init__.py”, line 1892, in __call__
return self.func(*args)
File “C:metropsfmetropsf.py”, line 665, in update_histogram_high
self.update_display()
File “C:metropsfmetropsf.py”, line 560, in update_display
self.display_image()
File “C:metropsfmetropsf.py”, line 93, in display_image
generate_FITS_thumbnail(self.histogram_slider_low, self.histogram_slider_high, self.zoom_level)
File “C:metropsfmetropsf.py”, line 56, in generate_FITS_thumbnail
converted_data = image_data.astype(float)
NameError: name ‘image_data’ is not defined
10 April 2021 at 7:08 pm #584081Maxim UsatovParticipantFor the time being just ignore those. I’ll clean things up soon. As long as the program itself works, it shouldn’t impact on anything.
10 April 2021 at 8:25 pm #584082Nick JamesParticipantMichael – Yes, it seems to work fine without the astrometry.net key although my files are already platesolved. Here’s an example of the V1391 Cas field with the fit using V.
Maxim – Could you add Gaia DR2 G to your list of catalogues? Also, the image contrast stretch doesn’t seem to work very well for me.
11 April 2021 at 12:48 am #584084Maxim UsatovParticipantNick, here is 0.13 with Gaia DR2 and non-linear image stretching for better views:
http://trafyx.com/wp-content/uploads/2021/04/metropsf-0.13.zip
Updated user guide PDF inside. Please let me know if you need anything else.Maxim
12 April 2021 at 7:22 am #584088Nick JamesParticipantThanks. I get an error “630 match_mag” when computing the regression model. now.
12 April 2021 at 10:17 am #584089Maxim UsatovParticipantNick, looks like it cannot find the magnitudes of comparison stars in the ensemble. I’ve just went all the way – opening a 16-bit FITS file (ugc7513_000.fits), doing Iteratively Subtracted PSF Photometry, then set catalog to Gaia DR2, CCD Filter to G manually, ran Get Comparison Stars, then Find Regression Model and finally was able to get differential magnitudes by mouse-clicking on the sources. Try removing the old .phot file and executing the same steps. I’m going out of town for a couple of days but hopefully will be able to assist with delays.
Max
-
AuthorPosts
- You must be logged in to reply to this topic.
http://trafyx.com/wp-content/uploads/2021/04/metropsf-0.12.zip