Autogalaxy
跳到导航
跳到搜索
PyAutoGalaxy is an open-source Python 3.8+ package for analysing the morphologies and structures of large multi-wavelength galaxy samples.
详见 https://pyautogalaxy.readthedocs.io/
学习笔记
Array2d/Mask2D/Kernel2D
- Array2D:为图像数据定义的一类二维数组类,包含了pixelsize信息,并可以同时包含mask信息
ima_2d = aa.Array2D.no_mask(values=Agemap[0],shape_native=Agemap[0].shape,pixel_scales=0.5) mask_2d = aa.Mask2D(mask=~mask,shape_native=Agemap[0].shape,pixel_scales=0.5) noise_2d = aa.Array2D.no_mask(values=vflux**0.5+0.01,shape_native=Agemap[0].shape,pixel_scales=0.5)
- Mask2D中 True值是指被mask掉 (下面例子中mask是一个booltype的ndarray,True是指保留)
ima_2d = ima_2d.apply_mask(mask=mask_2d) noise_2d = noise_2d.apply_mask(mask=mask_2d)
- psf是Kernel2D类型
psf_2d = ag.Kernel2D.from_gaussian(shape_native=(10, 10), sigma=1.5, pixel_scales=0.5)
详见 https://pyautogalaxy.readthedocs.io/en/latest/api/_autosummary/autogalaxy.Array2D.html
imaging
- 基于array_2d生成的图像类,必须同时具有原始图像数据,和noisemap,同时psf信息可选
imaging=ag.Imaging(image=ima_2d,noise_map=noise_2d,psf=psf_2d)
- 可以直接对imaging对象做mask
imaging = imaging.apply_mask(mask=mask_2d)
- Imagingplotter
- visuals_2d (Visuals2D) – Contains 2D visuals that can be overlaid on 2D plots.
- include_2d (Include2D) – Specifies which attributes of the Imaging are extracted and plotted as visuals for 2D plots.
Grid
grid_2d = ag.Grid2D.uniform(shape_native=Agemap[0].shape, pixel_scales=0.5).5)