Re: slow 2d image generation

Hello Jim,

perhaps all the string manipulation in TextAdapter is slowing
you down.  Are you able to create the field using the TextAdapter
and then serialize it?  Next time you run your program, you can
deserialize the field.

Here is some pseudo-code:

public Field load(String name)
{
  if ("name.serialized" exists) {
    field = deserializeField("name.serialized");
  } else {
    field = loadWithTextAdapter("name.txt");
    serializeForLaterUse(field);
  }
  return field;
}

Regards,
Jim.
---
Jim Koutsovasilis
Bureau of Meteorology, Australia
jimk@xxxxxxxxxx


On Mon, Jan 05, 2004 at 06:37:51PM -0600, Jim Cookas wrote:
> jim
> 
> i just switched to a DisplayImplJ3D with a TwoDDisplayRendererJ3D...the image 
> did not load much faster, but it definitely looked much better (less grainy) 
> and the pan/zoom functions were very smooth...basically it solved #2 and #3 
> problems from my initial email, but #1 still remains....any ideas on loading 
> data into visad more quickly?....the file is only 147k, so it should be 
> quick, right?
> 
> thanks to jim k for the suggestion!
> 
> jc
> 
> > -----Original Message-----
> > From: Jim Koutsovasilis [mailto:jimk@xxxxxxxxxx]
> > Sent: Monday, January 05, 2004 4:46 PM
> > To: Jim Cookas
> > Cc: visad@xxxxxxxxxxxxxxxx
> > Subject: Re: slow 2d image generation
> > 
> > 
> > Hello Jim,
> > 
> > if you are using a DisplayImplJ2D display, try a 
> > DisplayImplJ3D instead.
> > It might be faster.
> > 
> > Regards,
> > Jim.
> > ---
> > Jim Koutsovasilis
> > Bureau of Meteorology, Australia
> > jimk@xxxxxxxxxx
> > 
> > On Mon, Jan 05, 2004 at 04:24:52PM -0600, Jim Cookas wrote:
> > > hello group
> > > 
> > > first off, many thanks to all who helped with my previous 
> > question regarding constant maps...however, i now have a new 
> > problem...
> > > 
> > > the application i am currently developing with visad has a 
> > feature to load and display 2d image data from an ascii 
> > file...i am using the textadapter class to read the file and 
> > turn into a flatfield...the ascii file is in the tab-spaced 
> > format that the textadapter class can read....here is a snip 
> > of the first five lines of an example ascii file:
> > > 
> > > <snip>
> > > (Down_Range,Cross_Range)->(RCS)           
> > > Down_Range        Cross_Range     RCS
> > > -755.383  -755.383        -124.0984508
> > > -731.684  -755.383        -124.0586397
> > > -707.986  -755.383        -123.995843
> > > -684.288  -755.383        -123.9096856
> > > 
> > > ...and so on
> > > </snip>
> > > 
> > > in this case, 'down_range' maps to the x-axis, 
> > 'cross_range' maps to the y-axis, and 'rcs' maps to an rgb 
> > value...everything loads and displays fine, but there are 
> > three major problems:
> > > 
> > > 1) loading the data is ___sloooow___...the example file i 
> > snipped above comes to 147515 bytes (256 x 256 image size) 
> > and it takes a solid 30 seconds from when the file is opened 
> > to when the image is finally displayed...we have c++ code in 
> > other applications that loads and displays the same data 
> > almost instantly...is it a java problem?...is it visad?...is 
> > it something i'm doing wrong?
> > > 
> > > 2) panning and zooming of the image (and line plots for 
> > that matter) are slow and choppy...when data is rendered as 
> > points, these functions are very quick, smooth, and 
> > acceptable...is there any way to speed up panning/zooming?
> > > 
> > > 3) is there any way to increase the resolution of the image 
> > rendering to make it more 'smooth'?...right now it looks 
> > textured...when zoomed in closely, the data points look very 
> > triangular...any ideas?
> > > 
> > > thanks in advance for any help that can be provided...let 
> > me know if you need more information from me...peace!
> > > 
> > > jc
> > > 
> > 
> > 

  • 2004 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: