def pix2sky(self, pixel, degrees_or_equatorial='degrees'): r""" Calculates the Coordinates of a given Pixel. Parameters ---------- pixel : list Pixel of the map; [x, y]. degrees_or_equatorial : string Either ``"degrees"`` or ``"equatorial"``. Choosing the Format of the coordintates to be returnes. Defaults to ``"degrees"``. Returns ------- coordinate : list The coordinates corresponding to pixel. Either in Degrees or in Equatorial coordinates, depending on the parameter *degrees_or_equatorial*. """ # equatorial_to_degrees is only possible to execute if coordinate # is in RA DEC coordinate = self.wcs.wcs_pix2sky([[float(pixel[0]), float(pixel[1])]], 1)[0] if degrees_or_equatorial == 'equatorial': coordinate = astFunc.degrees_to_equatorial(coordinate) return coordinate
def _init_file_to_greg(self): r""" Initial setup, loading all the variables correponding to the cube. """ self.set_defaults() pyclass.comm('file in ' + self.map_name) pyclass.comm('find') pyclass.comm('get first') self._load_class_variables() self.dec_coordinate = self.vars.r.head.pos.bet.__sicdata__ self.ra_coordinate = self.vars.r.head.pos.lam.__sicdata__ # conversion to degrees self.ra_coordinate = self.ra_coordinate * const.r2d self.dec_coordinate = self.dec_coordinate * const.r2d self.central_coordinate_degrees = [self.ra_coordinate, self.dec_coordinate] self.central_coordinate_equatorial = astFunc.degrees_to_equatorial( self.central_coordinate_degrees)