*parse photometry data from a row in the tns results content*

        **Key Arguments:**
             - ``content`` -- a table row from the TNS results page
             - ``TNSId`` -- the tns id of the transient

        **Return:**
            - ``photData`` -- a list of dictionaries of the photometry data
            - ``relatedFilesTable`` -- a list of dictionaries of transient photometry related files

def _parse_photometry_data(
            self,
            content,
            TNSId):
        """*parse photometry data from a row in the tns results content*

        **Key Arguments:**
             - ``content`` -- a table row from the TNS results page
             - ``TNSId`` -- the tns id of the transient

        **Return:**
            - ``photData`` -- a list of dictionaries of the photometry data
            - ``relatedFilesTable`` -- a list of dictionaries of transient photometry related files 
        """
        self.log.info('starting the ``_parse_photometry_data`` method')

        photData = []
        relatedFilesTable = []

        # AT REPORT BLOCK
        ATBlock = re.search(
            r"""<tr class=[^\n]*?AT reportings.*?(?=<tr class=[^\n]*?Classification reportings|$)""",
            content,
            flags=re.S  # re.S
        )

        if ATBlock:
            ATBlock = ATBlock.group()
            reports = re.finditer(
                r"""<tr class="row-[^"]*"><td class="cell-id">.*?</table>""",
                ATBlock,
                flags=re.S  # re.S
            )

            relatedFiles = self._parse_related_files(ATBlock)

            for r in reports:
                header = re.search(
                    r"""<tr class="row[^"]*".*?time_received">(?P<reportAddedDate>[^<]*).*?user_name">(?P<sender>[^<]*).*?reporter_name">(?P<reporters>[^<]*).*?source_group_name">(?P<surveyGroup>[^<]*).*?ra">(?P<ra>[^<]*).*?decl">(?P<dec>[^<]*).*?discovery_date">(?P<obsDate>[^<]*).*?flux">(?P<mag>[^<]*).*?filter_name">(?P<magFilter>[^<]*).*?related_files">(?P<relatedFiles>[^<]*).*?type_name">(?P<suggestedType>[^<]*).*?hostname">(?P<hostName>[^<]*).*?host_redshift">(?P<hostRedshift>[^<]*).*?internal_name">(?P<objectName>[^<]*).*?groups">(?P<survey>[^<]*).*?remarks">(?P<sourceComment>[^<]*)""",
                    r.group(),
                    flags=0  # re.S
                )
                try:
                    header = header.groupdict()
                except:
                    print r.group()
                header["TNSId"] = TNSId

                del header["reporters"]
                del header["surveyGroup"]
                del header["hostName"]
                del header["hostRedshift"]
                del header["mag"]
                del header["magFilter"]
                del header["obsDate"]
                del header["ra"]
                del header["dec"]

                if not self.comments:
                    del header['sourceComment']
                else:
                    theseComments = header[
                        "sourceComment"].split("\n")
                    header["sourceComment"] = ""
                    for c in theseComments:
                        header["sourceComment"] += " " + c.strip()
                    header["sourceComment"] = header[
                        "sourceComment"].strip().replace('"', "'")[0:750]

                phot = re.finditer(
                    r"""<tr class="row\-[^"]*".*?obsdate">(?P<obsdate>[^<]*).*?flux">(?P<mag>[^<]*).*?fluxerr">(?P<magErr>[^<]*).*?limflux">(?P<limitingMag>[^<]*).*?unit_name">(?P<magUnit>[^<]*).*?filter_name">(?P<filter>[^<]*).*?tel_inst">(?P<telescope>[^<]*).*?exptime">(?P<exptime>[^<]*).*?observer">(?P<observer>[^<]*).*?-remarks">(?P<remarks>[^<]*)""",
                    r.group(),
                    flags=0  # re.S
                )
                filesAppended = False
                for p in phot:
                    p = p.groupdict()
                    del p["observer"]

                    if p["limitingMag"] and not p["mag"]:
                        p["mag"] = p["limitingMag"]
                        p["limitingMag"] = 1
                        p["remarks"] = p["remarks"].replace(
                            "[Last non detection]", "")
                    else:
                        p["limitingMag"] = 0

                    if not self.comments:
                        del p["remarks"]

                    p.update(header)

                    if p["relatedFiles"] and filesAppended == False:
                        filesAppended = True
                        for f in relatedFiles:
                            # ORDER THE DICTIONARY FOR THIS ROW OF
                            # RESULTS
                            thisFile = collections.OrderedDict()
                            thisFile["TNSId"] = TNSId
                            thisFile["filename"] = f[
                                "filepath"].split("/")[-1]
                            thisFile["url"] = f["filepath"]
                            if self.comments:
                                thisFile["comment"] = f[
                                    "fileComment"].replace("\n", " ").strip().replace('"', "'")[0:750]
                            thisFile["dateObs"] = p["obsdate"]
                            thisFile["spec1phot2"] = 2
                            relatedFilesTable.append(thisFile)

                    if not p["survey"] and not p["objectName"]:
                        p["survey"] = p["sender"]

                    del p["relatedFiles"]
                    del p["sender"]

                    # ORDER THE DICTIONARY FOR THIS ROW OF RESULTS
                    orow = collections.OrderedDict()
                    keyOrder = ["TNSId", "survey", "obsdate", "filter", "limitingMag", "mag", "magErr",
                                "magUnit", "suggestedType", "telescope", "exptime", "reportAddedDate"]
                    for k, v in p.iteritems():
                        if k not in keyOrder:
                            keyOrder.append(k)
                    for k in keyOrder:
                        try:
                            orow[k] = p[k]
                        except:
                            self.log.info(
                                "`%(k)s` not found in the source data for %(TNSId)s" % locals())
                            pass

                    photData.append(orow)

        self.log.info('completed the ``_parse_photometry_data`` method')
        return photData, relatedFilesTable