Atmospheric Toolbox

General coding question | passing a "varying" variable onto HARP | IDL

Even though I am guessing the answer is no, I wanted to make sure: can we pass a “varying” variable into a harp command so that it can be called in iteration? for e.g. with the following I am creating an overpass type file over Thessaloniki for S5P OFFL TOC:

product = harp_import(file,‘O3_effective_temperature>=180.0;O3_effective_temperature<=260.0;O3_column_number_density>=0.0;O3_column_number_density<=0.45;scene_albedo>=-0.5;scene_albedo<=1.5;point_distance(40.6335, 22.9572, 150 [km]);keep(latitude, longitude, solar_zenith_angle,sensor_zenith_angle,O3_column_number_density,O3_column_number_density_uncertainty,O3_effective_temperature,datetime_start,datetime_length, cloud_fraction)’)

Is there a way to pass as named variables the values for lat and lon so that I can then place this harp command in a loop that will create many overpass type files without me explicitly writing the lat/lon out each time?



I am not sure I understand the need. You can quite easily create a loop in IDL and just construct an updated harp operations string with different lat/lon values.
This is exactly what is being done (but then in Python) for the Validation Server within the S5P-MPC project.

In any case, if you want to save things to a file, you will still have to come up with the filenames for each overpass location yourself. HARP won’t know what filenames to choose.

1 Like

Obviously I need to pass on the filenames for the output, that is not an issue. I’ll try the reconstructed string option, didn’t think of that one, there is always a first time for everything I guess.
Best wishes,