0

I have observation data from a satellite called Aeolus. The data are single arrays. So one 1D array for date and time, one for latitude information, one for longitude information and one for wind speed.

date_aeolus
lat_aeolus
lon_aeolus
wind_aeolus

In the end I would like to create a pcolormesh lat - lon plot of the wind speed. But therefore I need the wind speed as 2D:

wind_aeolus[lat,lon]

How can I create such an array?

  • I think you are looking for something like `zip` function, you can use it as follows: `zip(lat_aeolus,lon_aeolus)` – Meh Dec 10 '19 at 14:02
  • In the general case, you may need to use interpolation. But possibly, your arrays have a certain structure, which would allow for reshaping. Check [this](https://stackoverflow.com/a/43407498/4124317). – ImportanceOfBeingErnest Dec 10 '19 at 14:06

1 Answers1

0

if you are looking to just make a 2D array, a couple for loops should work fine.

lat = ['1', '2', '3']
lon = ['2', '3', '4']

Array = []

for i in range(0, len(lat)) :
    Array.append([lat[i]])

for i in range(0, len(Array)) :
    Array[i].append(lon[i])

The zip() function also works well in this situation, like @user2977071 said.

zip(lat, lon)
CanadianCaleb
  • 136
  • 10