def get_heliocentric_coordinates(self): if self.heliocentric_coordinates is None: x_coords, y_coords = self.get_helioprojective_coordinates() self.heliocentric_coordinates = \ wcs.convert_hpc_hcc(x_coords, y_coords, dsun_meters=self.header["DSUN_OBS"], z=True) return self.heliocentric_coordinates
def test_conv_hpc_hcc(): coord = [40.0, 32.0] result = wcs.convert_hpc_hcc(img.rsun_meters, img.dsun, img.units['x'], img.units['y'], coord[0], coord[1]) known_answer = [28748691, 22998953] magnitude = np.floor(np.log10(np.abs(known_answer))) assert_array_almost_equal(result*10**(-magnitude), known_answer*10**(-magnitude), decimal=2)
def test_conv_hpc_hcc(): coord = [40.0, 32.0] result = wcs.convert_hpc_hcc(img.rsun_meters, img.dsun, img.units['x'], img.units['y'], coord[0], coord[1]) known_answer = [28748691, 22998953] magnitude = np.floor(np.log10(np.abs(known_answer))) assert_array_almost_equal(result * 10**(-magnitude), known_answer * 10**(-magnitude), decimal=2)
def test_conv_hpc_hcc(): coord = [40.0, 32.0] result = wcs.convert_hpc_hcc(img.rsun_arcseconds, img.dsun, img.units['x'], img.units['y'], coord[0], coord[1]) assert_array_almost_equal(result, [28748691, 22998953], decimal=3)
def test_conv_hpc_hcc(): coord = [40.0, 32.0] result = wcs.convert_hpc_hcc(header, coord[0], coord[1]) assert_array_almost_equal(result, [28748691, 22998953], decimal=3)