gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
277 stars 61 forks source link

problem(s) within POLY_FIT when X is not float + status always (??) equal to 1 #1888

Open alaingdl opened 1 month ago

alaingdl commented 1 month ago

I have some data (eg. Zanardo 1.4 GHz --I provided below the data--) and :

GDL> help, d,z
D               INT       = Array[37]
Z               FLOAT     = Array[37]
GDL> print, poly_fit(d,z, 4,yf=yf, st=st) & plot, d,z,/yno & oplot, d, yf, psy=-2
      -497.61505      0.11287219  -6.8974248e-05   0.00011488228   0.00016039931
GDL> print, poly_fit(float(d),z, 4,yf=yf, st=st) & plot, d,z,/yno & oplot, d, yf, psy=-2 & print, st
       1.0000000     -0.48175898   0.00022248133  -3.2847313e-08   1.6740198e-12

but

IDL> print, poly_fit(float(d),z, 4,yf=yf, st=st) & plot, d,z,/yno & oplot, d, yf, psy=-2 & print, st
% Compiled module: POLY_FIT.
% Loaded DLM: LAPACK.
     -46525.3
      26.0033
  -0.00541547
  4.99087e-07
 -1.70948e-11
           0
IDL> print, poly_fit(d,z, 4,yf=yf, st=st) & plot, d,z,/yno & oplot, d, yf, psy=-2 & print, st
     -46525.3
      26.0033
  -0.00541547
  4.99087e-07
 -1.70948e-11
           0
GDL> print, d, z
    6139    6172    6199    6244    6283    6355    6461    6494    6526    6603    6627    6690    6770    6836    6889    6967
    6989    7039    7084    7202    7231    7283    7297    7370    7437    7486    7558    7580    7622    7692    7730    7802
    7847    7901    7932    7991    8014
      206.500      208.700      208.500      217.400      213.000      224.900      235.000      242.800      237.000
      252.600      251.500      251.500      258.600      264.500      272.500      276.400      281.300      294.900
      287.100      312.800      304.400      285.200      315.200      332.400      342.500      339.700      355.800
      348.300      361.000      371.000      379.200      385.800      389.900      414.300      414.600      421.600
      421.500