# X\_2sys: remove tracks with 1 cross?

**URL:** <https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974>\
**Category:** Q&A\
**Created:** [May 30, 2022, 3:25pm UTC](https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974 "2022-05-30T15:25:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [May 30, 2022, 3:25pm UTC](https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974/1 "2022-05-30T15:25:14Z")

</div>

I have more than 100 bathyimetric tracks that I am processing with x2sys package.

First I try to make a constant correction (`2sys_solve -Cz -Ec`) which work fine.

Then I try a linear drift solution (`2sys_solve -Cz -Ed`) but I got a message that says that I have some tracks with one 1 crossing so obviously it can’t find a solution.

My question is how to preprocess my dataset in order to remove the tracks that will have a single crossing.

Full error message:

```
x2sys_solve [INFORMATION]: Found 636 COE records
x2sys_solve [WARNING]: Track YBL-1_mig only has 1 crossings so can only solve for 1 of the 2 parameters
x2sys_solve [WARNING]: Track YBL-5_mig only has 1 crossings so can only solve for 1 of the 2 parameters
...
x2sys_solve [INFORMATION]: Number of unknowns is 244 and number of constraints is 1
x2sys_solve [INFORMATION]: Matrix equation N * a = b: (N = 245 x 245)
x2sys_solve [ERROR]: gmt_gaussjordan given a singular matrix
x2sys_solve [ERROR]: Singular matrix - unable to solve!
```

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [May 30, 2022, 3:37pm UTC](https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974/2 "2022-05-30T15:37:45Z")

</div>

I forgot.  
Should I use `x2sys_list -N2`?

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [May 30, 2022, 7:57pm UTC](https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974/3 "2022-05-30T19:57:05Z")

</div>

Yes, I think that is how you restrict what is used in the solution.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [May 30, 2022, 8:11pm UTC](https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974/4 "2022-05-30T20:11:31Z")

</div>

Thanks @pwessel. I though so.

But in my case It didn’t work. Because when I use `-N2` two tracks were remove, but then there were 2 new tracks with only 1 crossing (see figure).

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/a/a27ac97bc763a495b9cc7065c3cb8567104ca6df.png)

So the solution should be to run `x2sys_list -N2` repetidealy until no new tracks are filter out. Should I request this feature, right? Or can be done?

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [May 30, 2022, 8:24pm UTC](https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974/5 "2022-05-30T20:24:33Z")

</div>

Please experiment with that - I have not done this on real data in a very long time so not sure.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [May 30, 2022, 9:09pm UTC](https://forum.generic-mapping-tools.org/t/x-2sys-remove-tracks-with-1-cross/2974/6 "2022-05-30T21:09:00Z")

</div>

Yes, I did it. I remove the first two tracks, and run it again.

I got this message when I run with`x2sys_list -N2` and it works.

```
x2sys_list [INFORMATION]: Output 611 pairs and a total of 634 crossover records.
x2sys_solve [INFORMATION]: Reading Data Table from file tmp_COE_use_N2.txt
x2sys_solve [INFORMATION]: Found 632 COE records
x2sys_solve [INFORMATION]: Normalized all distances by dividing with the maximum range = 250.025
x2sys_solve [INFORMATION]: Determine number of independent track clusters
x2sys_solve [INFORMATION]: 119 tracks form a single connected cluster
x2sys_solve [INFORMATION]: Number of unknowns is 238 and number of constraints is 1
x2sys_solve [INFORMATION]: Matrix equation N * a = b: (N = 239 x 239)
x2sys_solve [INFORMATION]: Before correction, mean and st.dev.: 0.900685 4.08519 
x2sys_solve [INFORMATION]: After correction, mean and st.dev. : -0.0458738 1.26307
x2sys_solve [INFORMATION]: Writing Data Table to Standard Output stream

```

I got this message when I run without -N2 `x2sys2_list` (without -N2) and also works but complained about 2 tracks.

```
x2sys_solve [INFORMATION]: Reading Data Table from file tmp_COE_use.txt
x2sys_solve [INFORMATION]: Found 634 COE records
x2sys_solve [INFORMATION]: Normalized all distances by dividing with the maximum range = 250.025
x2sys_solve [WARNING]: Track YBL-3_mig only has 1 crossings so can only solve for 1 of the 2 parameters
x2sys_solve [WARNING]: Track YBL-5_mig only has 1 crossings so can only solve for 1 of the 2 parameters
x2sys_solve [INFORMATION]: Determine number of independent track clusters
x2sys_solve [INFORMATION]: 121 tracks form a single connected cluster
x2sys_solve [INFORMATION]: Number of unknowns is 240 and number of constraints is 1
x2sys_solve [INFORMATION]: Matrix equation N * a = b: (N = 241 x 241)
x2sys_solve [INFORMATION]: Before correction, mean and st.dev.: 0.899923 4.07881 
x2sys_solve [INFORMATION]: After correction, mean and st.dev. : -0.0457291 1.26108
x2sys_solve [INFORMATION]: Writing Data Table to Standard Output stream
```
