FracKhemAll Prototype System

From FrackingData
Jump to: navigation, search

FracKhemAll - Fracking Chemical Disclosure System

Synopsis

It appears that some states, for example the State of Pennsylvania, are now rethinking their commitment to FracFocus.org. I've prepared for this eventuality and this wiki is my attempt to outline the functional and technical requirements needed to create an open-source alternative to FracFocus.org's website. The name FracKhemAll is an amalgamation of "fracking", "chemicals", and "all" to represent the blending of fracking data with chemical disclosures coupled with chemical toxicities and earthquakes. FracKhemAll, at least a first version of it, already exists but has not yet been pushed to a code repository. Presently, FracKhemAll blends "fracking" data with "chemical disclosure" as well as "chemical toxicity" data, but does not yet incorporate "earthquake" data. Shortly, I will be pushing the FracKhemAll source to a code repository, if only for historical reference.

Document Format and Conversion Information

  • Author: Khepry Quixote
  • Date: 7 July 2015
  • Format of this document:
    • Markdown (MediaWiki-flavored)
  • To convert this document to other formats:
    • Install pandoc
      • Linux:
        • sudo apt-get install pandoc pandoc-data liblua5.1-01
      • Windows:
    • Perform desired conversions:
      • Convert Markdown (GitHub-flavored) to MediaWiki document:
        • pandoc -f markdown_github -t mediawiki Fracking_Chemical_Disclosure_System.md -o Fracking_Chemical_Disclosure_System.mediawiki
      • Convert Markdown (GitHub-flavored) to DokuWiki document:
        • pandoc -f markdown_github -t dokuwiki Fracking_Chemical_Disclosure_System.md -o Fracking_Chemical_Disclosure_System.dokuwiki
      • Convert Markdown (GitHub-flavored) to HTML document:
        • pandoc -f markdown_github -t html Fracking_Chemical_Disclosure_System.md -o Fracking_Chemical_Disclosure_System.html
      • Convert Markdown (GitHub-flavored) to Microsoft Word (docx) document:
        • pandoc -f markdown_github -t docx Fracking_Chemical_Disclosure_System.md -o Fracking_Chemical_Disclosure_System.docx
      • Convert Markdown (GitHub-flavored) to LibreOffice Writer (odt) document:
        • pandoc -f markdown_github -t odt Fracking_Chemical_Disclosure_System.md -o Fracking_Chemical_Disclosure_System.odt
      • Convert HTML to Microsoft Word (docx) document:
        • pandoc -f html -t docx Fracking_Chemical_Disclosure_System.html -o Fracking_Chemical_Disclosure_System.docx
      • Convert HTML to LibreOffice Writer (odt) document:
        • pandoc -f html -t odt Fracking_Chemical_Disclosure_System.html -o Fracking_Chemical_Disclosure_System.odt

Data Sources

Table Sources

United States Codes

API State Codes, including Pseudo-State Codes
API County Codes, including Offshore Codes

Spatial Sources

United States

National Map [Wikipedia 1]

Use the shapefiles or geodatabases below to validate that a latitude/longitude combination is within the state and county derived from the API Well Number.

Algorithmic Tools

Spatial Algorithms

Country from given geo-coordinates

There are two miniature tools intended to help with the task of finding in which country are given GPS coordinates.

  import copyshapes
  copyshapes.filter_file(
        lambda x: x.GetField('REGION') == 150,
        'TM_WORLD_BORDERS-0.3.shp', 'EUROPE.shp'
  )
  • countries.py: Find what countries given GPS coordinates are. Use like this:
    • Example:
 import countries
 cc = countries.CountryChecker('TM_WORLD_BORDERS-0.3.shp')
 print cc.getCountry(countries.Point(49.7821, 3.5708)).iso

TODO: Add logic for finding in which state are given GPS coordinates
TODO: Add logic for finding in which county are given GPS coordinates

Logic Specifications

API Well Number [Wikipedia 2]

An API well number can have up to 14 digits divided by dashes as follows (e.g. 42-501-20130-03-00):

  1. A two-digit state code, available from the Society of Petrophysicists and Well Log Analysts (SPWLA)[SPWLA 1] in a table of valid state codes for the United States.[SPWLA 2]
  2. A three-digit county code, available from the Society of Petrophysicists and Well Log Analysts (SPWLA)[SPWLA 1] in a table of valid county codes for the United States.[SPWLA 3]
  3. A five-digit unique well identifier
    • Sometimes representing the state permit number,
    • But, depending upon how many wells are within a particular state, may or may not be unique within that county.
  4. A two-digit directional side-track code.
    • The original vertical well is normally '00'.
    • The first directional side-track would then be '01'.
    • The above numbering convention may vary from state-to-state.
  5. A two-digit event sequence code to indicate how many operations have been undertaken.
    • This event sequence code is assigned by IHS Energy and is not found in most oil and gas databases.

Chemical Abstract Society Registry Number (CASRN) [Wikipedia 3]

A CASRN is separated by hyphens into three parts, the first part consisting from two up to seven digits, the second part consisting of two digits, and the third part consisting of a single digit serving as a check digit. The check digit is found by taking the last digit times 1, the previous digit times 2, the previous digit times 3 etc., adding all these up and computing the sum modulo 10. For example, the CAS number of water is 7732-18-5: the checksum 5 is calculated as (8×1 + 1×2 + 2×3 + 3×4 + 7×5 + 7×6) = 105; 105 mod 10 = 5.

TODO: Add logic for calculating the check digit of a CASRN

Latitudes and Longitudes

Latitudes

  • Can have a double-precision value between -90 and +90.

Longitudes

  • Can have a double-precision value between -180 and + 180.

Latitude, Longitude Coordinates

  • Should be within the county boundaries of the API Well Number's state and county codes.

References

Wikipedia

  1. https://en.wikipedia.org/wiki/The_National_Map
  2. https://en.wikipedia.org/wiki/API_well_number
  3. https://en.wikipedia.org/wiki/CAS_Registry_Number

Society of Petrophysicists and Well Log Analysts (SPWLA)

  1. 1.0 1.1 http://web.archive.org/web/20150923182407/https://www.spwla.org/content/api-standards-information
  2. http://web.archive.org/web/20150824064817/http://spwla.org/content/us-state-codes
  3. http://web.archive.org/web/20150926002942/http://www.spwla.org/sites/default/files/docs/counties.xls