4.2 Input parameters

Where to start ?

The photometry script is contained in the file “05_photometry\photometry_run.py”. To execute the script, just edit the file, modify the input parameters, save the updated file and execute the script by double-click on the file icon in Windows.

The following 3 input parameters must be provided:

  • the names of the input images
  • the sizes of the disks for photometry
  • a generic name to be used to create the output files

Names of the input images

The input images must be provided in a list, as follows:

Imagelist = ['C:\\image1.fit', 'C:\\image2.fit', 'C:\\image3.fit']

In fact, exactly the same list is obtained with this statement:

Imagelist = ['C:\\image' + str(i+1) + '.fit' for i in range(3)]

This technique used to construct the image list is called a “list comprehension” (it is further described on the Python website, at this link). It is very powerful, and allows to specify any number of images. For instance this list contains 700 images:

Imagelist = ['C:\\image' + str(i+1) + '.fit' for i in range(700)]

The list comprehension can be more elaborate:

Imagelist = ['C:\\image' + str(i+1) + '.fit' for i in range(700) if i+1 not in [233,242,423,433]]

Of course a separate variable can be used to store the path:

Path = 'C:\\Desktop\\24Jan2010\\ProcessedImages\\'
Imagelist = [Path + 'image' + str(i+1) + '.fit' for i in range(100)]

Be careful, in Python the path or filenames with non-ASCII characters do not work by default. To use them, the string must be preceded by a ‘u’ (for Unicode), as in the example below where accents are required in the name of the path.

Path = u"C:\\Desktop\\Jerome\\24Jan2010\\ProcessedImages\\"
Imagelist = [Path + 'image' + str(i+1) + '.fit' for i in range(100)]

Disk sizes for photometry

To do photometry we need 3 different disk sizes:

  • the first size is the radius (in pixels) of the internal disk : all the pixel inside this disk are summed to get the star signal
  • the second and third size correspond to the internal and external radii (in pixels) of a ring. The median value of all pixels inside this ring corresponds to the sky background

Since the script is using several disk sizes in parallel, we must provide a list of such sets of 3 radii. For instance, we can write:

sizes = [[2,8,40],[2.5,8,40],[3,8,40],[3.5,8,40],[4,8,40],[4.5,8,40],[5,8,40]]

Or, for one single set of photometry disks:

sizes = [[3,8,40]]

Generic name for output files

Finally, the user must provide a generic name that will be used to create the names of the output files. For instance, if the user provides:

generic_name = 'C:\\Desktop\\24Jan2010\\ProcessedImages\\Target-'

Then the output files will have the following names (assuming that one moving object was selected):

  • C:\Desktop\24Jan2010\ProcessedImages\Target-01_check_images.txt
  • C:\Desktop\24Jan2010\ProcessedImages\Target-02_image_shifts.txt
  • C:\Desktop\24Jan2010\ProcessedImages\Target-03_selected_stars.pdf
  • C:\Desktop\24Jan2010\ProcessedImages\Target-04_inst_magnitudes.txt
  • C:\Desktop\24Jan2010\ProcessedImages\Target-05_best_diff_magnitudes_moving_object_1.txt
  • C:\Desktop\24Jan2010\ProcessedImages\Target-06_CDRCDLreport_moving_object_1.txt

Table Of Contents

Previous topic

4.1 Assumptions

Next topic

4.3 Running the photometry script

This Page