Introducing MetroPSF – a program for ensemble photometry

Forums Variable Stars Introducing MetroPSF – a program for ensemble photometry

Viewing 20 posts - 1 through 20 (of 48 total)
  • Author
    Posts
  • #574940
    Maxim Usatov
    Participant

    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:

    http://trafyx.com/?p=2669

    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

    #584066
    Michael O’Connell
    Participant

    Hi 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.

    #584067
    Michael O’Connell
    Participant

    Ignore 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!

    #584068
    Maxim Usatov
    Participant

    Michael,

    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

    #584069
    Michael O’Connell
    Participant

    I 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

    #584070
    Maxim Usatov
    Participant

    Very 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.

    #584071
    Nick James
    Participant

    I 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.

    #584072
    Nick James
    Participant

    Yes, 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.

    #584073
    Nick James
    Participant

    I’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.

    #584074
    Michael O’Connell
    Participant

    Yes, 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.

    #584075
    Maxim Usatov
    Participant

    Nick, 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

    #584076
    Maxim Usatov
    Participant

    Sorry, for some reason replied in the wrong thread. This version should open Nick’s FITS fine:

    #584077
    Nick James
    Participant

    Maxim – Thanks that works fine, see attachment. I’ll have a look through your documentation later and will do some experiments on known fields.

    #584079
    Maxim Usatov
    Participant

    Nick, 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.

    #584080
    Michael O’Connell
    Participant

    To 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

    #584081
    Maxim Usatov
    Participant

    For 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.

    #584082
    Nick James
    Participant

    Michael – 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.  

    #584084
    Maxim Usatov
    Participant

    Nick, 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

    #584088
    Nick James
    Participant

    Thanks. I get an error “630 match_mag” when computing the regression model. now.

    #584089
    Maxim Usatov
    Participant

    Nick, 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

Viewing 20 posts - 1 through 20 (of 48 total)
  • You must be logged in to reply to this topic.