Commit b63a0622 authored by Kumar, Vineet's avatar Kumar, Vineet Committed by Salko Jr, Robert
Browse files

Added ch_geo object

parent 2b89fc1c
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -68,6 +68,12 @@ class InpParse(object):
        # For now all in the first section
        me.chIDsInSec = {1: me.chIDs}

        # Gather channel geometries
        me.chgeoIDs = []
        if 'ch_geo' in me.inpDict:
            for geo in me.inpDict['ch_geo']:
                me.chgeoIDs.append(geo['id']['value'])

        # Gather solid geometries
        me.geoIDs = []
        if 'solid_geo' in me.inpDict:
@@ -116,6 +122,7 @@ class InpParse(object):
        me.chIDs = list(sorted(me.chIDs))
        me.solidIDs = list(sorted(me.solidIDs))
        me.gapIDs = list(sorted(me.gapIDs))
        me.chgeoIDs = list(me.chgeoIDs)
        me.geoIDs = list(sorted(me.geoIDs))
        me.timeGroups = list(sorted(me.timeGroups))
        me.domainIDs = list(sorted(me.domainIDs))
@@ -168,6 +175,13 @@ class InpParse(object):
               if gap['id']['value']==gapID:
                   return gap

    def _getChGeo(me, chgeoID):
        """ Takes the string ch_geo ID and retrieves the dictionary for that channel geo from inpDict"""
        if 'ch_geo' in me.inpDict:
           for geo in me.inpDict['ch_geo']:
               if geo['id']['value']==chgeoID:
                   return geo

    def _getGeo(me, geoID):
        """ Takes the integer solid_geo ID and retrieves the dictionary for that solid geo from inpDict"""
        if 'solid_geo' in me.inpDict:
@@ -234,6 +248,10 @@ class InpParse(object):
        chan = me._getCh(chID)
        if 'area' in chan:
            return chan['area']['value']
        elif 'geo_ref' in chan:
            chgeoID = chan['geo_ref']['value']
            geo = me._getChGeo(chgeoID)
            return geo.get('geo')['value'][0]
        else:
            return chan['geo']['value'][0]

@@ -250,6 +268,10 @@ class InpParse(object):
        chan = me._getCh(chID)
        if 'pw' in chan:
            return chan['pw']['value']
        elif 'geo_ref' in chan:
            chgeoID = chan['geo_ref']['value']
            geo = me._getChGeo(chgeoID)
            return geo.get('geo')['value'][1]
        else:
            return chan['geo']['value'][1]

+37 −3
Original line number Diff line number Diff line
@@ -257,8 +257,32 @@ initial{
   }
}

ChildUniqueness="ch_geo/id/value"
ch_geo{
   MinOccurs=0
   MaxOccurs=NoLimit
   id{
      MinOccurs=1
      MaxOccurs=1
      value{
         ValType="String"
         MinOccurs=1
         MaxOccurs=1
      }
    }
   geo{
      MinOccurs=1
      MaxOccurs=1
      value{
         ValType="Real"
         MinOccurs=2
         MaxOccurs=2
      }
   }
}

# IDs have to go from 1 to N without skips.  This ensures 1 and N are there.
# Waiting on wasp feature for the coniguous part.
# Waiting on wasp feature for the contiguous part.
ChildExactlyOne=["ch/id/value"=1]
ChildUniqueness="ch/id/value"
ch{
@@ -274,8 +298,8 @@ ch{
         MaxOccurs=1
      }
   }
   ChildExactlyOne=[area, geo]
   ChildExactlyOne=[pw, geo]
   ChildExactlyOne=[area, geo, geo_ref]
   ChildExactlyOne=[pw, geo, geo_ref]
   area{
      MinOccurs=0
      MaxOccurs=1
@@ -305,6 +329,16 @@ ch{
         MaxOccurs=2
      }
   }
   geo_ref{
      MinOccurs=0
      MaxOccurs=1
      value{
         ValType="String"
         ExistsIn="/ch_geo/id/value"
         MinOccurs=1
         MaxOccurs=1
      }
   }
   ChildAtMostOne=[x, mesh]
   ChildAtMostOne=[y, mesh]
   ChildAtMostOne=[xdim, mesh]
+18 −9
Original line number Diff line number Diff line
@@ -10,9 +10,18 @@ section id 1
   height 3.0 # m
   num_levels 10

ch_geo id 1
   geo 8.787782e-5 2.984513e-2

ch_geo id 2
   geo 4.393891e-5 1.492257e-2

ch_geo id 3
   geo 2.196945e-5 7.461283e-3

ch id 1
   area  2.196945e-5 # m**2
   pw    2.316128e-2
   pw    7.461283e-3
   x     -9.45e-3
   y      9.45e-3
   xdim   6.3e-3
@@ -26,35 +35,35 @@ ch id 1

ch id 2
   area  4.393891e-5
   pw    3.372257e-2
   pw    1.492257e-2
   mesh  0.0 9.45e-3 12.6e-3 6.3e-3

ch id 3
   geo  2.196945e-5 2.316128e-2
   geo_ref  3
   mesh 9.45e-3 9.45e-3 6.3e-3 6.3e-3

ch id 4
   geo  4.393891e-5 3.372257e-2
   geo_ref 2
   mesh -9.45e-3 0.0 6.3e-3 12.6e-3

ch id 5
   geo  8.787782e-5 4.224513e-2
   geo_ref 1
   mesh 0.0 0.0 12.6e-3 12.6e-3

ch id 6
   geo  4.393891e-5 3.372257e-2
   geo_ref 2
   mesh 9.45e-3 0.0 6.3e-3 12.6e-3

ch id 7
   geo  2.196945e-5 2.316128e-2
   geo_ref 3
   mesh -9.45e-3 -9.45e-3 6.3e-3 6.3e-3

