[vtkusers] About read Double data form files

Xin Zhao zxem at my169.com
Fri Aug 1 04:44:59 EDT 2003


Dear all,

     I read the data from the STF file into vtkDoubleArray. Then I output the data in the vtkDoubleArray. But I find a precision problem. The origianl data is different with the readed data.

     Does anyone can help me?

----------------Original  Data--------------------------------

0.000108115 0.000108359 0.000108854 0.000109615 0.000110673 0.000112077 0.000113903 0.000116259 0.000119304 0.000123261 0.000128439 0.000135249 0.000144205 0.000155884 0.000170833 0.000189402 0.000211594 0.00023695 0.00026452 0.000292958 0.000320071 0.000339371 0.000351409 0.000358484 0.000362605 0.000365186 0.000367077 0.000368506 0.000369237 0.000369483 0.00037023 0.00037162 0.000372666 0.000372814 0.000372079 0.000369778 0.00036393 0.000351061 0.000326656 0.000287857 0.000239782 0.000199901 0.000170233 0.000149502 0.000135556 0.000126279 0.000120046 0.000115774 0.00011278 0.000110644 0.000109105 0.000107994 0.000107198 0.000106638 0.000106252 0.000105998 0.000105837 0.00010574 0.000105679 0.000105647

----------------Read into vtkDoubleArray and output-----------
1.0811499669216573E-4
1.0835900320671499E-4
1.0885400115512311E-4
1.0961500083794817E-4
1.1067299783462659E-4
1.1207700299564749E-4
1.139029991463758E-4
1.1625899787759408E-4
1.1930400069104508E-4
1.2326099385973066E-4
1.2843900185544044E-4
1.3524900714401156E-4
1.4420499792322516E-4
1.558840012876317E-4
1.70832994626835E-4
1.8940199515782297E-4
2.1159400057513267E-4
2.3694999981671572E-4
2.6452000020071864E-4
2.929579932242632E-4
3.200710052624345E-4
3.3937100670300424E-4
3.5140899126417935E-4
3.5848398692905903E-4
3.6260500201024115E-4
3.651859879028052E-4
3.670770092867315E-4
3.685060073621571E-4
3.692370082717389E-4
3.694829938467592E-4
3.702300018630922E-4
3.716200008057058E-4
3.726659924723208E-4
3.728139854501933E-4
3.7207899731583893E-4
3.6977799027226865E-4
3.6393001209944487E-4
3.510609967634082E-4
3.266560088377446E-4
2.8785699396394193E-4
2.397820062469691E-4
1.9990099826827645E-4
1.702330046100542E-4
1.495019969297573E-4
1.3555599434766918E-4
1.2627900287043303E-4
1.200460028485395E-4
1.1577399709494784E-4
1.1277999874437228E-4
1.1064400314353406E-4
1.091049998649396E-4
1.0799399751704186E-4
1.0719800047809258E-4
1.0663799912435934E-4
1.062520022969693E-4
1.0599799861665815E-4
1.0583700350252911E-4
1.0574000043561682E-4
1.0567899880697951E-4
1.0564699914539233E-4
1.0811499669216573E-4
1.0835900320671499E-4
1.0885400115512311E-4
1.0961500083794817E-4
1.1067299783462659E-4
1.1207700299564749E-4
1.139029991463758E-4
1.1625899787759408E-4
1.1930400069104508E-4
1.2326099385973066E-4
1.2843900185544044E-4
1.3524900714401156E-4
1.4420499792322516E-4
1.558840012876317E-4
1.70832994626835E-4
1.8940199515782297E-4
2.1159400057513267E-4
2.3694999981671572E-4
2.6452000020071864E-4
2.929579932242632E-4
3.200710052624345E-4
3.3937100670300424E-4
3.5140899126417935E-4
3.5848398692905903E-4
3.6260500201024115E-4
3.651859879028052E-4
3.670770092867315E-4
3.685060073621571E-4
3.692370082717389E-4
3.694829938467592E-4
3.702300018630922E-4
3.716200008057058E-4
3.726659924723208E-4
3.728139854501933E-4
3.7207899731583893E-4
3.6977799027226865E-4
3.6393001209944487E-4
3.510609967634082E-4
3.266560088377446E-4
2.8785699396394193E-4
2.397820062469691E-4
1.9990099826827645E-4
1.702330046100542E-4
1.495019969297573E-4
1.3555599434766918E-4
1.2627900287043303E-4
1.200460028485395E-4
1.1577399709494784E-4
1.1277999874437228E-4
1.1064400314353406E-4
1.091049998649396E-4
1.0799399751704186E-4
1.0719800047809258E-4
1.0663799912435934E-4
1.062520022969693E-4
1.0599799861665815E-4
1.0583700350252911E-4
1.0574000043561682E-4
1.0567899880697951E-4
1.0564699914539233E-4
1.0811499669216573E-4
1.0835900320671499E-4
1.0885400115512311E-4
1.0961500083794817E-4
1.1067299783462659E-4
1.1207700299564749E-4
1.139029991463758E-4
1.1625899787759408E-4
1.1930400069104508E-4
1.2326099385973066E-4
1.2843900185544044E-4
1.3524900714401156E-4
1.4420499792322516E-4
1.558840012876317E-4
1.70832994626835E-4
1.8940199515782297E-4
2.1159400057513267E-4
2.3694999981671572E-4
2.6452000020071864E-4
2.929579932242632E-4
3.200710052624345E-4
3.3937100670300424E-4
3.5140899126417935E-4
3.5848398692905903E-4
3.6260500201024115E-4
3.651859879028052E-4
3.670770092867315E-4
3.685060073621571E-4
3.692370082717389E-4
3.694829938467592E-4
3.702300018630922E-4
3.716200008057058E-4
3.726659924723208E-4
3.728139854501933E-4
3.7207899731583893E-4
3.6977799027226865E-4
3.6393001209944487E-4
3.510609967634082E-4
3.266560088377446E-4
2.8785699396394193E-4
2.397820062469691E-4
1.9990099826827645E-4
1.702330046100542E-4
1.495019969297573E-4
1.3555599434766918E-4
1.2627900287043303E-4
1.200460028485395E-4
1.1577399709494784E-4
1.1277999874437228E-4
1.1064400314353406E-4
1.091049998649396E-4
1.0799399751704186E-4
1.0719800047809258E-4
1.0663799912435934E-4
1.062520022969693E-4
1.0599799861665815E-4
1.0583700350252911E-4
1.0574000043561682E-4
1.0567899880697951E-4
1.0564699914539233E-4

-----------I use Java language----------------
s = in.readLine();
t = new StringTokenizer(s," ");
for(int j=0; j<dimensions_x; j++)
{
	int offset = i*dimensions_x + j;
	scalars.InsertTuple1(offset,Double.parseDouble((t.nextToken())));
	System.out.println(scalars.GetTuple1(offset));
}

Thanks!
                                                                 xin zhao






More information about the vtkusers mailing list