# Undrestanding sample1d

**URL:** <https://forum.generic-mapping-tools.org/t/undrestanding-sample1d/3454>\
**Category:** Q&A\
**Created:** [November 15, 2022, 10:36pm UTC](https://forum.generic-mapping-tools.org/t/undrestanding-sample1d/3454 "2022-11-15T22:36:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtabbakhha](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mtabbakhha](https://forum.generic-mapping-tools.org/u/mtabbakhha)\
**Post date:** [November 15, 2022, 10:36pm UTC](https://forum.generic-mapping-tools.org/t/undrestanding-sample1d/3454/1 "2022-11-15T22:36:36Z")

</div>

I have this command in gmt and need to somehow translate it to PYGMT. I have some files that shows the longitude and latitude of the faults. The files start with VRTX and has 5 columns.

I need to undrestand what happens here to be able to draw the fault line in pygmt. Does it sort the data? and what sort means here?

I did not undrestand these lines: sort   
-n -k 2

and this one:  
gmt sample1d -N3 -T0.025d -AR   
-Fc  
If I undrestand, I can translate it somehow and draw the line in pygmt. right now the figure doesn’t look good to me. I appreciate a lot if someone can help me to undrestand these lines.

```
set FILELIST = ' FS_Hay_Cal.ts_deg83 '
     foreach FILE ( $FILELIST )
             echo FILE: $FILE
             $FILE | awk \
             '{ if ( $1 == "VRTX" && $5 >= 0.0 && $5 < 0.5 ) print $3, $4, $5 }' | sort \
             -n -k 2 | awk '{ print $1, $2, $3, NR }' | gmt sample1d -N3 -T0.025d -AR \
             -Fc | gmt psxy -Wthick,red
     end
```

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [November 15, 2022, 11:13pm UTC](https://forum.generic-mapping-tools.org/t/undrestanding-sample1d/3454/2 "2022-11-15T23:13:58Z")

</div>

`sort -n -k 2` means numeric sort based on key 2 (that basically means column 2). See [sort(1)](https://man7.org/linux/man-pages/man1/sort.1.html).

---

<div class="post-metadata">

**Author:** ![mtabbakhha](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mtabbakhha](https://forum.generic-mapping-tools.org/u/mtabbakhha)\
**Post date:** [January 10, 2023, 10:42pm UTC](https://forum.generic-mapping-tools.org/t/undrestanding-sample1d/3454/3 "2023-01-10T22:42:46Z")

</div>

thanks a lot
