Petroleum Engineering on the NetBeans Platform
Petroleum Engineering on the NetBeans Platform
Join the DZone community and get the full member experience.Join For Free
Microservices. Streaming data. Event Sourcing and CQRS. Concurrency, routing, self-healing, persistence, clustering...learn how Akka enables Java developers to do all this out of the box! Brought to you in partnership with Lightbend.
Let's now look at the application I've been working on, called Pyrus. Pyrus began as a collection of Java classes I started writing over 10 years ago when I was learning to program some seismic algorithms. For what it's worth, the first IDE I used was JBuilder, but I quickly moved onto Forte (yes I've been using it that long!).
Java was my language of choice as I've always been more in favour of strict syntax languages and, since I was working in both Unix and Windows at the time, it made a lot of sense to have a cross-platform language. Over the next 8 years I picked up and put down the code as I got more involved in petroleum engineering and economic modeling. Most of the stuff I did wasn't graphical in nature, and whilst I toyed around with Swing, I always found it immensely frustrating. I'm an engineer, not a programmer, and I want to be writing real code, not plumbing. However, there came a point a couple of years ago where Excel just wasn't quite making the grade anymore for some Monte Carlo stuff I was doing, so that was really the trigger for me taking a look at the NetBeans Platform to actually build a proper GUI application to act as a front end that could tie together a lot of loose code I had.
So why would I want to use the NetBeans Platform? Programming is currently not part of my job, nor was it ever - it's one of my hobbies. As an engineer, but not being intimately involved in the nitty-gritty of engineering on a day to day basis, I've found that the discipline of writing code to solve a particular task really helps to reinforce the first principles involved. The NetBeans Platform offered the promise of allowing me to focus on the writing something useful but without having to worry too much about the nuts and bolts of putting an application together.
Surprisingly the NetBeans Platform learning curve wasn't anywhere near as bad as I thought it might be, and once I discovered the Matisse GUI Builder I was set. Then at the end of last year I got talking with my dad about how he kept getting asked if there was a 'PC version' of the software he helped devise that at the time only ran on Solaris. I say 'devise' because he isn't really a programmer either - but he crafted logic behind the algorithms that were used. However, one thing he did have was the source code and I figured that all I needed to do was port the algorithms to Java, ditch the rest and re-write the GUI/display parts from scratch. This is what I've nearly finished doing and is the main aspect of the screenshots below.
First screenshot shows a greyscale scan of a seismic section that was printed out on the left and then on the right you have the digital recreation of the original data shown using a colour density display. In essence this is 'OCR for seismic data' and underlying it are older Fortran and C routines that I ported to Java and have then used the NetBeans Platform to put a much nicer front end onto than the original which was very clunky to say the least. We call this module 'Resurrect'. :-)
Second screenshot shows a few of the other modules I've been working on. Left is another seismic section, top right is a well log (this is very early stage of work, but for the purpose of a screenshot I think it's pretty enough and shows you can use custom Swing components easily within the NetBeans Platform) and the bottom right is the output to a Monte Carlo simulation that estimates oil and gas reserves.
The third screenshot shows some of the image preparation stages that are needed as part of the Resurrect workflow. On the left is where you can digitize points onto the image, which are then used in an image warp algorithm to get everything orthogonal. On the right, the original image has now been converted to monochrome and there are guidelines overlaid on the image to check that it really is now straight.
A critique might be that these are just Java Swing screenshots. To some extent, that is true, but that would be grossly unfair to the NetBeans Platform. I might not be using much "visual" stuff at the moment, i.e., properties/navigation, etc., but I am definitely using the obvious stuff: the window system, the menus, the toolbars (with parts that depend on what is selected in the Lookup), plus some of the parts that can't be seen such as the autoupdate feature, the using of Matisse to lay out the forms, etc.
Also, from my perspective, the benefit that the NetBeans Platform brings is that all that basic stuff just works. That means I can focus my effort on the two things that matter: algorithms and custom GUI components.
Opinions expressed by DZone contributors are their own.