Fix grammar errors (simple past tense of cast is 'cast', not 'casted')
Do not use os.getlogin()

The os.getlogin() function, it turns out, is just a thin wrapper
around the getlogin() system call, and therefore not as portable as we
could expect: OSError is raised if the platform getlogin() fails: it
returns NULL and sets errno to ENOENT, which strerror() converts to
"No such file or directory." [1] Also, os.getlogin() fails when run
from cron, as in these cases there is no controlling terminal.

To overcome this, we can follow the recommendation made in the Python
docs, where it is stated that: "For most purposes, it is more useful
to use the environment variable LOGNAME to find out who the user is,
or pwd.getpwuid(os.getuid())[0] to get the login name of the currently
effective user id."

[1] http://mail.python.org/pipermail/python-bugs-list/2002-July/012691.html
Add LEMONdB.id property — unique identifier of the LEMONdB

This property encapsulates the LEMONdB._get_id and _set_id non-public
methods, getter and setter of the 'ID' record in the METADATA table.
It is intended to store a unique identifier of the LEMONdB, which we
set after doing photometry: the MD5 hash (a 32-digit hexadecimal
number) of the concatenation, in this order, of the LEMONdB.date,
author and hostname properties.
Write identifier of the LEMONdB to the AmplitudesSearchPage XML file

Add a second attribute to the root element of the XML representation
of the AmplitudesSearchPage object: 'database_id', which is assigned
the value of LEMONdB.id, the unique identifier of the database. In
this manner, the results of the search can be linked to a specific
database — this will allow us to prevent the user from loading an XML
file with results for a LEMONdB other than the one currently open.
Do not load AmplitudesSearchPage XML files with a different identifier

Take into account the unique identifier of the LEMONdB, stored in the
'database_id' attribute of the root element, when an XML file with a
serialized AmplitudesSearchPage object is opened. If the identifier
does not match that of the current LEMONdB, if any, an error message
is displayed, informing the user that the XML file cannot be opened
because it contains results for a different database.
Use the observed field to suggest a filename in ExportCurveDialog

Include the name of the observed field in the filename suggested by
the gtk.FileChooserDialog when the light curve of a star is saved to a
plain-text file in the ExportCurveDialog.run method. This requires the
modification of __init__, as it must receive an additional argument
with the name of the field, determined by LEMONdB.field_name.
Use the observed field to suggest a filename in AmplitudesSearchPage

Take the name of the observed field into consideration when suggesting
a filename in AmplitudesSearchPage.export_to_file. This requires the
modification of __init__, to receive an additional argument with the
name of the field, as well as the addition of a new element, 'field',
to the structure of the XML to which AmplitudesSearchPage objects are
serialized.
Include the name of the field in the AmplitudesSearchPage description
Add CANDIDATE_PARAMETERS table

This table will be used to store in the LEMONdB the contents of the
XML file, output by the annuli module, with the candidate parameters
for aperture photometry that were evaluated for each photometric
filter. It maps each set of photometric parameters (stored in the
PHOTOMETRIC_PARAMETERS table) to a filter (PHOTOMETRIC_FILTERS) to the
standard deviation of the light curves of the constant stars that were
used to determine how good the parameter set is.
Add LEMONdB.add_candidate_pparams method

The method adds a new record to the CANDIDATE_PARAMETERS table. Note
that a set of photometric parameters (aperture, annulus and dannulus)
can only map to a standard deviation for each photometric filter, so
adding two CandidateAnnuli objects for the same filter with the same
aperture, annulus and dannulus, but different standard deviations,
will replace the first one with the second.
Add LEMONdB.get_candidate_pparams method

The method returns a list with all the CandidateAnnuli objects that
have been stored in the CANDIDATE_PARAMETERS table for a specific
photometric filter. These are sorted in increasing order by the
standard deviation of the light curves of the constant stars that were
used to determine how good the parameters are (CandidateAnnuli.stdev).
Add CandidateAnnuli.__eq__ comparison operator
Add CandidateAnnuli.__ne__ comparison operator
Add unit test for the LEMONdB.add_ and get_candidate_pparams methods
Remove 'best_only' parameter from CandidateAnnuli.xml_load method

Now that we intend to store all the candidate photometric parameters
in the LEMONdB, the 'best_only' parameter of CandidateAnnuli.xml_load
is not necessary anymore, as we will always need to parse the entire
XML file. The small size of these XML files means that performance
will not suffer, neither now nor in the foreseeable future, even if
all the CandidateAnnuli, and not only the best ones, are loaded.
Sort lists returned by CandidateAnnuli.xml_load by standard deviation

The CandidateAnnuli.xml_load static method returns a dictionary which
maps each photometric filter to a list of CandidateAnnuli objects. As,
since commit d8710928a58c2f2459bf, the method always returns all the
candidate photometric parameters in the XML file, we need a way to
straightforwardly identify which one is the best (and therefore the
one that we should use to do photometry) for each filter.

To achieve this, sort these lists in increasing order by the standard
deviation of the light curves of the constant stars that were used to
determine how good the parameters are (CandidateAnnuli.stdev). In this
manner, the first CandidateAnnuli of each list is always the best one.
Store the contents of the annuli XML file in the LEMONdB
Fix bug in LightCurveTest.test_ignore_noisy unit test

In case all of the points of a LightCurve have a signal-to-noise ratio
below the random threshold, the ValueError exception ("need more than
0 values to unpack") is raised when we try to unzip the Unix times,
magnitudes and SNRs of the LightCurve returned by ignore_noisy.
Fix bug in ImageTest.nrandom class method

The invariant that in no case two returned random Images have the same
Unix time and photometric filter does not always hold: this is exactly
what happens if the randomly-selected Unix time to reuse exhausts all
the photometric filters — in other words, if the Unix time has already
been reused for all possible filters. To fix this it is necessary not
to modify the Unix time of the random Image until we have made sure
that there is a photometric filter in which it has not yet been used.