Skip to main content

Building TOUGH2/Waiwera models from layers of conceptual models

Project description

# Example

Creates BMStats that can be used later, from Leapfrog Geology:

# (ONLY ONCE) geo used to get geology from Leapfrog geological model cmgeo = mulgrid(‘g_very_fine.dat’)

# CSV file created by Leapfrog using cmgeo above leapfrog = LeapfrogGM() leapfrog.import_leapfrog_csv(‘grid_gtmp_ay2017_03_6_fit.csv’)

cm_geology = CM_Blocky(cmgeo, leapfrog)

# whatever active model we are working on bmgeo = mulgrid(‘gwaixx_yy.dat’)

bms_geology = cm_geology.populate_model(bm_geo) bms_geology.save(‘a.json’)

A BMStats object can be reused (very fast) to eg.

bms_geology = BMStats(‘a.json’)

# get a cell’s stats cs = bms_geology.cellstats[‘abc12’]

# rock that occupies most in cell ‘abc12’ rock_name = bms_geology.zones[np.argmax(cs)]

# how many rock in cell ‘abc12’ n_rock = len(np.nonzero(cs))

# list all rocks in cell ‘abc12’ rocks = [bm_geology.zones[i] for i in np.nonzero(cs)]

# BMStats

This is the object that we keep for later use. It is associated to a certain “geometry” file. So each cell has information on zones. Usually this is generated by cm.populate_model(), which can be expensive.

  • ? should I call it CMStats?

  • ? TODO, .cellstats access by cell index

  • ? TODO, .

.stats, numpy array (n * m), n number of geometry cells, m number of zones .zones, a list of zone name, eg. geology rock names, fault names etc .zonestats, a dict keyed by zone name, an array of size number of cells, each cell is between .cellstats, a dict of stats by cell name

.save() .load() .add_stats() add another bmstat, merge stats .add_cm() calls cm.populate_model, and merge stats

# CM # CM_Blocky # CM_Prism # CM_Faults

These are the objects that can be created in order to create the final BMStats objects. The common method .populate_model(bm_geo) is called to create BMStats objects. It means the conceptual model is “applied” onto the bm_geo.

  • TODO, .populate_model() should return BMStats instead

  • ? TODO, .populate_model() should be called something else?

.populate_model(bm_geo) takes a target geometry, and return/creates BMStats

# LeapfrogGM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmflow-0.1.1.dev9.tar.gz (496.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmflow-0.1.1.dev9-py2-none-any.whl (499.1 kB view details)

Uploaded Python 2

File details

Details for the file cmflow-0.1.1.dev9.tar.gz.

File metadata

  • Download URL: cmflow-0.1.1.dev9.tar.gz
  • Upload date:
  • Size: 496.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.12

File hashes

Hashes for cmflow-0.1.1.dev9.tar.gz
Algorithm Hash digest
SHA256 2b898b5e79bc2ef6b833f4120be229b097b970215520a32b9fd57bf3e1abb078
MD5 806e9e9b1a3a102e639b28394a8f4519
BLAKE2b-256 add3d99261a8312f9c620ceb47f35a38c002e794590134af2ec91d91d273f8e8

See more details on using hashes here.

File details

Details for the file cmflow-0.1.1.dev9-py2-none-any.whl.

File metadata

  • Download URL: cmflow-0.1.1.dev9-py2-none-any.whl
  • Upload date:
  • Size: 499.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.12

File hashes

Hashes for cmflow-0.1.1.dev9-py2-none-any.whl
Algorithm Hash digest
SHA256 dde410c9f8cf834ae05754fab0e42c4a5b6d541afc334c799744b40f9948ae3b
MD5 c9713f938a4f0d775a150de2b04713c7
BLAKE2b-256 43e896353686b0795ab52788b9de6d9ce7f9f03493109bf9e2d47d68cd46ef53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page