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 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)]
To do photometry we need 3 different disk sizes:
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]]
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):