Giter Club home page Giter Club logo

npdio's Introduction

NPD I/O - NPD access library

The Norwegian Petroleum Directorate (NPD) maintains a comprehensive database of the activities in the North Sea. This is public real-time information updated on a daily basis and made public through the NPD fact pages.

The NPD database contains information on more than 7500 wells, 4000 surveys, 120 fields, 1000 facilities, 700 companies, 1200 licenses and more.

NPD I/O is a Java library for accessing this information through a clean and simple to use Java API. NPD I/O is available for Java (NpdIo.jar). The library is lightweight (< 0.1MB) and self-contained; It has no external dependencies. NPD I/O access data directly through HTTP - no login or password is required.

NPD I/O web page: https://petroware.no/npdio.html

Setup

Capture the NPD I/O code to local disk by:

$ git clone https://github.com/Petroware/NpdIo.git

Dependencies

NPD I/O has no external dependenies.

Building NPD I/O

NPD I/O can be built from its root folder by

$ make clean
$ make
$ make jar

The NPD I/O delivery will be the ./lib/NpdIo.jar file.

Building with make requires the make module of the tools repository.

Creating Javadoc

Public Javadoc: https://petroware.no/npdio/javadoc/index.html

Javadoc can be created locally by:

$ make javadoc

Entry point will be ./docs/index.html.

Note the ./overview.html page that becomes part of the Javadoc.

Note also that there is some Javadoc configuration in ./Makefile. The Javadoc is not automatically date stamped. The Javadoc date (current month) is specified in the Makefile.

Programming examples

NPD I/O access data through HTTP. As the URL for each data may change over time, they are nor built in to the library, but should be provided by the client application.

Below are the correct URLs for each data type:

Data type URL
NpdCompany http://factpages.npd.no/ReportServer?/FactPages/TableView/company&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=92.221.121.112&CultureCode=en
NpdDevelopmentWellbore http://factpages.npd.no/ReportServer?/FactPages/TableView/wellbore_development_all&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=80.239.106.206&CultureCode=en
NpdExplorationWellbore http://factpages.npd.no/ReportServer?/FactPages/TableView/wellbore_exploration_all&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=80.239.106.206&CultureCode=en
NpdField http://factpages.npd.no/ReportServer?/FactPages/TableView/field&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=92.221.121.112&CultureCode=en
NpdFixedFacility http://factpages.npd.no/ReportServer?/FactPages/TableView/facility_fixed&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=92.221.121.112&CultureCode=en
NpdLicense http://factpages.npd.no/ReportServer?/FactPages/TableView/licence&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=213.225.65.178&CultureCode=en
NpdMoveableFacility http://factpages.npd.no/ReportServer?/FactPages/TableView/facility_moveable&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=92.221.121.112&CultureCode=en
NpdOtherWellbore http://factpages.npd.no/ReportServer?/FactPages/TableView/wellbore_other_all&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=80.239.106.206&CultureCode=en
NpdProduction http://factpages.npd.no/ReportServer?/FactPages/TableView/field_production_monthly&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=213.225.65.178&CultureCode=en
NpdSurvey http://factpages.npd.no/ReportServer?/FactPages/TableView/survey&rs:Command=Render&rc:Toolbar=false&rc:Parameters=f&rs:Format=CSV&Top100=false&IpAddress=213.225.65.178&CultureCode=en

Below are a few examples on how to access some of the main data types from the NPD database.

   import no.petroware.npdio.field.*;
   import no.petroware.npdio.well.*;
   :

   //
   // Read development NPD wellbores
   //
   String url = "http://factpages.npd.no/..."; // Use NpdDevelopmentWellbore link from table above
   List<NpdWellbore> npdWellbores = NpdWellDataReader.readDevelopmentWellbores(url);

   // Loop over the wellbores and write to stdout
   for (NpdWellbore npdWellbore : npdWellbores)
     System.out.println(npdWellbore);

   :


   //
   // Read NPD fields
   //
   String url = "http://factpages.npd.no/..."; // Use NpdField link from table above
   List<NpdField> npdFields = NpdFieldReader.readFields(url);

   // Read production data for all fields
   String url = "http://factpages.npd.no/..."; // Use NpdProduction link from table above
   ProductionReader.readProduction(url, npdFields);

   // Loop over the fields and write oil production to stdout
   for (NpdField npdField : fields) {
     Production production = field.getProduction();

     for (Production.Entry productionEntry : production.getEntries()) {
       int year = productionEntry.getYear();
       int month = productionEntry.getMonth();

       double oilProduction = productionEntry.getOil();

       System.out.println("Oil production: " + year + "/" + month + ": " + oilProduction);
     }
   }

   :

Note that in an actual client implementation the reading process would better be done asynchronous in threads. The NPD I/O library is all thread-safe.

NPD I/O includes Java implementations for the NPD data types wellbore, license, field, company, survey, facility, discovery, business arrangement area, pipeline and stratigraphy.

About Petroware

Petroware AS is a software company within the data management, data analytics, petrophysics, geology and reservoir engineering domains. Petroware creates highly advanced software components and end-user products that acts as a research platform within software architecture and scalability, system design, parallelism and multi-threading, user experience (UX) and usability analysis as well as development methodologies and techniques.

Petroware AS
https://petroware.no

npdio's People

Contributors

petrowareas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.