Author Topic: Aperture Photometry, Initializing ImageSolver  (Read 1081 times)

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
    • View Profile
Aperture Photometry, Initializing ImageSolver
« on: 2016 June 22 20:55:50 »
When running the Aperture Photometry (AP) script and selecting an image (Add Files) it is required that you first click on Image Solver (IS) configuration.  If you do not do this and immediately run the AP script, then you will get an error from IS saying it cannot solve the plate.  But if you configure Image Solver for the first image then all subsequent images will be okay, i.e., you do not have to configure IS for each of them.

The reason for this I believe is when you run IS it first gets the OBJCTRA and OBJCTDEC values from the image header and writes them to metadata.ra and metadata.dec.  When you run the AP script it calls the IS script which in turn loads the metadata (instead of using OBJCTRA and OBJCDEC from the image), which is then used in the solution.  If you switch to a new set of images then IS will start with the old metadata and the AP script will fail.

So my question is, when I run the AP script and it calls IS, how do I force IS to always use OBJCTRA and OBJECTDEC and not the metadata?

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
    • View Profile
Re: Aperture Photometry, Initializing ImageSolver
« Reply #1 on: 2016 June 22 21:16:06 »
Looking at the Image Solver.js source code I think the problem is due to IS can only read OBJCTRA and OBJCTDEC from an image being displayed and not a file.  If so, is there a function that AP could call to open the file, get OBJCTRA and DEC values and then pass them to IS?  I can edit both the AP and IS scripts.

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
    • View Profile
Re: Aperture Photometry, Initializing ImageSolver
« Reply #2 on: 2016 June 22 22:17:31 »
I found a script, FITSKeywords.js, that could be used by the AP script to get the OBJCTRA and DEC values.  Now all I need is a way to forward them to IS when it is called.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 918
    • View Profile
Re: Aperture Photometry, Initializing ImageSolver
« Reply #3 on: 2016 June 26 03:54:41 »
I have just send a pullrequest to GitHub with a change that I think that will solve you problem. There is a new option in the solver section. The script now have the option of choosing between if you want to use the metadata of the images or the configuration of the solver dialog.

When Juan accept the pullrequest it will can be downloaded from https://github.com/PixInsight/PJSR. I suppose that it will be available from the update system not long after that.

Andrés.

Offline CraigNZ

  • PixInsight Enthusiast
  • **
  • Posts: 94
    • View Profile
Re: Aperture Photometry, Initializing ImageSolver
« Reply #4 on: 2016 June 26 13:34:30 »
Thank you Andres .. that looks great.  I'll keep an eye out for the update.