*determine which ATLAS nights require to be cached locally*

        **Key Arguments:**
            - ``days`` -- the number of days data to cache locally

        **Return:**
            - ``mjds`` -- a list of the MJDs to be downloaded from the ATLAS datastore in hawaii

def _determine_mjds_to_download(
            self,
            days):
        """*determine which ATLAS nights require to be cached locally*

        **Key Arguments:**
            - ``days`` -- the number of days data to cache locally

        **Return:**
            - ``mjds`` -- a list of the MJDs to be downloaded from the ATLAS datastore in hawaii
        """
        self.log.info('starting the ``_determine_mjds_to_download`` method')

        # COUNT DOWNLOADED NIGHTS
        sqlQuery = u"""
            SELECT DISTINCT
                FLOOR(mjd) AS mjdInt
            FROM
                atlas_exposures
            WHERE
                local_data = 1
        """ % locals()
        mjds = readquery(
            log=self.log,
            sqlQuery=sqlQuery,
            dbConn=self.atlasMoversDBConn,
            quiet=False
        )

        if len(mjds) >= int(days):
            print "%(days)s nights of ATLAS data already cached locally" % locals()
            return []

        if self.dev_flag:
            dev_flag = "and dev_flag = 1"
        else:
            dev_flag = ''

        # RETURN THE REMAINING NIGHT MJDS NEEDING DOWNLOADED
        remainingDownloadCount = int(days) - len(mjds)
        sqlQuery = u"""
            SELECT DISTINCT mjdInt from (
(SELECT DISTINCT
                FLOOR(mjd) AS mjdInt
            FROM
                atlas_exposures
            WHERE
                local_data = 0 and dophot_match = 0 %(dev_flag)s
UNION ALL
SELECT DISTINCT
                FLOOR(mjd) AS mjdInt
            FROM
                day_tracker
            WHERE
                processed = 0 %(dev_flag)s) as a) where mjdInt not in (SELECT
                        *
                    FROM
                        (SELECT DISTINCT
                            FLOOR(mjd)
                        FROM
                            atlas_exposures
                        WHERE
                            local_data = 1) AS a) order by mjdInt asc limit %(remainingDownloadCount)s;
        """ % locals()

        rows = readquery(
            log=self.log,
            sqlQuery=sqlQuery,
            dbConn=self.atlasMoversDBConn,
            quiet=False
        )

        mjds = []
        mjds[:] = [int(r["mjdInt"]) for r in rows]

        self.log.info('completed the ``_determine_mjds_to_download`` method')
        return mjds