Atmospheric Toolbox

NoDataError HARP

Hi, im working with S5P methane files, and when i run the code below, i get an error saying “NoDataError: product contains no variables, or variables without data”…
Any idea why this might be?

Thankyouuu

for i in input_files_sept:
harp_L2_L3_sept = harp.import_product(i, operations="
CH4_column_volume_mixing_ratio_dry_air_validity>50;
derive(datetime_stop {time});
latitude > 43 [degree_north] ; latitude < 52 [degree_north] ; longitude > 16
[degree_east] ; longitude < 32 [degree_east];
bin_spatial(110,43,0.1,160,16,0.1);
derive(latitude {latitude}); derive(longitude {longitude});
keep(CH4_column_volume_mixing_ratio_dry_air)")

export_folder_sept = " 
{export_path_sept}/{name}".format(export_path_sept=export_path_sept, 
name=i.split('/')[-1].replace('L2','L3'))
harp.export_product(harp_L2_L3_sept, export_folder_sept, file_format='netcdf')

I think your issue is the same as this one.
You probably just didn’t have any good enough measurements for the time period and area you were looking for.

when i changed the validity to 0 (CH4_column_volume_mixing_ratio_dry_air_validity>0) to see if there’s a difference, i still got the same error. Is it possible that for 2 whole months (sept and oct 2019) there isn’t a single good measurement?

You seem to run the harp.import_product file by file. As soon as you have the error for one file, you will get the error and the loop will end. This is normal Python behaviour.
You probably want to put things in a ‘try/catch’ block.

Also have a look at some of the older posts on this forum. There are plenty of examples that deal with creating L3 data from L2 (including combining multiple orbits into daily or monthly averages).

I found a solution, its a bit impractical, but it worked.
I did separate daily folders, and ran the for loop for each folder, and its weird because when I did that I got no errors and it worked perfectly for all files, but when I did the whole month at once it didnt work… Any idea why that might be?