Frequently Asked Questions

Why does my Mac tell me the DMG file is damaged?

Several users have reported this “feature”, but it is well documented in the
installation instructions for Mac users.

The dmg file is not damaged. You need to temporarily change your

System Preferences > Security & Privacy > General

to “Allow apps to be downloaded from Anywhere”.

See post below related to MacOS Sierra, if applicable.

Can APT display an image from the command line?

Yes! Just bring up a terminal window and execute

APT.csh -i myImage1.fits

On Windows machines, use APT.bat instead.

NOTE: Either the location of APT.csh or APT.bat must be in the PATH or the complete path to the script can be specified on the command line.

How do I process a number of images and source lists non-interactively?

APT can be executed in the batch mode (albeit do not expect fast processing times, such as from SExtractor). In this mode, the GUI will not be displayed. Here is how to do it from a Mac or Unix machine:

APT.csh -i myImage1.fits -s mySourceList1.txt
APT.csh -i myImage2.fits -s mySourceList2.txt
APT.csh -i myImage3.fits -s mySourceList3.txt

For Windows machines, replace “APT.csh” with “APT.bat” above.

Mac users, in addition to the *.dmg file, may want to also install the APT *.tar.gz or *.zip file, which will create a folder where APT.csh is more easily accessible.

Aperture Photometry Tool’s source-list tool should first be executed in the normal (non-batch) mode in order to set up the source-list option: pixel coordinates or (R.A., Dec.) in decimal degrees. You will also need to consider changing input parameters and options on the “More Settings” panel. Saving preferences in the default APT.pref file preserves the settings for subsequent the batch-mode calculations. This will also give you an idea of how long the processing will take (for long source lists and large images, you may want to run them overnight).

What does the “Snap” button do?

The “Snap” button moves the aperture from its current position to the INTEGER pixel coordinates nearest to the centroid. After the snap, the old (X_cen, Y_cen) becomes the new (X, Y) in integer pixel coordinates. The new (X, Y) is fed to the routine that computes the aperture photometry. It also recomputes (X_cen, Y_cen) based on the new (X, Y). In general, the new and old (X, Y) will have different centroids because the center position has shifted; thus, the centroid is a “moving target”, which sometimes does not converge. If you checked the checkbox labeled “Use centroid in photometry calculation?” under the “More Settings” panel, then the photometry calculation will use the new (X_cen, Y_cen) instead of the new (X, Y). So even after the snap, you have the option of using the new (X_cen, Y_cen), which may be different from the old (X_cen, Y_cen).

How do I get the elliptical aperture?

Under the “Preferences” menu, there is an option called “Set Aperture Size, Shape, and Angle” that will bring up a control panel entitled “Elliptical-Aperture Attributes”. There is also a convenient button just to the right of the label “Aperture attributes:” in the left middle of the main GUI panel that will do the same thing.

Click on image to enlarge.

On the “Elliptical-Aperture Attributes” control panel, you have to un-check the circular-aperture checkbox. Then you can use the sliders to set the ellipse parameters. Or, if you change the numbers in the text fields, you will also need to hit the enter or return button for each text -field change. Finally, you need to mouse-click on the “Apply” button.

Remember, the major radius must be greater than or equal to the minor radius; otherwise, the software will assume a circular aperture with the specified major radius.

How is the elliptical-aperture angle measured?

The elliptical-aperture angle is measured with respect to the image pixel rows (or columns), not the world coordinate system that may be included in the header of the image. A positive angle will rotate the ellipse in the counter-clockwise direction.

Is it possible to use APT like a typical UNIX application (i.e., bypassing the GUI entirely)?

Yes, it is possible to run APT.csh from a script, but you must specify an input FITS image via the -i option and an input source-list filename via the -s option (see here for further explanation and additional command-line options available). When executed in this so-called batch mode, the GUI will not be displayed.

To set up APT for running in the batch mode, you need to beforehand save your preferred settings to ~/.AperturePhotometryTool/APT.pref (the default preferences file located in the APT hidden directory in your home directory). Preferences such as whether your source list is in pixels or equatorial coordinates are very important to specify for batch-mode operations.

Here is a Perl one-liner example of running APT.csh in a script:

$ perl -e '@op=`APT.csh -i myImage9.fits -s sourceList9.txt`; print "@op\n";'

APT execution is done via the Perl backtick operator. Standard output is printed after APT terminates. While APT is no where near as fast as compiled source-extraction software (e.g., SExtractor), it is acceptably fast on a newer machine (and impressively fast on my MacBook Pro with a 2.2 GHz Intel Core i7 processor running Lion OS X). The computing speed will, of course, depend on the number of sources in your source list. APT also has a Preferences option that allows multi-threading, to take maximum advantage of the available cores in your CPU.

I couldn’t figure out how to fit the radial profile with pixel data — is there some document to use it?

