def get_images_by_list(inputlist, release=None, download=None): ''' Get Images by List Gets Marvin Images by an input list. Optionally can download them in bulk. Parameters: inputlist (int): The list of ids to grab images for download (bool): If True, also downloads all the images locally release (str): The release of the data to grab images for Returns: A list of Marvin Images ''' from marvin.tools.image import Image assert isinstance(inputlist, (list, np.ndarray)), 'Input must be of type list or Numpy array' images = Image.from_list(inputlist, release=release) if download: _download_images(images, label='by_list') return images
def get_mass_images(self, return_images=True, barred=True, jbh=False): """ Get images of Mass based MWAs Parameters ---------- return_images: 'bool', optional, must be keyword if True, returns images if False, adds images to class jbh: 'bool', optional, must be keyword if True, uses JBH Stellarr Mass estimate barred: 'bool', optional, must be keyword if True, returns barred galaxies only if False, returns non-barred galaxies only """ if jbh: if barred: images = Image.from_list(self.mass_jbh_mwa_dap["PLATEIFU"]) if return_images: return images else: self.mass_jbh_mwa_images = images else: images = Image.from_list( self.mass_jbh_mwa_nobar_dap["PLATEIFU"]) if return_images: return images else: self.mass_jbh_mwa_nobar_images = images else: if barred: images = Image.from_list(self.mass_mwa_dap["PLATEIFU"]) if return_images: return images else: self.mass_mwa_images = images else: images = Image.from_list(self.mass_mwa_nobar_dap["PLATEIFU"]) if return_images: return images else: self.mass_mwa_nobar_images = images
def test_fromlist(self): plateifu = ['8485-1901', '7443-12701'] images = Image.from_list(plateifu) names = [im.plateifu for im in images] assert plateifu == names