Atmospheric Toolbox

Convert product to an array


I am doing my final master’s thesis, here are the problems I am encountering.

  • After downloading the sentienel-5P satellite, with this code:

api = SentinelAPI(‘XXXXX’, ‘XXXXX’, ‘’)
map = geojson_to_wkt(read_geojson(‘spainspain.geojson’))

products = api.query(map,
date=(date(2020, 1, 2), date(2020,8, 8)),


I manage to download the products with their metadata, I would like to be able to work with them from python i.e. select latitude,longitude, time and nitrogendioxide_tropospheric_column and convert it to dataframe to work.

I am trying this:
data3 = ‘C:/Escritorio/’
fh0 = Dataset(data3, mode=‘r’)


lat = lat.to_dataframe()

AttributeError: NetCDF: Attribute not found.

In short what I am looking for is to work with sentienel data in dataframe.

Thank you very much.

This forum is more focused on using the atmospheric toolbox to access S5P data (using e.g. HARP).
Maybe another user on the forum can provide you a solution.

Good morning Sebastian,

I am guessing that your
command has a syntax error.

I admit to be using a much more… basic function, i.e.

reads in the TROPOMI ncdf file [=fname] from the path it is located

file = Dataset(path+fname,“r”)

reads in the latitude and longitude arrays

lat= file[“latitude”][:]
lon= file[“longitude”][:]

or if you wish to turn them into numpy arrays

read in the lat/lon of the file

lat = np.array(file[“latitude”][:])
lon = np.array(file[“longitude”][:])

I have no experience with “to_dataframe” and cannot help with that bit, but from the error I am guessing that the reading is not performed properly, not the translation into a dataframe object.

Good luck,

1 Like

Thank you. I will try your method.