def toGeographicLonLat(self, x, y): """ convert geographic lat / lon to rotated coordinates """ p = lat_lon.lon_lat_to_cartesian(x, y, R=1) p = self.rot_matrix.T * np.mat(p).T return lat_lon.cartesian_to_lon_lat(p.A1)
def toProjectionXY(self, lon, lat): """ Convert geographic lon/lat coordinates to the rotated lat lon coordinates """ p = lat_lon.lon_lat_to_cartesian(lon, lat, R=1) p = self.rot_matrix * np.mat(p).T return lat_lon.cartesian_to_lon_lat(p.A1)
def get_true_pole_coords_in_rotated_system(self): """ needed for lon_0 in basemap """ rot_pole = self.rot_matrix.T * np.mat([0, 0, 1]).T return lat_lon.cartesian_to_lon_lat(rot_pole.A1)
def get_north_pole_coords(self): """ get true coordinates of the rotated north pole """ rot_pole = self.rot_matrix * np.mat([0, 0, 1]).T return lat_lon.cartesian_to_lon_lat(rot_pole.A1)
def get_south_pol_coords(self): rot_pole = self.rot_matrix * np.mat([0, 0, -1]).T return lat_lon.cartesian_to_lon_lat(rot_pole.A1) pass