# Reading sampler plugin points from .txt or .csv file

**URL:** https://pyfr.discourse.group/t/reading-sampler-plugin-points-from-txt-or-csv-file/1074
**Category:** Cases
**Tags:** plugins, config
**Created:** [15 April 2024 17:31 UTC](https://pyfr.discourse.group/t/reading-sampler-plugin-points-from-txt-or-csv-file/1074 "2024-04-15T17:31:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ugyen-wangchuk](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/ugyen-wangchuk/32/480_2.png) [@ugyen-wangchuk](https://pyfr.discourse.group/u/ugyen-wangchuk)
#### Post date: [15 April 2024 17:31 UTC](https://pyfr.discourse.group/t/reading-sampler-plugin-points-from-txt-or-csv-file/1074/1 "2024-04-15T17:31:32Z")

</div>

Hi, I am currently running the new PyFRv2.0.0 on a case where I need a higher frequency output and hence using sampler plugin. The sampler plugin work well with amount of points I have defined and generates them to a single csv file. However, considering the number of sample points I am using, I am wondering if we can define the sampler plugin to read from a txt file or csv files with sample points rather than defining them within the configuration file itself??  
(current)  
[soln-plugin-sampler]  
samp-pts = [lots and lots of points]

(ideally)  
[soln-plugin-sampler]  
samp-pts = sampler\_points.csv (just an example)

---

<div class="post-metadata">

### Author: ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)
#### Post date: [15 April 2024 17:50 UTC](https://pyfr.discourse.group/t/reading-sampler-plugin-points-from-txt-or-csv-file/1074/2 "2024-04-15T17:50:09Z")

</div>

The best place for the sampler points is inside the config file. This ensures that you can restart a simulation given just a solution and associated mesh file. If you want to clean up the contents of the file itself—albeit at the cost of adding some fragility—you can take advantage of the fact that PyFR allows configuration items to be environment variables.

For example:

```auto
[soln-plugin-sampler]
samp-pts = $MYPTS

```

then before you run PyFR can do

```auto
export MYPTS=`cat points.txt`

```

where `points.txt` contains the points in the same format as PyFR would expect them `[(x, y, z), (x, y, z), ...]`

Regards, Freddie.

---

<div class="post-metadata">

### Author: ![ugyen-wangchuk](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/ugyen-wangchuk/32/480_2.png) [@ugyen-wangchuk](https://pyfr.discourse.group/u/ugyen-wangchuk)
#### Post date: [15 April 2024 18:00 UTC](https://pyfr.discourse.group/t/reading-sampler-plugin-points-from-txt-or-csv-file/1074/3 "2024-04-15T18:00:50Z")

</div>

Brilliant. Thank you Freddie!
