Re: [visad] Linear*DSet progression arguments... bug or feature?

Hi Stefan-

On 3/14/12 4:08 AM, Stefan Below wrote:
Ok,
i found a solution that works. If i assign my user defined Time Unit to
the XAxis scalarMap, and not to the Linear1DSet, it works.
But why does it not work with the other way?

Good catch. The ScalarMap will use the defaultUnit of the RealType mapped to Display.XAxis which I would assume in your case is "seconds since 1970-01-01". So, if you want something else, then you need to set the overrideUnit as you found out.

Don

HI All,

for the first plot, it was the axis scaling. If i set the range
manually, it looks ok.

But for the flow chart, the problem still exist.after several hours of
testing, it is ( for my understanding) not an precision/floating point
issue, because the labels on the Axis are correct. If I change the
scale, it does not affect interpolation issue of flows
(http://tinypic.com/view.php?pic=207vuz7&s=5).

I think it has something to do with the Time Unit. When i try the

The dateUnit config String: s since 2011-06-15 07:40:04.000 UTC 4814
Linear1DSet xSet=new Linear1DSet(flowChartMathTypes.xAxis,0,
4814,2396, null, new Unit[]{dateUnit}, null);

DateTime is correctly displayed on xAxis (so no floating point
problem). But the flows are interpolated like this:
http://tinypic.com/r/uadxg/5

If i use the Linear1DSet wtihout timeUnit like
Linear1DSet xSet=new Linear1DSet(flowChartMathTypes.xAxis,0,
4814,2396, null, null, error);

Plot is ok, http://tinypic.com/view.php?pic=2s7civq&s=5
but incorrect axis labels (because of the missing units in the
linear1DSet).

And if i set the dateUnit config string to: s since 1800-02-19
00:00:00.000 UTC 4814

i get this funny chart: http://tinypic.com/r/2u47era/5 (only 11 points
on x Axis where the flows are plotted).

Does the Time Unit affect the scaling on the Axis? Or how can i change
the precision/interpolation of the plot?

Thanks,

Stefan











Hi Stefan-

Again, I think what you are seeing is a precision problem. For the
first time series plot, I think when you use time that the time
series is being condensed because the range of the times is 11 days
from the look of the plot. You could probably set the range on the x
axis to be a smaller range and see the whole line. Similarly for the
vector plots.

Following on Curtis' suggestion, you could use a different unit than
seconds since 1970-01-01 00:00:00. You could use:

Unit dateUnit = visad.data.units.Parser.parse("seconds since
2012-03-13 00:00:00);

(or whatever you want for a reference time) and then use that unit as
the Set Units in the Linear*DSet constructor:

domain_set = new Linear2DSet(domain_tuple, 0.0, NROWS, NROWS,
0, NCOLS, NCOLS, (CoordinateSystem) null, new Unit[] {dateUnit},
(ErrorEstimate[]) null);

Don




On 3/13/12 7:04 AM, Stefan Below wrote:
Hi,
what i wanna do is plotting time series.

When i set the Linear*set or griddedset to fake dates (eg. from 0 to
numbers of steps)
time_set = new Linear1DSet(time, 0,5, 5);

the plot is ok. (http://tinypic.com/r/121ykxl/5)

But when i change the Linearset to real time values like

double currentTime = new DateTime().getValue();
time_set = new Linear1DSet(time, currentTime,currentTime+5, 5);


i get this plot: http://tinypic.com/r/161hw0n/5
(Axis labels are correct, but plot shows only one singe vertical line)


xAxis is mapped to RealType.Time

Thanks for your help,
Stefan

Am 13.03.2012 14:49, schrieb Don Murray:
Hi Stefan-

I'm not sure what you mean by "the plot looks very strange".
Linear*DSets are backed by float values, so when you use very large
numbers, you will run into precision problems. If you need that type
of precision, then you could use the Gridded*DDoubleSet.
Unfortunately, there are no Linear*DDoubleSet classes.

Don

On 3/12/12 9:26 AM, Stefan Below wrote:
Hello,

i am just start learning this powerful visualisation library and now
some questions come up.

When i use Linear*DSet with arithmetic progression, i get different
visualisation results when first/last arguments are quite high.

For example, if i use this
domain_set = new Linear2DSet(domain_tuple, 0.0, NROWS, NROWS,
0, NCOLS, NCOLS);

the plot looks fine.

But when i use
long xEnd=System.currentTimeMillis();
long xStart = xEnd-NCOLS;
domain_set = new Linear2DSet(domain_tuple, 0.0, NROWS, NROWS,
0, NCOLS, NCOLS);

(Look at the attachment for a full working example , line 112ff)

The plot looks very strange.
I expect that the plot is the same except the labels of the xAxis.

Maybe someone can give me a hint?

Or do i have to set the Axis values in an other way?

Thanks,
Stefan Below






_______________________________________________
visad mailing list
visad@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/


_______________________________________________
visad mailing list
visad@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/


_______________________________________________
visad mailing list
visad@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/

_______________________________________________
visad mailing list
visad@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/

--
Don Murray
NOAA/ESRL/PSD and CIRES
303-497-3596
http://www.esrl.noaa.gov/psd/people/don.murray/



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