# Issue with Changing Pixel Area

**URL:** https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660
**Category:** HARP
**Tags:** sentinel-5p, python
**Created:** [July 13, 2023, 12:57pm UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660 "2023-07-13T12:57:54Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [July 13, 2023, 12:57pm UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/1 "2023-07-13T12:57:54Z")

</div>

Hello,

I am currently facing an issue while working with S02 Sentinel-5P data using the HARP tool. Specifically, I have noticed that the pixel area is undergoing unexpected changes, which is not in line with the consistent resolution of the S02 dataset (3.5 x 5.5 km).

I am seeking assistance to better understand why the pixel area is exhibiting variability despite the known resolution. My goal is to prevent any alterations to the pixel area during my data processing operations.

If anyone has encountered a similar issue or has insights into this matter, I would greatly appreciate your guidance and suggestions on how to address this issue effectively.

Thank you in advance for your valuable assistance.

 ![1](https://forum.atmospherictoolbox.org/uploads/default/original/1X/7ef8ee067641c2729e7390f137c8b0da78c97f7e.jpeg)

---

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [July 13, 2023, 12:58pm UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/2 "2023-07-13T12:58:34Z")

</div>

The second image is

 ![2](https://forum.atmospherictoolbox.org/uploads/default/original/1X/8a453d7e25d77be07fdd3f881cc1307824f34b33.jpeg)

---

<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: [July 13, 2023, 1:52pm UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/3 "2023-07-13T13:52:12Z")

</div>

This is to be expected. You will only get the highest pixel resolution for pixels that are directly below the instrument. For higher viewing angles (i.e. when the instrument looks more to the side), the pixels are wider. It ranges from about 20 km^2 to about 82 km^2.

Also note that there is some jump in the pixel size from very wide to less-wide near the edges.  
You can see this more clearly by using a `derive(area {time} [km2])` operation as part of your ingestion and then plotting the `area` variable.

---

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [July 14, 2023, 5:05am UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/4 "2023-07-14T05:05:41Z")

</div>

@sander.niemeijer Yes I have checked the area using derive(area {time} [km2]) operation.  
Is there any solution for it or do I have to re-grid / interpolate the pixels? because I want area of the pixels to be same.

---

<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: [July 14, 2023, 7:59am UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/5 "2023-07-14T07:59:34Z")

</div>

If you want the areas to be the same size, you will have to perform a regridding yourself. But be aware that equal area in km^2 is not the same as equal lat/lon grid size, since cells near the pole will be smaller than near the equator.

---

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [July 24, 2023, 7:52am UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/6 "2023-07-24T07:52:03Z")

</div>

alright! thank you!!!

---

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [July 24, 2023, 9:01am UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/7 "2023-07-24T09:01:45Z")

</div>

How can I re-grid the pixels using bin\_spatial? What the values could be? I am unable to understand.

```auto
    # Define the operations that will be used to process the data
    operations_trop = ";".join([
      "CH4_column_volume_mixing_ratio_dry_air_validity>0.7",
      "latitude>31.254333999914312",
      "latitude<31.74162156648225",
      "longitude>74.00684949990466",
      "longitude<74.64111329724102",
      "bin_spatial()"
      "keep(datetime_start, latitude_bounds,longitude_bounds,CH4_column_volume_mixing_ratio_dry_air)",
      "derive(CH4_column_volume_mixing_ratio_dry_air [ppbv])",
      "derive(area {time} [km2])",
    ])

    #Use the harp module to import the product group and apply the operations
    tropomi_CH4 = harp.import_product(file_path, operations=operations_trop)

```

---

<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: [July 24, 2023, 9:15am UTC](https://forum.atmospherictoolbox.org/t/issue-with-changing-pixel-area/660/8 "2023-07-24T09:15:32Z")

</div>

Please have a look at Step 4 of the [first use case on the toolbox website](https://atmospherictoolbox.org/media/usecases/Usecase_1_S5P_SO2_La_Soufriere.html).