At the top of the main GUI panel, there is a button labeled “About & Help” that will pop up some documentation. Also, there is similar online documentation. Here are the basic steps for using the radial-profile tool:

  1. Execute APT and open a FITS image.
  2. Mouse-click on a bright, unsaturated, isolated star to overlay an aperture and do an initial aperture-photometry calculation.
  3. Click on the “More Settings” button, select “Model 0 = No aperture interpolation” and “Model A = No sky-background subtraction on the panel that pops up, make sure the “Perform new image-data conversion” check box is NOT checked, click on the “Apply Settings” button, and then click on the “Close Windows” button.
  4. Click on the “Recompute Photometry” button to update the aperture-photometry calculation.
  5. Click on the “Radial Profile” button.
  6. Use the slider on the lower right-hand side of the radial-profile panel to minimize Chi2 for the best radial-profile fit, click on the “Recompute Fit” button, click on the “Save” button, and then click on the “Close” button. The “Set Slider” button can also be used to center the slider on the current value of the sigma parameter of the fit.
  7. The saved radial-profile model can now be used for data interpolation on other stars. To do this, click on the “More Settings” button, select either “Model 1″ or “Model 2″ (two different interpolation modes) on the panel that pops up, click on the “Apply Settings” button, and then click on the “Close Windows” button.
  8. Perform aperture-photometry calculations on other stars with interpolation enabled. This is especially useful for stars that are saturated or have missing pixels.

How and where do I obtain the magnitude zero point for a particular image?

If you don’t have the magnitude zero point, then you cannot compute a star’s apparent magnitude. Without the magnitude zero point, you can only compute what is known as the star’s instrumental magnitude.

The magnitude zero point is found by a process called photometric calibration. There are various methods of photometric calibration, depending on the details of your observations in a given night. In the simplest case, if you have an image that contains stars with known apparent magnitudes (these are called calibrator stars), then you can adjust the magnitude zero point so that Aperture Photometry Tool gives the correct apparent magnitude for each calibrator star. Normally, several calibrator stars are used in the photometric calibration, which results in an average magnitude zero point over the calibrator stars that is more accurate than that obtained from a single calibrator star. For a given camera and telescope, the magnitude zero point, in general, varies from night to night. It also varies with camera filter. If you don’t have images with calibrator stars, then you will not be able to obtain the magnitude zero point.

If you have magnitude zero points for images with calibrator stars at the beginning and the end of your observing session in a given night for the same camera filter, then you can fit the two magnitude zero points of those two images to an equation of a line that is a function of what is called airmass. The resulting coefficient of the airmass term is called the extinction coefficient. The linear formula can then be used to interpolate the magnitude zero point of any image taken with the same camera filter during the observing session, regardless of whether the intervening images contain calibrator stars. This all assumes that your images were acquired under “photometric conditions”, i.e., during which time the observing weather (cloud cover, etc.) did not change substantially.

Here is a tutorial that I found on the Internet that goes into much more detail:

Here is a webpage showing the results of photometric calibration of images taken two different camera filters:

If you are new to photometric calibration, joining a local astronomy club will put you in touch with mentors who can teach you how to do it. That is what I would recommend.

Finally, Aperture Photometry Tool has a tool for simple photometric calibration under the “Tool” menu-bar category. You must supply it with a file containing a list of (RA, Dec, Apparent Magnitude) for your calibrator stars, and another file containing a list of (RA, Dec, Instrumental Magnitude) for the matching calibrator stars in your image.

Why doesn’t APT show my entire image or why are there no scrollbars?

For large images and relatively small screens, you should expect APT to display the image in a window with scrollbars. However, for some operating systems (OSs) and versions of the Java Virtual Machine (JVM), the scrollbars do not always appear automatically. As far as it is known, this is not a problem with APT, but rather the OS or JVM. Try resizing APT’s main-GUI window, as this usually prompts the scrollbars to appear.

How I do workaround a HeadlessException error when running APT in the batch mode?

One user reported using xvfb-run on top of each call to emulate a X virtual frame buffer in the machine.

Another user reported setting the TERMINAL environment variable was needed:

In a bash shell,

export DISPLAY=:0.0

Or in a C shell,

setenv DISPLAY :0.0

Why do reported instrumental magnitudes differ between APT and AIP4WIN?

While APT employs the basic definition in its calculation of instrumental magnitude, AIP4WIN apparently includes an additional term that involves the exposure time of the observation, in seconds (more specifically, AIP4WIN adds +2.5 log10(Texp), where Texp is the exposure time in seconds, to its calculation of basic instrumental magnitude). This is permissible because “instrumental magnitude” can be defined in different ways, and it is up to the user to understand how it is defined by a given application.

Does APT work with Rice-compressed-image FITS files having the .fz filename extension?

Yes! APT has been recently upgraded to handle fpack-compressed FITS files with multiple image extensions. Any .fz file containing image data can be opened by APT directly, the same as with any .fits file containing image data.

How do you install APT on machines running MacOS Sierra?

The old way of getting APT to work on a Mac no longer works seems to work. Instead, you have to do a terminal fix to get the Anywhere option back for Apps downloaded in

System Preferences > Security & Privacy
  1. Close System preferences
  2. Open a Terminal window
  3. Enter
    sudo spctl --master-disable
  4. Enter Password
  5. Click on
    System Preferences > Security & Privacy > Anywhere
  6. Open APT
  7. To restore the higher-security setting, click
    System Preferences > Security & Privacy > Appstore and Identified Developers

This covers it nicely:

Thanks to Ross Cutts for this valuable bit of information.