Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolation result is NaN for large number of samples #92

Open
wsshin opened this issue Mar 2, 2023 · 1 comment
Open

Interpolation result is NaN for large number of samples #92

wsshin opened this issue Mar 2, 2023 · 1 comment

Comments

@wsshin
Copy link

wsshin commented Mar 2, 2023

I get NaN as the result of interpolation when the number of samples is large (e.g., N = 700). I tried to reproduce the problem with a simpler set of samples, but I couldn't, so I copy and paste the problematic sample points and values below; sorry for the inconvenience.

xs = [8.000064047793606e-7, 8.000230069522153e-7, 8.000396098141591e-7, 8.000562133652352e-7, 8.000728176054861e-7, 8.000894225349546e-7, 8.00106028153684e-7, 8.001226344617173e-7, 8.001392414590971e-7, 8.001558491458663e-7, 8.00172457522068e-7, 8.001890665877453e-7, 8.002056763429408e-7, 8.002222867876977e-7, 8.002388979220586e-7, 8.002555097460667e-7, 8.00272122259765e-7, 8.002887354631964e-7, 8.003053493564036e-7, 8.003219639394298e-7, 8.003385792123181e-7, 8.003551951751113e-7, 8.003718118278524e-7, 8.003884291705842e-7, 8.004050472033498e-7, 8.004216659261924e-7, 8.004382853391548e-7, 8.0045490544228e-7, 8.004715262356107e-7, 8.004881477191903e-7, 8.005047698930617e-7, 8.00521392757268e-7, 8.005380163118519e-7, 8.005546405568565e-7, 8.005712654923252e-7, 8.005878911183006e-7, 8.006045174348258e-7, 8.006211444419438e-7, 8.006377721396977e-7, 8.006544005281306e-7, 8.006710296072856e-7, 8.006876593772053e-7, 8.007042898379331e-7, 8.007209209895121e-7, 8.007375528319853e-7, 8.007541853653957e-7, 8.007708185897861e-7, 8.007874525051998e-7, 8.0080408711168e-7, 8.008207224092698e-7, 8.00837358398012e-7, 8.008539950779496e-7, 8.008706324491258e-7, 8.00887270511584e-7, 8.00903909265367e-7, 8.009205487105177e-7, 8.009371888470795e-7, 8.009538296750955e-7, 8.009704711946086e-7, 8.009871134056622e-7, 8.010037563082989e-7, 8.010203999025621e-7, 8.010370441884952e-7, 8.010536891661409e-7, 8.010703348355424e-7, 8.010869811967429e-7, 8.011036282497858e-7, 8.011202759947138e-7, 8.011369244315702e-7, 8.011535735603979e-7, 8.011702233812404e-7, 8.011868738941408e-7, 8.012035250991422e-7, 8.012201769962877e-7, 8.012368295856203e-7, 8.012534828671833e-7, 8.012701368410202e-7, 8.012867915071738e-7, 8.013034468656871e-7, 8.013201029166035e-7, 8.013367596599665e-7, 8.013534170958188e-7, 8.013700752242038e-7, 8.013867340451646e-7, 8.014033935587443e-7, 8.014200537649864e-7, 8.01436714663934e-7, 8.014533762556301e-7, 8.01470038540118e-7, 8.014867015174411e-7, 8.015033651876425e-7, 8.015200295507654e-7, 8.015366946068527e-7, 8.015533603559481e-7, 8.015700267980948e-7, 8.015866939333359e-7, 8.016033617617145e-7, 8.016200302832739e-7, 8.016366994980574e-7, 8.016533694061084e-7, 8.0167004000747e-7, 8.016867113021853e-7, 8.017033832902978e-7, 8.017200559718508e-7, 8.017367293468873e-7, 8.017534034154509e-7, 8.017700781775845e-7, 8.017867536333314e-7, 8.018034297827354e-7, 8.018201066258393e-7, 8.018367841626864e-7, 8.0185346239332e-7, 8.018701413177837e-7, 8.018868209361206e-7, 8.01903501248374e-7, 8.01920182254587e-7, 8.019368639548032e-7, 8.019535463490658e-7, 8.019702294374182e-7, 8.019869132199035e-7, 8.020035976965653e-7, 8.020202828674466e-7, 8.020369687325911e-7, 8.02053655292042e-7, 8.020703425458424e-7, 8.02087030494036e-7, 8.021037191366658e-7, 8.021204084737754e-7, 8.021370985054081e-7, 8.021537892316072e-7, 8.02170480652416e-7, 8.021871727678781e-7, 8.022038655780366e-7, 8.02220559082935e-7, 8.022372532826167e-7, 8.022539481771249e-7, 8.022706437665032e-7, 8.02287340050795e-7, 8.023040370300434e-7, 8.02320734704292e-7, 8.023374330735843e-7, 8.023541321379634e-7, 8.023708318974729e-7, 8.023875323521562e-7, 8.024042335020566e-7, 8.024209353472177e-7, 8.024376378876829e-7, 8.024543411234952e-7, 8.024710450546987e-7, 8.024877496813361e-7, 8.025044550034516e-7, 8.025211610210879e-7, 8.025378677342889e-7, 8.025545751430979e-7, 8.025712832475585e-7, 8.025879920477139e-7, 8.026047015436076e-7, 8.026214117352833e-7, 8.02638122622784e-7, 8.026548342061538e-7, 8.026715464854356e-7, 8.02688259460673e-7, 8.027049731319095e-7, 8.027216874991889e-7, 8.027384025625543e-7, 8.027551183220492e-7, 8.027718347777173e-7, 8.027885519296019e-7, 8.028052697777466e-7, 8.028219883221949e-7, 8.028387075629902e-7, 8.028554275001762e-7, 8.028721481337961e-7, 8.028888694638937e-7, 8.029055914905124e-7, 8.029223142136958e-7, 8.029390376334873e-7, 8.029557617499306e-7, 8.029724865630691e-7, 8.029892120729462e-7, 8.030059382796058e-7, 8.03022665183091e-7, 8.030393927834458e-7, 8.030561210807136e-7, 8.030728500749376e-7, 8.030895797661617e-7, 8.031063101544297e-7, 8.031230412397847e-7, 8.031397730222704e-7, 8.031565055019305e-7, 8.031732386788084e-7, 8.031899725529478e-7, 8.032067071243924e-7, 8.032234423931854e-7, 8.032401783593708e-7, 8.032569150229918e-7, 8.032736523840924e-7, 8.032903904427159e-7, 8.033071291989062e-7, 8.033238686527066e-7, 8.033406088041609e-7, 8.033573496533128e-7, 8.033740912002055e-7, 8.033908334448831e-7, 8.034075763873888e-7, 8.034243200277666e-7, 8.034410643660601e-7, 8.034578094023127e-7, 8.03474555136568e-7, 8.034913015688701e-7, 8.035080486992623e-7, 8.035247965277881e-7, 8.035415450544917e-7, 8.035582942794161e-7, 8.035750442026055e-7, 8.035917948241033e-7, 8.036085461439531e-7, 8.03625298162199e-7, 8.03642050878884e-7, 8.036588042940525e-7, 8.036755584077476e-7, 8.036923132200134e-7, 8.037090687308932e-7, 8.037258249404311e-7, 8.037425818486707e-7, 8.037593394556554e-7, 8.037760977614292e-7, 8.037928567660357e-7, 8.038096164695187e-7, 8.03826376871922e-7, 8.038431379732888e-7, 8.038598997736634e-7, 8.038766622730894e-7, 8.038934254716106e-7, 8.039101893692703e-7, 8.039269539661128e-7, 8.039437192621814e-7, 8.039604852575202e-7, 8.039772519521727e-7, 8.039940193461827e-7, 8.040107874395941e-7, 8.040275562324504e-7, 8.040443257247957e-7, 8.040610959166734e-7, 8.040778668081276e-7, 8.040946383992018e-7, 8.041114106899402e-7, 8.041281836803861e-7, 8.041449573705834e-7, 8.041617317605761e-7, 8.041785068504078e-7, 8.041952826401225e-7, 8.042120591297638e-7, 8.042288363193754e-7, 8.042456142090014e-7, 8.042623927986856e-7, 8.042791720884717e-7, 8.042959520784034e-7, 8.043127327685247e-7, 8.043295141588793e-7, 8.043462962495113e-7, 8.043630790404643e-7, 8.043798625317821e-7, 8.043966467235087e-7, 8.044134316156877e-7, 8.044302172083633e-7, 8.04447003501579e-7, 8.04463790495379e-7, 8.044805781898069e-7, 8.044973665849067e-7, 8.045141556807222e-7, 8.045309454772972e-7, 8.045477359746758e-7, 8.045645271729016e-7, 8.045813190720188e-7, 8.04598111672071e-7, 8.046149049731021e-7, 8.046316989751561e-7, 8.04648493678277e-7, 8.046652890825086e-7, 8.046820851878947e-7, 8.046988819944793e-7, 8.047156795023062e-7, 8.047324777114197e-7, 8.047492766218633e-7, 8.04766076233681e-7, 8.047828765469169e-7, 8.047996775616147e-7, 8.048164792778185e-7, 8.048332816955722e-7, 8.048500848149197e-7, 8.04866888635905e-7, 8.04883693158572e-7, 8.049004983829648e-7, 8.04917304309127e-7, 8.049341109371029e-7, 8.049509182669363e-7, 8.049677262986713e-7, 8.049845350323517e-7, 8.050013444680215e-7, 8.050181546057247e-7, 8.050349654455056e-7, 8.050517769874077e-7, 8.050685892314752e-7, 8.050854021777521e-7, 8.051022158262822e-7, 8.0511903017711e-7, 8.05135845230279e-7, 8.051526609858333e-7, 8.051694774438172e-7, 8.051862946042742e-7, 8.052031124672489e-7, 8.052199310327849e-7, 8.052367503009264e-7, 8.052535702717173e-7, 8.052703909452019e-7, 8.052872123214242e-7, 8.053040344004277e-7, 8.053208571822571e-7, 8.053376806669561e-7, 8.05354504854569e-7, 8.053713297451397e-7, 8.05388155338712e-7, 8.054049816353303e-7, 8.054218086350388e-7, 8.054386363378813e-7, 8.054554647439017e-7, 8.054722938531444e-7, 8.054891236656534e-7, 8.055059541814728e-7, 8.055227854006468e-7, 8.055396173232191e-7, 8.055564499492342e-7, 8.055732832787359e-7, 8.055901173117686e-7, 8.05606952048376e-7, 8.056237874886028e-7, 8.056406236324925e-7, 8.056574604800896e-7, 8.056742980314382e-7, 8.056911362865821e-7, 8.057079752455659e-7, 8.057248149084332e-7, 8.057416552752286e-7, 8.057584963459962e-7, 8.057753381207798e-7, 8.057921805996237e-7, 8.058090237825724e-7, 8.058258676696695e-7, 8.058427122609595e-7, 8.058595575564866e-7, 8.058764035562945e-7, 8.058932502604281e-7, 8.059100976689311e-7, 8.059269457818476e-7, 8.05943794599222e-7, 8.059606441210985e-7, 8.059774943475212e-7, 8.059943452785341e-7, 8.060111969141819e-7, 8.060280492545082e-7, 8.060449022995578e-7, 8.060617560493745e-7, 8.060786105040024e-7, 8.060954656634862e-7, 8.061123215278696e-7, 8.061291780971973e-7, 8.061460353715132e-7, 8.061628933508615e-7, 8.061797520352865e-7, 8.061966114248327e-7, 8.062134715195441e-7, 8.062303323194647e-7, 8.062471938246393e-7, 8.062640560351117e-7, 8.062809189509264e-7, 8.062977825721276e-7, 8.063146468987593e-7, 8.063315119308663e-7, 8.063483776684922e-7, 8.06365244111682e-7, 8.063821112604793e-7, 8.06398979114929e-7, 8.064158476750748e-7, 8.064327169409614e-7, 8.06449586912633e-7, 8.064664575901337e-7, 8.064833289735081e-7, 8.065002010628001e-7, 8.065170738580545e-7, 8.065339473593153e-7, 8.065508215666268e-7, 8.065676964800333e-7, 8.065845720995794e-7, 8.066014484253092e-7, 8.066183254572669e-7, 8.066352031954973e-7, 8.066520816400441e-7, 8.066689607909523e-7, 8.066858406482657e-7, 8.067027212120288e-7, 8.067196024822862e-7, 8.067364844590818e-7, 8.067533671424604e-7, 8.067702505324661e-7, 8.067871346291435e-7, 8.068040194325367e-7, 8.068209049426901e-7, 8.068377911596484e-7, 8.068546780834555e-7, 8.068715657141562e-7, 8.068884540517945e-7, 8.069053430964152e-7, 8.069222328480624e-7, 8.069391233067806e-7, 8.069560144726142e-7, 8.069729063456076e-7, 8.069897989258053e-7, 8.070066922132514e-7, 8.070235862079908e-7, 8.070404809100675e-7, 8.070573763195262e-7, 8.070742724364113e-7, 8.070911692607668e-7, 8.071080667926379e-7, 8.071249650320682e-7, 8.071418639791028e-7, 8.071587636337859e-7, 8.07175663996162e-7, 8.071925650662754e-7, 8.072094668441708e-7, 8.072263693298926e-7, 8.072432725234849e-7, 8.072601764249928e-7, 8.072770810344601e-7, 8.072939863519319e-7, 8.073108923774524e-7, 8.07327799111066e-7, 8.073447065528171e-7, 8.073616147027506e-7, 8.073785235609107e-7, 8.073954331273419e-7, 8.074123434020888e-7, 8.074292543851959e-7, 8.074461660767077e-7, 8.074630784766686e-7, 8.074799915851232e-7, 8.074969054021162e-7, 8.075138199276917e-7, 8.075307351618947e-7, 8.075476511047692e-7, 8.075645677563604e-7, 8.075814851167122e-7, 8.075984031858698e-7, 8.076153219638772e-7, 8.076322414507789e-7, 8.0764916164662e-7, 8.076660825514446e-7, 8.076830041652975e-7, 8.076999264882232e-7, 8.077168495202661e-7, 8.077337732614708e-7, 8.077506977118823e-7, 8.077676228715448e-7, 8.077845487405028e-7, 8.078014753188013e-7, 8.078184026064843e-7, 8.07835330603597e-7, 8.078522593101837e-7, 8.07869188726289e-7, 8.078861188519577e-7, 8.079030496872339e-7, 8.079199812321629e-7, 8.079369134867888e-7, 8.079538464511565e-7, 8.079707801253104e-7, 8.079877145092955e-7, 8.080046496031561e-7, 8.08021585406937e-7, 8.080385219206827e-7, 8.080554591444378e-7, 8.080723970782473e-7, 8.080893357221556e-7, 8.081062750762072e-7, 8.081232151404469e-7, 8.081401559149197e-7, 8.081570973996699e-7, 8.081740395947421e-7, 8.081909825001812e-7, 8.082079261160317e-7, 8.082248704423384e-7, 8.082418154791461e-7, 8.082587612264992e-7, 8.082757076844427e-7, 8.082926548530209e-7, 8.08309602732279e-7, 8.083265513222612e-7, 8.083435006230126e-7, 8.083604506345777e-7, 8.083774013570013e-7, 8.083943527903282e-7, 8.084113049346029e-7, 8.084282577898704e-7, 8.084452113561751e-7, 8.084621656335621e-7, 8.084791206220759e-7, 8.084960763217611e-7, 8.085130327326627e-7, 8.085299898548256e-7, 8.085469476882942e-7, 8.085639062331133e-7, 8.08580865489328e-7, 8.085978254569827e-7, 8.086147861361224e-7, 8.086317475267916e-7, 8.086487096290353e-7, 8.086656724428984e-7, 8.086826359684251e-7, 8.08699600205661e-7, 8.087165651546503e-7, 8.08733530815438e-7, 8.087504971880688e-7, 8.087674642725877e-7, 8.087844320690395e-7, 8.088014005774686e-7, 8.088183697979203e-7, 8.08835339730439e-7, 8.088523103750701e-7, 8.088692817318579e-7, 8.088862538008473e-7, 8.089032265820832e-7, 8.089202000756107e-7, 8.089371742814744e-7, 8.08954149199719e-7, 8.089711248303895e-7, 8.089881011735307e-7, 8.090050782291876e-7, 8.090220559974051e-7, 8.090390344782276e-7, 8.090560136717006e-7, 8.090729935778684e-7, 8.090899741967764e-7, 8.09106955528469e-7, 8.091239375729913e-7, 8.091409203303882e-7, 8.091579038007047e-7, 8.091748879839856e-7, 8.091918728802755e-7, 8.092088584896196e-7, 8.092258448120628e-7, 8.092428318476501e-7, 8.092598195964262e-7, 8.092768080584359e-7, 8.092937972337244e-7, 8.093107871223367e-7, 8.093277777243176e-7, 8.093447690397117e-7, 8.093617610685645e-7, 8.093787538109204e-7, 8.093957472668248e-7, 8.094127414363224e-7, 8.094297363194582e-7, 8.094467319162771e-7, 8.094637282268241e-7, 8.094807252511442e-7, 8.094977229892823e-7, 8.095147214412835e-7, 8.095317206071925e-7, 8.095487204870546e-7, 8.095657210809146e-7, 8.095827223888174e-7, 8.095997244108083e-7, 8.096167271469319e-7, 8.096337305972335e-7, 8.09650734761758e-7, 8.096677396405502e-7, 8.096847452336552e-7, 8.097017515411184e-7, 8.097187585629845e-7, 8.097357662992982e-7, 8.097527747501052e-7, 8.0976978391545e-7, 8.097867937953778e-7, 8.098038043899337e-7, 8.098208156991626e-7, 8.098378277231097e-7, 8.098548404618198e-7, 8.098718539153381e-7, 8.098888680837098e-7, 8.099058829669797e-7, 8.099228985651929e-7, 8.099399148783947e-7, 8.0995693190663e-7, 8.099739496499437e-7, 8.099909681083811e-7, 8.100079872819872e-7, 8.100250071708071e-7, 8.100420277748859e-7, 8.100590490942686e-7, 8.100760711290003e-7, 8.100930938791263e-7, 8.101101173446916e-7, 8.101271415257411e-7, 8.101441664223202e-7, 8.101611920344737e-7, 8.101782183622472e-7, 8.101952454056854e-7, 8.102122731648334e-7, 8.102293016397366e-7, 8.102463308304398e-7, 8.102633607369886e-7, 8.102803913594276e-7, 8.102974226978024e-7, 8.103144547521579e-7, 8.103314875225394e-7, 8.103485210089919e-7, 8.103655552115606e-7, 8.103825901302907e-7, 8.103996257652272e-7, 8.104166621164156e-7, 8.104336991839009e-7, 8.104507369677281e-7, 8.104677754679425e-7, 8.104848146845895e-7, 8.105018546177141e-7, 8.105188952673613e-7, 8.105359366335768e-7, 8.105529787164052e-7, 8.105700215158922e-7, 8.105870650320829e-7, 8.106041092650221e-7, 8.106211542147557e-7, 8.106381998813281e-7, 8.106552462647854e-7, 8.106722933651721e-7, 8.106893411825339e-7, 8.107063897169157e-7, 8.107234389683631e-7, 8.107404889369211e-7, 8.107575396226348e-7, 8.107745910255499e-7, 8.107916431457111e-7, 8.108086959831642e-7, 8.108257495379541e-7, 8.10842803810126e-7, 8.108598587997254e-7, 8.108769145067976e-7, 8.108939709313879e-7, 8.109110280735412e-7, 8.109280859333032e-7, 8.109451445107188e-7, 8.109622038058338e-7, 8.109792638186931e-7, 8.109963245493421e-7, 8.110133859978261e-7, 8.110304481641904e-7, 8.110475110484804e-7, 8.110645746507412e-7, 8.110816389710184e-7, 8.11098704009357e-7, 8.111157697658027e-7, 8.111328362404006e-7, 8.111499034331959e-7, 8.111669713442343e-7, 8.111840399735607e-7, 8.112011093212209e-7, 8.1121817938726e-7, 8.112352501717233e-7, 8.112523216746561e-7, 8.112693938961041e-7, 8.112864668361126e-7, 8.113035404947264e-7, 8.113206148719917e-7, 8.113376899679531e-7, 8.113547657826566e-7, 8.113718423161474e-7, 8.113889195684706e-7, 8.11405997539672e-7, 8.114230762297966e-7, 8.114401556388901e-7, 8.114572357669977e-7, 8.11474316614165e-7, 8.114913981804372e-7, 8.1150848046586e-7, 8.115255634704787e-7, 8.115426471943384e-7, 8.115597316374849e-7, 8.115768167999634e-7, 8.115939026818196e-7, 8.116109892830988e-7, 8.116280766038463e-7, 8.116451646441075e-7, 8.116622534039283e-7, 8.116793428833538e-7, 8.116964330824294e-7, 8.117135240012008e-7, 8.117306156397131e-7, 8.117477079980123e-7, 8.117648010761435e-7, 8.11781894874152e-7]
ys = [-342.9616708092102, -335.3745849286647, -345.4572749221692, -336.86635970696886, -345.9268092985153, -338.14800317885215, -358.55434776525357, -336.23926727934565, -340.59180548034993, -343.12458234265955, -351.0341382900673, -341.6835694576481, -339.4522681271844, -338.1324481600885, -341.5294264023907, -346.0183330559851, -335.9682378655858, -342.74908569809014, -336.8848314482484, -350.9520196760782, -343.2961356741073, -349.8667943661624, -342.7030658459354, -337.7322383588918, -343.97443974318, -339.95719143577594, -334.4994391186075, -358.2114816598766, -340.2384495429041, -343.65240618748896, -343.21006696078285, -338.5954402372411, -339.8625952272191, -352.16215161009364, -339.4165965869394, -343.85234980951054, -349.31904708484007, -341.396290942717, -346.40651310463846, -350.34189440072214, -339.5445961194263, -346.417487142057, -343.9722073604369, -339.2030301907818, -337.2527508881661, -351.04075598545427, -336.63901980223216, -343.28615876840666, -345.25427553969445, -349.11363018018045, -349.9636984685103, -339.1399231262209, -334.3767797001561, -336.53564650562134, -358.95587203990834, -335.3706595872356, -333.89747467658935, -337.6320776343807, -337.5397866697191, -334.2410460350641, -338.3917694406478, -342.8411891804036, -334.6593901062216, -334.14063820806746, -331.36288250059965, -336.96418691605146, -340.99941059278945, -336.02352263039984, -331.34399029256434, -339.1027278550681, -335.66284529786617, -333.4830471108139, -345.4421682618567, -337.0722201169764, -342.8450804849366, -334.4482084376557, -337.6218979134856, -339.84929173652677, -334.6254443936437, -334.7932908500297, -332.2663728641863, -339.83702934101586, -340.0053953211597, -334.4933319299346, -335.8885916765961, -344.02951023626326, -336.70940931499365, -347.03101748688874, -334.1382413249389, -353.92987406946736, -339.4523627671472, -334.5609226395447, -344.7494605461009, -348.2960935712747, -333.2792979252668, -336.8505377660611, -341.19748223417207, -343.0304005391244, -358.001329721902, -342.87244465952995, -335.5791996528754, -333.4285608492502, -342.0976741899734, -337.6172334991322, -337.5173099623925, -347.39801881893425, -343.1729715368193, -336.2242641627679, -333.3699307875846, -349.0657284188061, -342.34181185440127, -342.0707674721598, -340.9341506441393, -345.63318821445904, -326.9716692688177, -337.3354255743395, -335.84820320377685, -341.5308909113788, -342.0258641440872, -338.8650245191004, -336.9649495051365, -335.0227262147963, -334.1066641561218, -342.49147008194456, -334.38320670788517, -341.32126399520166, -337.6471869523513, -347.055879412814, -330.9516158230314, -334.80278211073716, -332.28076171719493, -333.22341194699476, -339.07076370160564, -334.1643050006869, -334.9232655906355, -340.7627208296723, -345.3626643306325, -343.8778420285643, -350.53583553048844, -334.7183285246281, -345.07907568070755, -336.9474642428545, -338.60218440448114, -334.74048026788915, -335.81274481793855, -336.06182038754264, -334.29854151270143, -334.9128361570578, -348.78077673092145, -338.5253283058129, -341.4167846164104, -342.65731567161, -338.4473649988148, -342.475450029427, -335.94361209451586, -337.76674553767873, -343.06255045273906, -340.86045437882376, -339.18967492976293, -341.4017974057413, -340.4990054041344, -339.5391661322082, -340.75914823167545, -336.4523061429676, -340.2595733579249, -342.26491188812787, -348.51911674731986, -345.45392405851476, -347.9262967015956, -345.845863773983, -340.720006263492, -339.40082936110036, -337.59597500653655, -339.6923260021349, -342.63488778637276, -344.5258049788669, -340.19361445600845, -352.2475550109272, -335.4471024114213, -342.6654097390832, -345.556736163386, -336.72421492035147, -345.76414742301256, -341.89831406065446, -343.4091479344779, -335.36965643586154, -353.7580933532904, -338.9136036448494, -338.30185978074735, -335.6340396499303, -336.1418594558515, -333.16207456259394, -336.50414699846795, -348.52421868612373, -351.49766827079793, -337.2069041392746, -347.65652264448903, -346.1406289085772, -337.2844562589738, -340.7320082120434, -341.56159778309024, -344.9033301440982, -342.1414157615118, -334.5952654436502, -338.3972263197865, -335.55152835252244, -335.9071515099882, -338.85760776183616, -341.87232095571846, -338.1894609049324, -334.07287726195966, -341.8673462800656, -337.7689461127478, -342.58934799044647, -356.41341044598386, -350.5860856924772, -336.0720643224041, -350.332335015199, -351.5014118763414, -336.32786489780005, -341.6837926656207, -348.28171819847046, -344.7698131028565, -358.69495294570675, -343.0856354670183, -357.19812705247875, -339.3124490746003, -354.2252637204589, -340.278028926803, -345.9335501798947, -344.8182798280542, -345.22767386493064, -342.6651725632285, -339.86758999207416, -334.64575887676017, -341.7282319873064, -342.7323049993182, -339.6235824374911, -335.3970663313048, -334.94509662525195, -335.1360518585597, -337.26920347540585, -339.1167465324222, -335.45574812721657, -337.00756009007426, -334.027647105417, -340.8062050865908, -336.566333355894, -332.0957987870263, -334.5310529787232, -337.3863841602589, -344.21237533056933, -335.7130651418955, -334.63575883710575, -335.7275763971384, -337.6073409613736, -337.22931292589686, -335.01769080565236, -335.6631606373076, -336.41495754015006, -333.5935975603944, -332.50016545772246, -338.7835349266943, -339.7724592614475, -333.33522538081, -336.0427413898935, -344.7245755943524, -336.6458324955033, -335.76218214271853, -337.3689779630844, -337.4182096123293, -335.08021789048706, -335.9915808371648, -342.25934187091946, -340.52126062902073, -342.87633854595356, -348.005038502416, -336.86083143030646, -344.27746870160496, -338.4635695115837, -344.5995826149316, -342.5636947613696, -342.91544862901833, -342.6271050606033, -338.9672299495539, -353.6669707847093, -339.5502877901448, -345.99451147038627, -338.408583591885, -340.750682411063, -338.6468084670843, -345.52331657802904, -338.4708803445892, -347.4908799213065, -347.3529005645733, -341.276323564888, -340.4678370361522, -339.69087997539225, -345.8759017416259, -341.05049578415515, -338.86418165596194, -342.2255937892023, -342.374738555136, -339.70274320556257, -346.06869935285386, -342.30453719250085, -341.0413056426672, -349.73599255262684, -328.315531375654, -340.9586488557639, -348.3778844251384, -350.69823342828533, -339.0412763865844, -342.40136517892176, -340.9451809003346, -331.43181769536, -342.22393704596067, -343.8457364245122, -338.6939726408182, -334.4824522865648, -341.3909996727719, -340.4972148100458, -338.40209730595603, -342.03814957447025, -335.6409374019987, -332.7494481272094, -333.0278102190996, -336.446750141945, -337.2786909392819, -337.7354050707598, -336.7138909627015, -344.316429170011, -333.83320883749707, -334.1444591686484, -334.34174734975363, -332.512224447328, -336.0966625244325, -334.74394133332044, -334.3681648470907, -336.4577768868517, -338.1252228366486, -334.8793844874366, -333.3435062251777, -341.3831826283607, -339.38132233663555, -335.54575829440137, -341.544627706877, -333.72760028917685, -333.50821665559073, -338.1448347471106, -333.7229953315251, -337.8690856279059, -336.77430088436375, -352.91410979406635, -333.852538676953, -337.59004718933807, -333.81881247057635, -336.30339443032597, -340.2284683558142, -332.4880517027406, -333.647701934461, -338.1604878465344, -340.28634769471245, -335.4612748386173, -347.90114150385506, -335.84719922157666, -338.94772436298183, -334.9009089379263, -332.4738012371024, -356.7828077931179, -334.09447680490325, -345.98099396306964, -337.23657867853035, -336.8615590983034, -334.0854691992264, -340.7626848541681, -337.16478034660264, -343.53509147268454, -343.0980323531619, -333.6055319036499, -339.12813357426523, -342.6557715523146, -352.67572223900515, -332.7180623402264, -338.54347588304364, -349.44228896975983, -338.6380364920533, -348.78026682368716, -334.8358823946212, -344.1468464987335, -334.4641148959695, -340.4351156160465, -354.561629305297, -354.25819864544064, -346.4590314643386, -352.4185976639877, -347.5691691079563, -338.0602349586164, -357.7345753124431, -351.3281009393022, -339.25179934939445, -340.1739107157074, -332.8695675522457, -337.2519506164668, -334.2927768951514, -357.2860029648976, -340.68908083041833, -353.4343137741488, -346.7368418734129, -348.94282761079586, -341.81502378265094, -338.38558088369444, -344.60521670537736, -342.52318776194556, -345.2586284923706, -348.82008286196844, -362.39637949266785, -342.20828833267797, -346.1922132274541, -364.2779298995933, -342.0047010408468, -344.28485423503867, -346.3236742182022, -343.40541022129264, -339.5232404428662, -342.6330880337503, -346.90151132153824, -355.43089870335564, -339.5617391278714, -346.1886694433386, -347.1835218547478, -353.604408961939, -341.9697536909207, -362.5206446623504, -341.8057177567298, -352.5698593966058, -345.13263911331603, -347.05403584888893, -345.5842261028673, -340.5462689837127, -336.3274538768759, -342.32620659616055, -338.89010920240315, -341.70408651809964, -336.5429947842623, -334.778302690103, -347.9637901032481, -346.0397003766436, -338.25925987169785, -353.661407727109, -345.1983426438063, -338.4806689188413, -334.3065983088886, -339.7438860046326, -345.5418019478389, -340.19729668341085, -338.2063046639149, -338.37566991308967, -342.6220934063426, -339.53845817433745, -335.3485750005191, -348.06664424142616, -343.092667813703, -339.5124529686998, -341.7939590745871, -339.20065281314754, -343.00696638582315, -339.2838551063499, -353.2323238485682, -338.4525765022165, -337.00891059004414, -334.94857682369036, -335.60715288075534, -355.6116443569366, -341.31753197494413, -341.75206336611757, -343.74480381010807, -339.55655177700805, -353.5125893175845, -347.05109185663963, -338.4052703527564, -344.2052341649861, -338.95481203896145, -350.7439532791542, -341.8543650992718, -335.1308905055873, -339.8729141252886, -342.9000892938399, -347.8578912217756, -345.6540769846523, -359.43437312937056, -351.1547975291637, -344.4103949799354, -348.64848311530244, -337.2315894932475, -344.5717419746146, -345.48330746503956, -344.19278744454186, -349.36962659242033, -351.85591837452677, -337.3040432224491, -338.8934638015416, -343.1627780654162, -341.43196186816346, -352.58057838517624, -344.8126471081663, -339.4994832199922, -340.44898014618815, -335.0377964655306, -336.6285591318632, -336.6384847350764, -338.59072589933044, -348.1496456032625, -340.4835302315373, -353.6358191203231, -338.3918481990289, -339.0761494525568, -341.0177111929375, -336.42217208037164, -344.5350023613074, -337.37269674835056, -336.49805180340104, -337.9657606466139, -345.0734327847583, -341.6023942561458, -333.73463216117534, -344.3092732113331, -344.29585723069545, -336.3177995579054, -348.40282686729347, -332.38426738624577, -339.25085744286156, -350.944455691176, -335.40657731339456, -356.81085998720687, -338.8599646176183, -343.48677437620836, -337.18465067299485, -334.6081930240424, -350.2866958188707, -343.08668965476846, -341.76800575775707, -347.36242816018785, -338.092245559865, -335.13492039923307, -344.42019252417145, -354.476171116809, -349.12170482088754, -346.70693762793684, -353.66589201609975, -345.0457482060366, -339.82046693484926, -336.74953842950566, -337.24418899232717, -338.8880093997321, -342.767757916911, -335.20319813049076, -337.69828964328065, -353.81425868546324, -342.6287179690852, -340.60723006276396, -339.54032402530106, -348.09804894334036, -335.78937735985954, -336.2344114840628, -330.1052974307054, -335.77788621763045, -338.88239181185094, -330.4266058350039, -337.1002740756712, -353.4024331860139, -335.28803271764207, -336.3388465649595, -333.24145469579616, -341.43590137554105, -339.6091523494273, -332.91793768241286, -327.75933034841046, -333.22757247731744, -330.6368074055347, -337.8407194975525, -335.0921168982333, -346.9137419606693, -329.5987159937809, -335.0281626017954, -339.35532461120147, -336.4281893510858, -336.47256980437584, -332.03215390907616, -329.0781447094771, -327.0734222069093, -334.23921405985567, -331.5487285524856, -344.37317118366394, -339.92132963217, -338.5838458036226, -327.5961845469287, -326.82503383078904, -331.6418877831364, -338.2426738985567, -331.11931445621616, -328.93506264892426, -329.1584048071885, -329.3189969861212, -329.8494989497894, -353.39973249850993, -338.66791305658194, -335.252250125469, -343.0323594552237, -324.2144738358089, -331.8706177642016, -333.3098164174829, -339.0003438253543, -342.69827105330825, -339.2115001981898, -338.89321165149136, -331.293476358773, -332.62198729252736, -327.9286828235684, -329.4725284166398, -340.3966355616709, -318.0202596002088, -334.37518381899633, -318.4043135972819, -328.79995302355206, -326.32845075129575, -330.61576694931483, -Inf, -328.60825850242094, -322.967387506043, -326.15882423368134, -322.11124586694444, -327.2876939691539, -322.4776606044877, -333.5057792026105, -334.9282201241847, -328.0966928068468, -329.9390017051271, -334.8134521463577, -324.125060834976, -328.59905075100863, -332.7502341643122, -330.850217890133, -336.85031000342127, -327.02613230028294, -331.4021798713537, -344.8835100912769, -325.75004201855876, -331.60566738619764, -332.4161447037021, -327.78547578967857, -326.49562883930963, -326.8194530575224, -325.7877465740336, -320.01653060040394, -334.4725008753872, -330.5409572859293, -331.8001929037694, -332.6536569412238, -342.8325326936925, -329.34725275561163, -331.3461304197321, -332.2733440255814, -334.8089456619864, -337.2052919882745, -326.35397555777854, -334.6275884861053, -339.5755200874208, -332.2478327703441, -345.74441164368636, -338.0560714532276, -334.47553232738426, -335.64695774930493, -331.6057636756372, -332.79211111580094, -336.52505646522064, -335.03345702830984, -341.9383789802523, -335.91816174144986, -339.83915513907283, -335.04312239212584, -355.707644412097, -341.34713759771705, -336.52124182589745, -337.77725540387314, -342.7134980605309, -342.9762865296212, -337.2971488249866, -335.04389462081355, -338.8592814490885, -349.5164320621765, -343.36394265678274, -334.38802515414466, -335.2316968230688, -343.208227336518, -344.9836714669882, -342.93569451641184, -344.53246576312955, -347.7612268273157, -340.8827876880375]

The number of samples is 700:

julia> length(xs), length(ys)
(700, 700)

Then, I get the following result:

julia> s = Spline1D(xs, ys);

julia> s(xs)
700-element Vector{Float64}:
 NaN
 NaN
 NaN
   ⋮
 NaN
 NaN
 NaN

Note that I am evaluating the interpolator at the sample points, so the interpolation values should be sample values, not NaNs.

I'm curious why this is happening, and if there is a workaround. Strangely, if I reduce the length of the samples, e.g., to 600, the problem disappears:

julia> s = Spline1D(xs[1:600], ys[1:600]);

julia> s(xs[1:600])  ys[1:600]
true
@wsshin
Copy link
Author

wsshin commented Mar 2, 2023

I just realized that ys contains one -Inf at the index of 628. Replacing the element with a finite value resolved the issue.

Maybe Dierckx does not work if the sample values contain ±Inf. Is this a known issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant