Menu

#16 IFP Image WX Grid Image Question

1.0
open
nobody
None
2018-05-26
2018-05-21
No

I am having to learn how these scripts work so that I can customize them. I'm making a Wx grid display and I've customized it, and still have to...but my question is how do I get rid of the white grid line seperating my wx types? I want those smoothed. Doing image smoothing does not work here. I also attempted to do the joinpolyline setting to 1 and got a no go. See my attatched image. I am planning to make this with all of the available options and kinda make it how it displays on graphical.weather.gov click states and zoom into a region :) I'm not going to copy obviously...but I want it to be smooth like that not showing the seperation line.

While discussing images.. I'd love for the logo options to work so I could put my own logo on it and not the noaa or nws logo.. I've got some crazy great ideas!

1 Attachments

Discussion

  • Michael Foland

    Michael Foland - 2018-05-22

    I also want to remove the default wx conditions that show up on the map, and only show them where I place my own ISC points. I've looked over both my gfeConfig and my WX_IFPImage scripts. My WX_IFPImage is the custom script I'm making for the WX and it will have all the available conditions! The conditions are also in the PrettyWx label!

     
  • Mike Romberg

    Mike Romberg - 2018-05-26

    I think what your are referring to as the white grid line seperating weather types is called a "bounded area" in the gfe. The Wx and Discrete data types are both considered bounded area types by the code. Looking at BoundedAreaVisual.C it looks like these can be enabled and disabled with the configuration option "BoundedArea_Boundary". It is '1' by default. And setting it to 0 should cause these to not be rendered.

    The ifp.Image program is simply the gfe code running behind the scenes without any user interface.   Instead of painting into an X11 window it renders into a png image.   So, anything you can paint in the gfe's spatial editor you can also do with ifp.Image.   And of course, anything you can't do with the spatial editor the ifp.Image can't do either.  So, it is sometimes easier to experiment with settings using the gfe first and then move them to the ifp.Image setup.
    
      I do plan on adding back some way to add "logo" images to ifp.Image.  The existing method simply dumped in ones that the user could not specify and were of a fixed size.    There was no way to change the logo image at all.   What I'm planning on doing is adding a way for alternate logo image(s) to be specified in the config file.  There will probably be some restrictions on what these images sizes can be (and I may resize logos to fit). Doing this looks fairly straight forward.
    
        Creating more sophisticated images with ifp.Image (beyond what the spatial editor can do) is probably beyond what is practical from the gfe code itself.   However it is not impossible.  Early versions of weather.gov did use ifp.Image.  But I think soon moved beyond that and are now rendering graphics from the raw grids using stand alone graphics libraries.
    
          A couple of simple and powerful python based image libraries I can think of are PIL and gd.  The gfe itself uses gd to make the png images.  And one could add logos, outlines, text or whatever you want ontop of the images created by ifp.Image by simply creating a python script that modifies each image and adds those features.   This is in fact exactly what the ifp.Image script itself does to tack on the logos.  The advantage of doing it yourself is that there is infinite flexablility.
    

    Rendering images with an external script is also not that difficult. One can pull the raw grids out of the gfe via the web interface in several different formats such as netcdf. In less that a page of code or so, you can write a python script which can download the grid from the web interface, decode the netcdf and pump it through an image library like gd or PIL and have a basic graphic. Of course, things get more complicated beyond a simple graphic. But then every aspect of the image creation is under your control. That is what weather.gov is doing now.

     The ifp.Image code is really the spatial editor rendering code.  It was written to create graphics for that purpose.  So, it may not be a perfect match for the kind of graphics needed for web applications.   But the grids are there.  And if one wants to, it is possible to render the grids any way you would like with whatever tools you would like.
    
     
  • Michael Foland

    Michael Foland - 2018-05-26

    Play with this code: I couldn't get the stuff to show right.. For No Wx it would show Frzng Drzl lol...
    Starting at Line 62 is and down is what I've been working on. As you can see I only got up to sleet, because there are so many options lol. Things don't show like they should... Severe even shows as just Tstorms when in Pretty Wx I have T+ defined at severe. You can make that a config file in GFE and play around with it :)

     
  • Michael Foland

    Michael Foland - 2018-05-26

    Also I only want it to show my custom IFC Samples, but it shows the defaults as well.. Not sure how to fix that.

     
  • Michael Foland

    Michael Foland - 2018-05-26

    The BoundedArea worked... Try setting some custom points and for the sake of my script if you use it.. name them FcstPoints and make a WX Grid then go to PNG Images under scripts then type in WX_IFPImage

    You will see it has the default and custom points.

     

Log in to post a comment.