8000 Filetring data in tpl file · Issue #27 · gpagliuca/pyfas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Filetring data in tpl file #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
redarmy27 opened this issue Nov 8, 2022 · 3 comments
Open

Filetring data in tpl file #27

redarmy27 opened this issue Nov 8, 2022 · 3 comments
Assignees
Labels
8000 bug

Comments

@redarmy27
Copy link

Hello
i have an issue with filtering data in tpl file, i have used the same tpl file shown in the examples, hereafter my code lines :
import pyfas as fa
import pandas as pd
import matplotlib.pyplot as plt
tpl_path = 'XX/XX/XX'
fname = '11_2022_BD.tpl'
tpl=fa.Tpl(tpl_path+fname)
tpl.filter_data("PT")
i got the error 'Tpl' object has no attribute 'filter_data'
all the steps are working except the last one.

@gpagliuca
Copy link
Owner
gpagliuca commented Nov 8, 2022

Hi, just checked. The documentation is not updated, for consistency the the filter_data method has been modified and renamed view_trends. It works like below:

In [6]: import pyfas as fa

In [7]: tpl = fa.Tpl('125.tpl')

In [8]: tpl.view_trends()
Out[8]:
          Index Variable                                           Position   Unit                                        Description
Filter:
0             1   VOLGBL                                             GLOBAL      -           Global max volume error since last write
1             2       HT                                             GLOBAL      S                                          Time step
2             3      HOL   SECTION - Br - PIPELINE - PIPE - PIPE-1 - NR - 1      -   Holdup (liquid volume fraction including solids)
3             4    HOLWT   SECTION - Br - PIPELINE - PIPE - PIPE-1 - NR - 1      -                              Water volume fraction
4             5       ID      BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR                                                       (-)
5             6       PT   SECTION - Br - PIPELINE - PIPE - PIPE-1 - NR - 1     PA                                           Pressure
6             7     OILC                                      Br - PIPELINE     M3                        Total oil content in branch
7             8     WATC                                      Br - PIPELINE     M3                      Total water content in branch
8             9     GASC                                      Br - PIPELINE     M3                              Gas content in branch
9            10   OILCFR                                      Br - PIPELINE      -                      Oil volume fraction in branch
10           11   WATCFR                                      Br - PIPELINE      -                    Water volume fraction in branch
11           12   GASCFR                                      Br - PIPELINE      -                      Gas volume fraction in branch
12           13       QT  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                                  Total volume flow
13           14       QG  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                                    Gas volume flow
14           15      QLT  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                           Total liquid volume flow
15           16    QLTHL  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                           Volumetric flow rate oil
16           17    QLTWT  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                         Volumetric flow rate water
17           18     QGST  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2  SM3/S             Gas volume flow at standard conditions
18           19     QOST  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2  SM3/S             Oil volume flow at standard conditions
19           20    QWTST  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2  SM3/S  Total water (liquid and vapour) volume flow at...
20           21       GT  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   KG/S                                    Total mass flow
21           22       GG  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   KG/S                                      Gas mass flow
22           23       GL  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   KG/S                              Liquid bulk mass flow
23           24   GTSOUR                                SOURCE - OIL_SOURCE   KG/S                                   Source mass rate
24           25   GTSOUR                              SOURCE - WATER_SOURCE   KG/S                                   Source mass rate

In [9]: tpl.view_trends('Q')
Out[9]:
           Index Variable                                           Position   Unit                                        Description
Filter: Q
0             13       QT  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                                  Total volume flow
1             14       QG  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                                    Gas volume flow
2             15      QLT  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                           Total liquid volume flow
3             16    QLTHL  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                           Volumetric flow rate oil
4             17    QLTWT  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2   M3/S                         Volumetric flow rate water
5             18     QGST  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2  SM3/S             Gas volume flow at standard conditions
6             19     QOST  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2  SM3/S             Oil volume flow at standard conditions
7             20    QWTST  BOUNDARY - Br - PIPELINE - PIPE - PIPE-1 - NR - 2  SM3/S  Total water (liquid and vapour) volume flow at...

In [10]:

@gpagliuca gpagliuca self-assigned this Nov 8, 2022
@gpagliuca gpagliuca added the bug label Nov 8, 2022
@redarmy27
Copy link
Author

Thank you for your reply, it is working now indeed, however i still have an issue when using the command :
tpl.view_trends('PT')
i can not see the pressure trend position, only dots, as you see below :
Index Variable ... Unit Description
Filter: PT ...
0 3 PT ... PA Pressure
1 5 PT ... PA Pressure
2 9 PT ... PA Pressure

@gpagliuca
Copy link
Owner

A bit difficult to understand like this, what are you using to call view_trends, a plane python console or maybe ipython?
view_trends returns a pandas dataframe, you can check whether other data-frames are correctly visualized.

To force the full visualization you can use this:

import pandas as pd
pd.set_option('display.max_columns', None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0