bryanhanson / readJDX

Import spectroscopic data in the JCAMP-DX format
https://bryanhanson.github.io/readJDX/
8 stars 2 forks source link

Incorrect x values #3

Closed rguliev closed 8 years ago

rguliev commented 8 years ago

Hi, loading attached file, I got:

> head(j$`Single Spectrum_025_SpecData 2`)
             x       y
1 -0.005094019 5652.666
2 -0.005044224 5664.924
3 -0.004994429 5675.768
4 -0.004944634 5683.785
5 -0.004894839 5687.561
6 -0.004845044 5685.900

There is head of the file:

##NPOINTS=3675
##FIRSTX=-5.0940187E+01
##LASTX=1.7785235E+03
##MAXX=1.7785235E+03
##MINX=-5.0940187E+01
##MAXY=6.7534583E+04
##MINY=5.6481120E+03
##XFACTOR=1.0000000E-04
##YFACTOR=1.0000000E-03
##FIRSTY=5.6526665E+03
##DELTAX=4.9794874E-01
##XUNITS=1/CM
##YUNITS=ARBITRARY UNITS
##XYDATA=(X++(Y..Y))
     -509401     5652666     5664924     5675768     5683785     5687561
     -484504     5685900     5679689     5670985     5661857     5654349

Seems like x values multiplied by 1.0e-08 instead of 1.0e-04. I couldn't figure out the reason.

ag sub 79 1.txt

bryanhanson commented 8 years ago

Rustam, this is fixed with https://github.com/bryanhanson/readJDX/commit/3ff7868b60cdb6bbad8e3a58fae40c3429353f90. Thank you for the report.