Tuesday, June 29, 2010

Routing Slicing


Just like we had a GRIB Slicing feature, you can now visualize the conditions at the routing level.
Drag the mouse on the top pane, and that tells you where you are on the chart, with a big red dot.
Beside that, it was so windy today in Oyster Point that the wind blew my glasses off my nose... I just could see them sinking 30 feet away from the dock. Rats!

Sunday, June 13, 2010

Dynamic Java compilation, from a String

Kind of out the the scope of this blog, but as it made me sweat, it might be interesting for some people... The main goal was initially to be able to dynamically override a method of some (Java) class, compile and run it.
I used it for Unit Testing (JUnit), to have the setUp() method of some generic test object to initialize some System variables, context dependent (defined by some properties file).
It's about being able to dynamically generate the code to compile into a String (or StringBuffer, or byte array, or whatever...), compile, load and run it. It is not as trivial as it sounds.
Here is the code I used.

And it is possible not to write the class on the file system. Everything happens in memory.

Tuesday, April 27, 2010

Moving to Google Code

I'll be moving the code to the Subversion repository of Google Code.
We will have at least the following projects:
- javanmeaparser
- coreutilities
- chartcomponents
- weatherwizard
- fullnmeaconsole
This way, the code will be safe. I am using Oracle's JDeveloper and its Subversion extension, that works like a charm. The Weather Wizard is using a Swing graphical interface. This is not managed nicely by an IDE like Eclipse.
The last project is this NMEA Console I have been working on.


Thursday, March 11, 2010

Fax crawler, for SailMail users

I wanted to get something more dynamic for the patterns that can be used at sea...
When ashore, no problem, the faxes are pulled out from the Internet.
At sea, that's different, you have GetFax (from SailMail) downloading the faxes from the SSB onto your hard drive, and when it's about putting the faxes together in a composite, that used to be a painful experience, you had to locate the faxes one by one... Baaaaad.
There is now a new kind of dynamic pattern. If the protocol used to get the fax(es) is not http, then there is a surprise. There is a "search:" protocol implemented like in:

search:chartview.util.SearchUtil.findMostRecentFax(".*500.*", "${fax.path}")

That allows the soft to crawl the directory where the faxes are downloaded.
It does not look that friendly, but that is quite powerful, and extendable. After the "search:" keyword is the name of the Java class and method used to find the right fax. That method must be static, take two String parameters, and return a String value, that's all. The first parameter is a regular expression to match the description of the fax to find. SailMail appropriately stores this information when a fax is downloaded through GetFax... The second parameter is the root directory to start the search from, to find the most recent, matching the regular expression pattern. In the example above, it is the value of the path stored in the Weather Wizard preferences.
It is extendable in the sense that you can write your own crawlers, in Java. It just needs to be put in the classpath.
The same kind of syntax and method is available for the GRIBs as well.

search:chartview.util.SearchUtil.findMostRecentFile(".*\.(grb|grib)$", "${grib.path}")

The idea when at sea is to have GetFax running in "auto" mode for a while, and then to use this kind of composite pattern in the Weather Wizard. This way, this rendering is just one - I said "one" - click away:



Even fuzzy faxes make sense. Click the image... Cool!
To learn how to use this feature the best way, just Google "Regular Expression", this is soooooooooooo kewl!

Friday, February 19, 2010

Contour detection

I just finished big improvements in the contour detection of the GRIBs. The performances are now correct (a few milliseconds per GRIB layer, for a full Pacific GRIB 2 degrees by 2 degrees).
Now the contour detection can be part of a GRIB Animation.
In addition, there are now new check boxes to show and hide already computed contour lines, just like for the faxes.
The picture shows PRMSL and 500HGT contours detected in a South Pacific GRIB. Notice that there is now an option to show only the detected contours (with no wind or other GRIB data).

Thursday, February 11, 2010

Kick-ass Processing

That has been on my todo list for quite a while, rendering a GRIB with the Processing framework. Here is a first glance at what it can look like




Move the mouse on the figure to move the light. Drag the mouse to rotate the figure.
It is a 3D representation of the Pressure at Mean Sea Level on 2010-Feb-11.
I finally understood how the thread model of Processing is done. Once you get it, it's all downhill!

Monday, February 1, 2010

Archives 2009 available

From this page, you can now reach several kinds of archives, along with real-time data. We had in the past the composites archives - which can be opened and rendered by the Weather Wizard - we now have images generated after the composites, they can be visualized from your browser.
Check out this link for details.

Tuesday, January 5, 2010

Color Faxes

We can now integrate color faxes, like this one.
It is a bit special in the sense that
  • It's a square projection (Anaximandre)
  • It is in several colors.
Anaximandre never was a problem, but the multiple colors is something that was not managed.
We now have the possibility to just make a fax transparent, without changing the black to another color (which is a possibility that still remains).
Having the colored fax transparent allows as usual superimposition with other data, like GRIBs or charts.
We can produce a rendering like this:
Some improvements in the image processing have been done too, regarding the transparency, and the sharp and blur. Looks much nicer. I had the idea of doing it by looking at what OpenCPN was doing for their charts rendering, which is much nicer than Maptech, based on the same data files.

Saturday, November 21, 2009

3rd dimension for GRIB smoothing

We already had the surface (2D) smoothing, we now have a time smoothing for the GRIB data.
That means that you can get a better resolution for the GRIB cell (divide the cells, and set the values based on the ones of the cells around), the same is now available for time.
You download a 2 degrees by 2 degrees GRIB, for 3 days, every 24 hours, you can very well render a GRIB of 1 degree by 1 degree (or less), every 1 hour. And it works pretty well (offshore, of course, local coastal phenomenons, like the one shown here, cannot be taken care of by a GRIB).
In addition, some performance issues have been fixed, impacting the GRIB animation. With the previously described feature, we can now generate an animation that shows a frame every hour.
That will definitely minimize the demand on the SSB, when downloading the data at sea.
For example, you download a GRIB file for a given area, with cells 2° × 2°, with a frame every 24 hours. With the smoothing, you can easily display it with a 1° × 1° resolution (or less, your call), and with a frame every 1 hour. The equivalent GRIB would be 2×2×24 times bigger, that it 96 times bigger. That does not sound that great, but you can put it another way: instead of 1 minute to download it, it will take more that 1 and half hour. Sounds more convincing like that!
In addition, the dustlets take advantage of the same feature, you can watch really smooth animations.

Example:

A Composite has been displayed
Hide the faxes and place labels
Change the wind display to colors
Play animation, it's anything but smooth


Set a (2D) smoothing factor of 3
Looks better for each frame
Play animation, it's still not ideal


Now, set the time smoothing factor so it generates a frame every one hour
Play animation, it's now much better, perturbations evolution becomes way clearer.
Vancouver is going to be windy and wet again ;)

Friday, September 25, 2009

Externalizing the Look and Feel option

The possibility to apply a Swing Look and Feel on the UI has been externalized. You can apply any Look and Feel you want, its name will be mentioned in the command-line, or in the shortcut properties. That brings more flexibility to the user, and cuts the dependencies with the providers.
On the right is an example of what's possible, using the "Napkin" Look and Feel.
The default look and feel is the System one, not the Metal one (Java default).
Those who have already installed the program should re-install it, as some modifications in the launching script were made.