Контурный график и Cartopy — вид с геостационарного спутника [графики и код]Python

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Контурный график и Cartopy — вид с геостационарного спутника [графики и код]

Сообщение Anonymous »


I have data which is in X,Y co-ordinates that is transformed from spherical co-ordinates and I am trying to plot a contour of this data on top of a globe which I have taken from Cartopy. But its not working and I have been trying for a few hours googling and attempts at this! Any suggestions would be greatly appreciated.

Code is here and numpy file of the data is here.

Numpy file for plotting

There are sample plots in below links too

import numpy as np import matplotlib.pyplot as plt # import cartopy.feature as cf import cartopy.crs as ccrs import cartopy.feature as cf plt.close('all') #%% Co-ordindate System resolution = 201 theta = np.linspace(-90, 90, num=resolution) * np.pi/180 phi = np.linspace(0, 360, num=resolution) * np.pi/180 theta_grid, phi_grid = np.meshgrid(theta,phi) u_grid = np.sin(theta_grid) * np.cos(phi_grid) v_grid = np.sin(theta_grid) * np.sin(phi_grid) #%% Load Numpy array of data AF = np.load('Plotted_data.npy') c = np.arange(np.min(AF),np.max(AF),0.25) #%% Plots fig = plt.figure('UV') ax = fig.add_subplot(111) plt.contourf(u_grid,v_grid,AF,c,extend="both", cmap = 'Spectral_r') #plasma #gnuplot2 plt.colorbar(label ='Directivity (dBi)') ax.set_xlabel('u = sin(theta)cos(phi)') ax.set_ylabel('v = sin(theta)sin(phi)') ax.legend(loc=1) projection=ccrs.Geostationary(central_longitude=0.0, satellite_height=35785831) fig = plt.figure('No Overlay') ax = plt.axes(projection=projection) ax.add_feature(cf.COASTLINE) plt.show() fig = plt.figure('Attempt to Overlay') ax = plt.axes(projection=projection) plt.contourf(u_grid,v_grid,AF,c,extend="both", cmap = 'Spectral_r', alpha = 0.2) #plasma #gnuplot2 ax.add_feature(cf.COASTLINE) plt.show() Example plots of the data and the failing to overlay countour onto globe

Data Contour Plot in XY transform of spherical coordinates:


Изображение


The Globe I want to plot a contour on top of:


Изображение


I have tried many times googling the problem, Cartopy website, posts on stackexchange but I have not got this working yet... any suggestions greatly appreciated.


Источник: https://stackoverflow.com/questions/781 ... s-and-code
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Как разрезать 2D-линейный график, чтобы создать 3D-график поверхности (или контурный график)? Питон
    Anonymous » » в форуме Python
    0 Ответы
    73 Просмотры
    Последнее сообщение Anonymous
  • Расчет положения спутника GPS из файла навигации Rinex создает неожиданные графики ECI/ECEF
    Anonymous » » в форуме Python
    0 Ответы
    2 Просмотры
    Последнее сообщение Anonymous
  • Как добавить линию x=y на контурный график?
    Гость » » в форуме Python
    0 Ответы
    30 Просмотры
    Последнее сообщение Гость
  • Контурный график меняется при изменении диапазона
    Anonymous » » в форуме Python
    0 Ответы
    14 Просмотры
    Последнее сообщение Anonymous
  • Контурный график меняется при изменении диапазона
    Anonymous » » в форуме Python
    0 Ответы
    27 Просмотры
    Последнее сообщение Anonymous

Вернуться в «Python»