本文整理汇总了Python中astrodata.AstroData.phu方法的典型用法代码示例。如果您正苦于以下问题:Python AstroData.phu方法的具体用法?Python AstroData.phu怎么用?Python AstroData.phu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astrodata.AstroData
的用法示例。
在下文中一共展示了AstroData.phu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_attr_phu_3
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import phu [as 别名]
def test_attr_phu_3():
""" setter """
ad = AstroData(TESTFILE)
ad.phu = phu
assert ad.phu == phu
示例2: as_astrodata
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import phu [as 别名]
def as_astrodata(self, extname=None, tile=False, block=None, return_ROI=True,
return_associated_bintables=True, return_non_associations=True,
update_catalog_method='wcs'):
"""
Returns an AstroData object containing by default the mosaiced
IMAGE extensions, the merged associated BINTABLEs and all other
non-associated extensions of any other type. WCS information in
the headers of the IMAGE extensions and any pixel coordinates in
BINTABLEs will be updated appropriately.
:param extname: If None mosaic all IMAGE extensions. Otherwise
only the given extname. This becomes the ref_extname.
:type extname: (string). Default is None
:param tile: (boolean). If True, the mosaics returned are not
corrected for shifting and rotation.
:param block: See description below in method 'mosaic_image_data'.
:param return_ROI: (True). Returns the minimum frame size calculated
from the location of the amplifiers in a given block. If False uses
the blocksize value.
:param return_associated_bintables: (True). If a bintable is associated
to the ref_extname then is returned as a merged table in the
output AD. If False, they are not returned in the output AD.
:param return_non_associations (True). Specifies whether to return
extensions that are not deemed to be associated with the ref_extname.
:param update_catalog_method: ('wcs'). Specifies if the X
and Y pixel coordinates of any source positions in the BINTABLEs
are to be recalculated using the output WCS and the sources R.A.
and Dec. values within the table. If set to 'transform' the updated X
and Y pixel coordinates will be determined using the transformations
used to mosaic the pixel data. In the case of tiling, a shift is
technically being applied and therefore update_catalog_method='wcs'
should be set internally (Not yet implemented).
:type update_catalog_method: (string). Possible values are
'wcs' or 'transform'.
"""
# If extname is None create mosaics of all image data in ad, merge
# the bintables if they are associated with the image extensions
# and append to adout all non_associatiated extensions. Appending
# these extensions to the output AD is controlled by
# return_associated_bintables and return_non_associations.
# Make blank ('') same as None; i.e. handle all extensions.
if extname == '': extname = None
if (extname != None) and (extname not in self.extnames):
raise ValueError("as_astrodata: Extname '"+extname+\
"' not found in AD object.")
adin = self.ad # alias
# Load input data if data_list attribute is not defined.
#if not hasattr(self, "data_list"):
# self.data_list = self.get_data_list(extname)
adout = AstroData() # Prepare output AD
adout.phu = adin.phu.copy() # Use input AD phu as output phu
adout.phu.header.update('TILED', ['FALSE', 'TRUE'][tile],
'False: Image Mosaicked, True: tiled')
# Set up extname lists with all the extension names that are going to
# be mosaiced and table extension names to associate.
#
if extname is None: # Let's work through all extensions
if self.associated_im_extns:
extname_list = self.associated_im_extns
else:
extname_list = self.im_extnames
else:
self.ref_extname = extname # Redefine reference extname
if extname in self.associated_im_extns:
self.associated_im_extns = [extname] # We need this extname only
extname_list = [extname]
elif extname in self.non_associated_extns:
# Extname is not in associated lists; so clear these lists.
extname_list = []
self.associated_im_extns = []
self.associated_tab_extns = []
elif extname in self.associated_tab_extns:
# Extname is an associated bintable.
extname_list = []
self.associated_im_extns = []
self.associated_tab_extns = [extname]
else:
extname_list = [extname]
# ------ Create mosaic ndarrays, update the output WCS, create an
# AstroData object and append to the output list.
# Make the list to have the order 'sci','var','dq'
svdq = [k for k in ['SCI','VAR','DQ'] if k in extname_list]
#.........这里部分代码省略.........