Submit likelihood analyses on a set of coordinates. If
        coords is `None`, submit all coordinates in the footprint.

        Inputs:
        coords : Array of target locations in Galactic coordinates. 
        queue  : Overwrite submit queue.
        debug  : Don't run.

def submit_all(self, coords=None, queue=None, debug=False):
        """
        Submit likelihood analyses on a set of coordinates. If
        coords is `None`, submit all coordinates in the footprint.

        Inputs:
        coords : Array of target locations in Galactic coordinates. 
        queue  : Overwrite submit queue.
        debug  : Don't run.
        """
        if coords is None:
            pixels = np.arange(hp.nside2npix(self.nside_likelihood))
        else:
            coords = np.asarray(coords)
            if coords.ndim == 1:
                coords = np.array([coords])
            if coords.shape[1] == 2:
                lon,lat = coords.T
                radius  = np.zeros(len(lon))
            elif coords.shape[1] == 3:
                lon,lat,radius = coords.T
            else:
                raise Exception("Unrecognized coords shape:"+str(coords.shape))

            #ADW: targets is still in glon,glat
            if self.config['coords']['coordsys'].lower() == 'cel':
                lon,lat = gal2cel(lon,lat)

            vec = ang2vec(lon,lat)
            pixels = np.zeros(0, dtype=int)
            for v,r in zip(vec,radius):
                pix = query_disc(self.nside_likelihood,v,r,inclusive=True,fact=32)
                pixels = np.hstack([pixels, pix])
            #pixels = np.unique(pixels)

        inside = ugali.utils.skymap.inFootprint(self.config,pixels)
        if inside.sum() != len(pixels):
            logger.warning("Ignoring pixels outside survey footprint:\n"+str(pixels[~inside]))
        if inside.sum() == 0:
            logger.warning("No pixels inside footprint.")
            return

        # Only write the configfile once
        outdir = mkdir(self.config['output']['likedir'])
        # Actually copy config instead of re-writing
        shutil.copy(self.config.filename,outdir)
        configfile = join(outdir,os.path.basename(self.config.filename))

        pixels = pixels[inside]
        self.submit(pixels,queue=queue,debug=debug,configfile=configfile)