本文整理汇总了Python中astrodata.AstroData.pixel_scale方法的典型用法代码示例。如果您正苦于以下问题:Python AstroData.pixel_scale方法的具体用法?Python AstroData.pixel_scale怎么用?Python AstroData.pixel_scale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astrodata.AstroData
的用法示例。
在下文中一共展示了AstroData.pixel_scale方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_finding_an_easier_center
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import pixel_scale [as 别名]
def test_finding_an_easier_center():
ad = AstroData(get_data_file_name("N20060131S0012.fits"))
selection = get_selection_peak(ad.data, (489.07, 478.99), float(ad.pixel_scale()))
predicted_center = selection.get_center()
assert_tolerance(predicted_center,
(489.11025833697016, 478.68088198208636),
tolerance=0.02)
示例2: test_finding_the_center_of_titan
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import pixel_scale [as 别名]
def test_finding_the_center_of_titan():
ad = AstroData(get_data_file_name("N20060131S0011.fits"))
selection = get_selection_peak(ad.data, (391.0, 539.0), float(ad.pixel_scale()))
predicted_center = selection.get_center()
# the object is titan, doesn't have a very clearly defined center
assert_tolerance(predicted_center,
(384.87060478881705, 542.73266988305159),
tolerance=0.07)
示例3: test_out_of_bound_aperture
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import pixel_scale [as 别名]
def test_out_of_bound_aperture():
ad = AstroData(get_data_file_name("N20060131S0012.fits"))
selection = get_selection_peak(ad.data, (10.0, 10.0), float(ad.pixel_scale()))
predicted_center = selection.get_center()
# should be rather non-sense that is returned
assert_tolerance(predicted_center,
(50.0, 50.0),
tolerance=50.0)
示例4: AcquisitionImage
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import pixel_scale [as 别名]
class AcquisitionImage(object):
def __init__(self, filename, mosmask=None, mdfdir=None):
self.ad = AstroData(filename)
self.mosmask = mosmask
self.mdfdir = mdfdir
# Determine extension
nsci = len(self.ad)
debug("...nsci = ", nsci)
if nsci > 1:
l_sci_ext = 1
else:
l_sci_ext = 0
debug("...using extension [" + str(l_sci_ext) + "]")
overscan_dv = self.ad[l_sci_ext].overscan_section()
if self.is_mos_mode():
self.box_coords = parse_box_coords(self, self.get_mdf_filename())
self.box_mosaic = BoxMosaic(self, self.box_coords)
self.scidata = self.box_mosaic.get_science_data()
elif self.is_new_gmosn_ccd():
# tile the 2 center parts of the new GMOS image
self.scidata = gmultiamp(self.ad)
elif not overscan_dv.is_none():
# remove the overscan so we don't have to take it into account when guessing the slit location
self.scidata = subtract_overscan(self.ad[l_sci_ext])
# it still affects the center of rotation however
ox1, ox2, oy1, oy2 = overscan_dv.as_list()
correction = np.array([ox2 - ox1, 0])
center = self.get_binned_data_center() - correction
self.fieldcenter = center * self.detector_y_bin()
else:
self.scidata = self.ad[l_sci_ext].data
@cache
def instrument(self):
return str(self.ad.instrument())
def is_new_gmosn_ccd(self):
header = self.ad.phu.header
if "DETECTOR" not in header:
return False
if header["DETECTOR"] == "GMOS + e2v DD CCD42-90":
return True
return False
def get_science_data(self):
assert self.scidata is not None
return self.scidata
@cache
def unbinned_pixel_scale(self):
return float(self.ad.pixel_scale()) / self.detector_y_bin()
@cache
def binned_pixel_scale(self):
return float(self.ad.pixel_scale())
def _check_binning(self):
if int(self.ad.detector_x_bin()) != int(self.ad.detector_y_bin()):
error("ERROR: incorrect binning!")
error("Sorry about that, better luck next time.")
sys.exit(1)
@cache
def detector_x_bin(self):
self._check_binning()
return int(self.ad.detector_x_bin())
@cache
def detector_y_bin(self):
self._check_binning()
return int(self.ad.detector_y_bin())
@cache
def program_id(self):
return str(self.ad.program_id())
@cache
def observation_id(self):
return str(self.ad.observation_id())
@cache
def saturation_level(self):
dv = self.ad.saturation_level()
return min(dv.as_list())
@cache
def focal_plane_mask(self):
return str(self.ad.focal_plane_mask())
@cache
def grating(self):
return str(self.ad.grating())
#.........这里部分代码省略.........