Frequently Asked Questions
- Why does my Mac tell me the DMG file is damaged?
- Can APT display an image from the command line?
- How do I process a number of images and source lists non-interactively?
- What does the “Snap” button do?
- How do I get the elliptical aperture?
- How is the elliptical-aperture angle measured?
- Is it possible to use APT like a typical UNIX application (i.e., bypassing the GUI entirely)?
- I couldn’t figure out how to fit the radial profile with pixel data — is there some document to use it?
- How and where do I obtain the magnitude zero point for a particular image?
- Why doesn’t APT show my entire image or why are there no scrollbars?
- How I do workaround a HeadlessException error when running APT in the batch mode?
- Why do reported instrumental magnitudes differ between APT and AIP4WIN?
- Does APT work with Rice-compressed-image FITS files having the .fz extension?
- How do you install APT on machines running MacOS Sierra?
- How do you work around APT problems on machines running Ubuntu Linux?
- Why does the source-list creation tool get stuck at 75% progress bar?
- How do you install APT on machines running MacOS Catalina?
- How can APT access FITS files in the Mac ~/Desktop folder?
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”.
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.
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:
- Execute APT and open a FITS image.
- Mouse-click on a bright, unsaturated, isolated star to overlay an aperture and do an initial aperture-photometry calculation.
- 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.
- Click on the “Recompute Photometry” button to update the aperture-photometry calculation.
- Click on the “Radial Profile” button.
- 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.
- 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.
- 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,
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 handles 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
- Close System preferences
- Open a Terminal window
- Enter sudo spctl –master-disable
- Enter Password
- Click on System Preferences > Security & Privacy > Anywhere
- Open APT
- 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.
How do you work around APT problems on machines running Ubuntu Linux?
There is some weird incompatibility with Jave 1.8 that is causing a problem when running APT under Ubuntu Linux 16.04. The workaround is to download and install Java 126.96.36.199 from Oracle.
Instead of fiddling with ~/.profile, which affects everything, it might be best to have an executable script in ~/bin, which is listed here:
#! /bin/sh APT_HOME=/usr/local/APT_v2.6.9 PATH=$APT_HOME:/usr/lib/jdk1.6.0_45/jre/bin:$PATH APT_ARCH=LINUX export APT_HOME APT_ARCH PATH exec $APT_HOME/APT.csh
That way you avoid having all kinds of possibly conflicting stuff hanging round your environment and making other programs fall over, particularly ones which depend on the new version of Java.
Thanks to John M. Collins for writing this up.
Why does the source-list creation tool get stuck at 75% progress bar?
When running APT as a Mac double-click application on a large image (4Kx4K pixels), the source-list creation tool may hang with the progress bar stuck at 75%. This is probably because the application ran out of memory. You can increase the memory allocation as follows:
- Right click on the application in the Applications folder
- Select “Show Package Contents”
- Open the file Contents/Info.plist
- Find or expand the section labeled “Java”
- Find the VMOptions line
- Change “-Xmx1024m” to “-Xmx2048m”
- Save and exit
Thanks to Carl Joseph for reporting this problem.
How do you install APT on machines running MacOS Catalina?
The information in this section is dated, but is kept here to provide historical perspective and the security-related instructions may still be pertinent. Do not install Apple Legacy Java 6 if running Aperture Photometry Tool, v. 3.0.0 or higher, because these versions of APT require Java 1.8 or higher. Apple Legacy Java 6 is really only needed if you want the double-clickable APT, v. 2.8.4 (or lower), application. Note that APT, v. 2.8.4 runs fine when launched from a terminal with a java command under Java 1.8 or higher (because of forward compatibility).
This takes a little effort, but it is possible to have APT, v. 2.8.4 (or lower) run as a double-click application under MacOS Catalina. For APT, v. 3.0.0 or higher, do not install the Apple Legacy Java 6 runtime because Java 1.8 or higher is required in this case.
First, install the Apple Legacy Java 6 runtime for MacOS, for APT, v. 2.8.4 or lower only. However, the normal Legacy-Java-6 package you download from Apple will not install under Catalina. So, I followed instructions here and made a special Apple-Legacy-Java-6-runtime-for-MacOS package that you can download from this website here and install.
Next, you have to do a terminal fix to make visible the “Anywhere” option under “Allow apps downloaded from:” on the panel under
System Preferences > Security & Privacy
Here are the instructions you need to follow:
- Close the System Preferences panel
- Open a Terminal window
- Enter the following command: sudo spctl –master-disable
- Enter your login password in the terminal window
- Navigate to the System Preferences > Security & Privacy panel
- Click on the lock icon and enter your login password to make changes
- Click on the now-visible System Preferences > Security & Privacy > Anywhere option
- Click on the lock icon to prevent further changes. Later, to restore the higher-security setting, click on System Preferences > Security & Privacy > Appstore and Identified Developers
Now you can double click on the APT_v*.dmg file (e.g., APT_v2.8.2.dmg) to open it, and then drag the APT application to the /Applications folder.
Finally, you need to modify the extended attributes of the APT-application file to remove the com.apple.quarantine attribute, which is done by opening a terminal window and entering the following command:
sudo xattr -rd com.apple.quarantine /Applications/Aperture\ Photometry\ Tool.app
Enter your login password in the terminal window.
Now double click on the APT application in the /Applications folder (or on the Apple Dock if you put APT there).
How can APT access FITS files in the Mac ~/Desktop folder?Enable this by adding the APT application under
System Preferences > Security & Privacy > Privacy > Full Disk Access