# Merge same date orbit and cut to polygon

**URL:** https://forum.atmospherictoolbox.org/t/merge-same-date-orbit-and-cut-to-polygon/621
**Category:** HARP
**Tags:** sentinel-5p, python
**Created:** [March 17, 2023, 10:16pm UTC](https://forum.atmospherictoolbox.org/t/merge-same-date-orbit-and-cut-to-polygon/621 "2023-03-17T22:16:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![fnbellomo](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/f/a3d4f5/32.png) [@fnbellomo](https://forum.atmospherictoolbox.org/u/fnbellomo)
#### Post date: [March 17, 2023, 10:16pm UTC](https://forum.atmospherictoolbox.org/t/merge-same-date-orbit-and-cut-to-polygon/621/1 "2023-03-17T22:16:18Z")

</div>

Hello everyone.  
I am analyzing the methane from a big polygon involving two images (two orbits) of the 5P from the same day. I would like to use harp to generate L3 images, cut to my area of interest and merge to one image per date but I am lost in the last part. Do I have to do a `reduce_operations` with the two images?

The sample python code is

```python
import harp

operations = """
CH4_column_volume_mixing_ratio_dry_air_validity > 50;
keep(latitude_bounds, longitude_bounds, datetime_start, CH4_column_volume_mixing_ratio_dry_air);
bin_spatial(701, -41, 0.01, 401, -72, 0.01);
derive(latitude {latitude});
derive(longitude {longitude});
"""

reduce_operations = """
squash(time, (latitude, longitude, latitude_bounds, longitude_bounds));
bin();
"""

# glob with the 2 img paths
files_in = "./data/S5P_OFFL_L2 __CH4____ */S5P_OFFL_L2 __CH4____ *.nc"

img_merge = harp.import_product(
    files_in, operations, reduce_operations=reduce_operations
)

```

Ty!

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [March 18, 2023, 11:36am UTC](https://forum.atmospherictoolbox.org/t/merge-same-date-orbit-and-cut-to-polygon/621/2 "2023-03-18T11:36:10Z")

</div>

This looks ok to me, but make sure to then only use the files from a single day for each `harp.import_product` call.