ch id 8
   geo  4.393891e-5 3.372257e-2
   geo_ref 2
   mesh 0.0 -9.45e-3 12.6e-3 6.3e-3

ch id 9
   geo  2.196945e-5 2.316128e-2
   geo_ref 3
   mesh 9.45e-3 -9.45e-3 6.3e-3 6.3e-3

#===================================================
+117 −117
Original line number Diff line number Diff line
@@ -35,15 +35,15 @@ ctf model
   9    0    0    0    0    0    0    0    0    0    0    0    0    0                       
*Card 2.2                                                                                      
**   I          AN          PW ABOT ATOP NMGP           X           Y        XSIZ        YSIZ  
     1  2.1969e-05  2.3161e-02  0.0  0.0    0 -9.4500e-03  9.4500e-03  6.3000e-03  6.3000e-03
     2  4.3939e-05  3.3723e-02  0.0  0.0    0  0.0000e+00  9.4500e-03  1.2600e-02  6.3000e-03
     3  2.1969e-05  2.3161e-02  0.0  0.0    0  9.4500e-03  9.4500e-03  6.3000e-03  6.3000e-03
     4  4.3939e-05  3.3723e-02  0.0  0.0    0 -9.4500e-03  0.0000e+00  6.3000e-03  1.2600e-02
     5  8.7878e-05  4.2245e-02  0.0  0.0    0  0.0000e+00  0.0000e+00  1.2600e-02  1.2600e-02
     6  4.3939e-05  3.3723e-02  0.0  0.0    0  9.4500e-03  0.0000e+00  6.3000e-03  1.2600e-02
     7  2.1969e-05  2.3161e-02  0.0  0.0    0 -9.4500e-03 -9.4500e-03  6.3000e-03  6.3000e-03
     8  4.3939e-05  3.3723e-02  0.0  0.0    0  0.0000e+00 -9.4500e-03  1.2600e-02  6.3000e-03
     9  2.1969e-05  2.3161e-02  0.0  0.0    0  9.4500e-03 -9.4500e-03  6.3000e-03  6.3000e-03
     1  2.1969e-05  7.4613e-03  0.0  0.0    0 -9.4500e-03  9.4500e-03  6.3000e-03  6.3000e-03
     2  4.3939e-05  1.4923e-02  0.0  0.0    0  0.0000e+00  9.4500e-03  1.2600e-02  6.3000e-03
     3  2.1969e-05  7.4613e-03  0.0  0.0    0  9.4500e-03  9.4500e-03  6.3000e-03  6.3000e-03
     4  4.3939e-05  1.4923e-02  0.0  0.0    0 -9.4500e-03  0.0000e+00  6.3000e-03  1.2600e-02
     5  8.7878e-05  2.9845e-02  0.0  0.0    0  0.0000e+00  0.0000e+00  1.2600e-02  1.2600e-02
     6  4.3939e-05  1.4923e-02  0.0  0.0    0  9.4500e-03  0.0000e+00  6.3000e-03  1.2600e-02
     7  2.1969e-05  7.4613e-03  0.0  0.0    0 -9.4500e-03 -9.4500e-03  6.3000e-03  6.3000e-03
     8  4.3939e-05  1.4923e-02  0.0  0.0    0  0.0000e+00 -9.4500e-03  1.2600e-02  6.3000e-03
     9  2.1969e-05  7.4613e-03  0.0  0.0    0  9.4500e-03 -9.4500e-03  6.3000e-03  6.3000e-03
***********************************************************************************************
*GROUP 3 - Gap data
***********************************************************************************************
+9 −9
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ section id 1

ch id 1
   area  2.196945e-5 # m**2
   pw    2.316128e-2
   pw    7.461283e-3
   x     -9.45e-3
   y     9.45e-3
   xdim  6.3e-3
@@ -35,7 +35,7 @@ ch id 1

ch id 2
   area  4.393891e-5 # m**2
   pw 3.372257e-2
   pw 1.492257e-2
   x 0.0
   y 9.45e-3
   xdim 12.6e-3
@@ -43,7 +43,7 @@ ch id 2

ch id 3
   area  2.196945e-5 # m**2
   pw 2.316128e-2
   pw 7.461283e-3
   x 9.45e-3
   y 9.45e-3
   xdim 6.3e-3
@@ -51,7 +51,7 @@ ch id 3

ch id 4
   area  4.393891e-5 # m**2
   pw 3.372257e-2
   pw 1.492257e-2
   x -9.45e-3
   y 0.0
   xdim 6.3e-3
@@ -59,35 +59,35 @@ ch id 4

ch id 5
   area  8.787782e-5 # m**2
   pw 4.224513e-2
   pw 2.984513e-2
   x 0.0
   y 0.0
   xdim 12.6e-3
   ydim 12.6e-3
ch id 6
   area  4.393891e-5 # m**2
   pw 3.372257e-2
   pw 1.492257e-2
   x 9.45e-3
   y 0.0
   xdim 6.3e-3
   ydim 12.6e-3
ch id 7
   area  2.196945e-5 # m**2
   pw 2.316128e-2
   pw 7.461283e-3
   x -9.45e-3
   y -9.45e-3
   xdim 6.3e-3
   ydim 6.3e-3
ch id 8
   area  4.393891e-5 # m**2
   pw 3.372257e-2
   pw 1.492257e-2
   x 0.0
   y -9.45e-3
   xdim 12.6e-3
   ydim 6.3e-3
ch id 9
   area  2.196945e-5 # m**2
   pw 2.316128e-2
   pw 7.461283e-3
   x 9.45e-3
   y -9.45e-3
   xdim 6.3e-3
Loading