# How to extract component of a complex grid?

**URL:** https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073
**Category:** GMT.jl Q&A
**Tags:** gmt
**Created:** [July 23, 2025, 9:18pm UTC](https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073 "2025-07-23T21:18:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TFJospin](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@TFJospin](https://forum.generic-mapping-tools.org/u/TFJospin)
#### Post date: [July 23, 2025, 9:18pm UTC](https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073/1 "2025-07-23T21:18:44Z")

</div>

How To read or write the real component of a complex grid in GMT ?.

---

<div class="post-metadata">

### Author: ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)
#### Post date: [July 23, 2025, 10:10pm UTC](https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073/2 "2025-07-23T22:10:28Z")

</div>

Read and write are two rather different operations. What is it that you are trying to read? And what for?

---

<div class="post-metadata">

### Author: ![TFJospin](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@TFJospin](https://forum.generic-mapping-tools.org/u/TFJospin)
#### Post date: [July 24, 2025, 8:23am UTC](https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073/3 "2025-07-24T08:23:28Z")

</div>

I have applied an arcsinus function to a grid containing values greater than ±1. To avoid complex parts appearing in the result, I want the final grid to contain only real values.

---

<div class="post-metadata">

### Author: ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)
#### Post date: [July 24, 2025, 10:26am UTC](https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073/4 "2025-07-24T10:26:30Z")

</div>

Don’t know what GMT does in those circumstances but it won’t write an imaginary grid. The simplest way to solve your issue is to use `grdclip` to insure data is on a valid domain.
