# Area\_inside\_area function with area-mask-file

**URL:** https://forum.atmospherictoolbox.org/t/area-inside-area-function-with-area-mask-file/507
**Category:** HARP
**Tags:** sentinel-5p, python
**Created:** [May 12, 2022, 11:48am UTC](https://forum.atmospherictoolbox.org/t/area-inside-area-function-with-area-mask-file/507 "2022-05-12T11:48:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mye](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/m/dec6dc/32.png) [@mye](https://forum.atmospherictoolbox.org/u/mye)
#### Post date: [May 12, 2022, 11:48am UTC](https://forum.atmospherictoolbox.org/t/area-inside-area-function-with-area-mask-file/507/1 "2022-05-12T11:48:31Z")

</div>

Trying to run  
os.system(f’harpconvert -a “latitude\>76;latitude\<79;area\_inside\_area({mask})” {filename} {navn}’)

ERROR: syntax error, unexpected NAME, expecting STRING\_VALUE or ‘(’

Running:  
os.system(f’harpconvert -a “latitude\>76;latitude\<79;area\_inside\_area(  
(80.5717,80.5717,76.1060,76.1060),(1.4941,23.0932,23.0932,1.4941))” {filename} {navn}’)

Works just fine.

mask-file:  
lat0,lon0,lat1,lon1,lat2,lon2,lat3,lon3  
76.1060,23.0932,80.5717,23.0932,80.5717,1.4941,76.1060,1.4941

Why do this not work?

---

<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: [May 12, 2022, 12:35pm UTC](https://forum.atmospherictoolbox.org/t/area-inside-area-function-with-area-mask-file/507/2 "2022-05-12T12:35:06Z")

</div>

The mask filename should be provided as a string, so you should put `{mask}` between `""`. Since you are already using `"` for the full operation list you should then also escape these additional `"` using `\"`.

---

<div class="post-metadata">

### Author: ![mye](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/m/dec6dc/32.png) [@mye](https://forum.atmospherictoolbox.org/u/mye)
#### Post date: [May 12, 2022, 12:54pm UTC](https://forum.atmospherictoolbox.org/t/area-inside-area-function-with-area-mask-file/507/3 "2022-05-12T12:54:09Z")

</div>

Thanks. I will try this out.
