Commits

wrobell committed 1c2b330

- added guide me ii wreck profile test

Comments (0)

Files changed (2)

code_part1/libdeco/tests/profile/gfdeco/gfdeco.in-guide-me-ii-ean31

+dive to 35 meters of seawater gauge (mswg) for 30 minutes on ean31+ean50
+2
+0.31,0.00,0.69
+0.50,0.00,0.50
+1
+0,35,1000,1
+2
+35,30,1
+99
+2
+35,1,-10,3
+22,2,-10,3
+0

code_part1/libdeco/tests/profile/test_oc.py

         self.assertEquals(expected, [s.time for s in info.stops])
 
 
+    def test_guide_me_ii_ean_31(self):
+        """
+        Test Guide Me II dive on EAN31 and EAN50 (GF 20/90)
+
+        FIXME: one more calculation needed, preferrable with 6m last stop;
+               at the moment we need this test due to gas initialization
+               bug in libdeco-ostc 0.3.0
+
+        gfdeco::
+
+                                      DECOMPRESSION CALCULATION PROGRAM
+                                    Developed in FORTRAN by Erik C. Baker
+             
+             
+             
+            Description:    dive to 35 meters of seawater gauge (mswg) for 30 minutes on ean31+ean
+             
+            Gasmix Summary:                        FO2    FHe    FN2
+                                      Gasmix # 1  0.310  0.000  0.690
+                                      Gasmix # 2  0.500  0.000  0.500
+             
+             
+                                                DIVE PROFILE
+             
+            Seg-  Segm.  Run   | Gasmix | Ascent    From     To      Rate    | Constant
+            ment  Time   Time  |  Used  |   or     Depth   Depth    +Dn/-Up  |  Depth
+              #   (min)  (min) |    #   | Descent  (mswg)  (mswg)  (msw/min) |  (mswg)
+            ----- -----  ----- | ------ | -------  ------  ------  --------- | --------
+              1     0.0    0.0 |    1   | Descent     0.     35.    1000.0   |
+              2    30.0   30.0 |    1   |                                    |    35.
+             
+             
+                                           DECOMPRESSION PROFILE
+             
+                      Leading compartment enters the decompression zone at   19.3 mswg
+                             Deepest possible decompression stop is   18.0 mswg
+             
+            Seg-  Segm.  Run   | Gasmix | Ascent   Ascent         |  DECO   STOP   RUN
+            ment  Time   Time  |  Used  |   To      Rate    Grad. |  STOP   TIME   TIME
+              #   (min)  (min) |    #   | (mswg) (msw/min) Factor | (mswg)  (min)  (min)
+            ----- -----  ----- | ------ | ------ --------- ------ | ------  -----  -----
+              3     2.0   32.0 |    1   |   15.    -10.0          |
+              4     1.0   33.0 |    2   |                   0.20  |    15      2     33
+              5     0.3   33.3 |    2   |   12.    -10.0          |
+              6     0.7   34.0 |    2   |                   0.34  |    12      1     34
+              7     0.3   34.3 |    2   |    9.    -10.0          |
+              8     0.7   35.0 |    2   |                   0.48  |     9      1     35
+              9     0.3   35.3 |    2   |    6.    -10.0          |
+             10     0.7   36.0 |    2   |                   0.62  |     6      1     36
+             11     0.3   36.3 |    2   |    3.    -10.0          |
+             12     3.7   40.0 |    2   |                   0.76  |     3      4     40
+             13     0.3   40.3 |    2   |    0.    -10.0          |
+                                                            0.90  |
+
+        """
+        de = DecoEngine()
+
+        de.last_stop = 6
+        de.gf_low = 20
+        de.gf_high = 90
+
+        de.add_segment(35, 30)
+        de.add_gas(0, 31)
+        de.add_gas(22, 50)
+        info = de.calculate()
+
+        self.assertEquals(2, len(info.stops))
+
+        expected = list(range(9, 3, -3))
+        self.assertEquals(expected, [s.depth for s in info.stops])
+
+        expected = [2, 6]
+        self.assertEquals(expected, [s.time for s in info.stops])
+
+
 # vim: sw=4:et:ai
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.