xxxxxxxxxx
107
let file = 'NVDA_data.csv';
let column_num = 4; //starts at zero, so 3rd column = 2
let truncation_value = 0.5;
let download_images = false;
let height = 1024;
let width = 1024;
let start_vector = [0.1321460263303403,-0.017658108045331522,-0.017009001976869453,0.09694461755682256,0.07883845283356423,0.001142680848173927,0.009564564544465661,-0.017096572507426397,-0.00995297534101465,0.11024770752233481,-0.04822396079400155,0.08410709805496011,-0.042740235158478725,-0.05467609206292965,-0.0542955084710398,-0.06914951467655893,0.005621568931098796,0.0998405548648956,0.0167810526322867,0.001620556699093386,0.020533307925018212,-0.060524104555574304,-0.019634843426189097,-0.09799968041348153,-0.10599032053343632,-0.10748248132780291,0.12389557057201173,-0.12456946949299594,0.08745654522988651,-0.20433648912677166,-0.02484375542180768,0.03892085762427472,-0.012274755432136686,-0.020800100202646898,0.009087727136829893,0.16981952384183316,0.006469123910696234,-0.006035264284048915,0.10933246554046848,-0.029777627602015286,-0.0573459981725349,0.05175483262155303,-0.016792895046488843,0.09089344424731964,-0.1253902250118213,0.06690130595799387,-0.02608434802532985,0.07051404439029477,-0.017050834572082847,0.06172028617047573,0.0917978707395693,-0.08890673629979798,0.07351556294438441,-0.15062265960816712,-0.10941339216076015,0.15007115119319187,0.013539376780007953,-0.0017772366207779253,-0.010462988411940856,-0.008768193208769653,-0.002932430678519735,0.0131194499380242,0.02709357272432804,0.0503147380289756,-0.03835211656435743,-0.06400789029592201,-0.04180341771999227,0.10791477167480251,-0.11676610245596745,-0.020503914028491728,-0.05797738223602018,-0.031222808927923056,-0.0290481044890038,-0.07040130604516529,-0.0326806962615911,-0.03968711465679445,-0.10082288577018697,-0.1394530665440186,0.0564542748891605,0.09234862096020596,0.16185046041924186,-0.010984096683154978,0.025062818364582087,-0.07682779127861422,0.02286469667537864,-0.06353020035536372,-0.008250074298171888,0.04896658926594687,0.05083786016305235,0.06097650978101597,0.027259622273587334,0.03440728416876087,-0.059239440994470205,0.12681445246049905,0.016556808080754038,0.01478005997218117,-0.05516184532940101,0.00652909803308983,0.12607078956353882,-0.008354363582956485,0.008000662642322125,0.05740263440588973,0.006320731725038537,-0.17071661354094197,0.10243486822177174,-0.12499137416103484,0.1808054872884099,-0.0006948065729600779,-0.03568790105589375,0.030714143063366502,0.021116172251404716,-0.03246541642444826,-0.046339996436283504,-0.0447640824671707,-0.07190061526837431,0.0909298162537466,0.031558594422432196,-0.013385947036795083,-0.10278438246465757,0.044015942833301264,-0.0079482895757944,-0.08482549915874366,0.05156056916785532,0.09328675063339856,-0.02422837627968986,0.060898376105118654,0.004528015837912007,-0.16683499613797115,-0.0686875380975933,-0.002345181080371614,-0.055055011817161735,-0.11366779207305668,-0.091520488649868,-0.010531710578934698,0.06895541838972498,0.12322723233285479,0.14007537962829744,0.07741145369598357,-0.06426375534801912,0.05837046039745465,0.11927023603368936,0.05742023459027651,-0.12424806166247862,0.011746292375414864,-0.14338611710272053,0.14835920412303136,0.09731600335277067,-0.08433288211401331,0.016431969349277445,0.12782238994271808,-0.016029685170114084,-0.059104969582568945,0.06114973185905122,-0.13899181209741954,-0.01666510764077027,-0.02476360813749576,0.1951769739928652,-0.017820139596294055,0.04411000180828964,-0.014502583877882051,0.06447782977959265,0.08010061464386582,0.0645848733343316,0.06363587035015517,-0.028501887339346676,0.02006003426095271,-0.15125849756181942,0.0656077791598017,0.10617353761696559,0.21326011621609053,0.031239875748799106,0.005975235750546729,-0.03169691545018729,-0.0020384105449226114,0.17160692839906244,-0.05287388741738139,0.02844670245780684,0.1177596412032093,0.043166763185731635,0.03361252709910132,-0.006928581649746295,0.20595687317045075,-0.011171220011375809,-0.0009015541029425908,0.02774373539662621,0.017726661761329726,0.12159719582593498,-0.10907645313597031,0.054145391342194246,-0.09560541713243105,-0.09632005600385182,-0.046107204248790334,0.08217511830908047,-0.027236143169418338,0.0057847771888899155,0.12518307067016365,-0.013766634798506216,0.1240332711892673,-0.05195683712929211,0.20320216145366668,0.07332376434683609,0.08209753394408334,-0.08359892974100062,-0.04664588764802863,-0.1191322952123495,0.021914505044194996,-0.04204659437663635,-0.08557745606332699,0.09844456572277786,-0.08270856777760821,0.04661016152496312,0.00007917569212563882,-0.005997446517673505,0.10583341520088826,0.12321029033646184,-0.18237087483211142,-0.0034614506472894976,-0.016184779346748644,0.018254801365062093,-0.10655901144304862,0.11748175207982617,-0.017328388907489105,-0.06346277068638581,0.14197059774582355,-0.044673023945496944,0.11324843299955012,-0.01327774150903294,0.12831874511264318,0.031142584009928434,-0.031086195919535473,0.03407163184152462,-0.019373201982158722,-0.0645009890535985,0.05278100379573058,0.04819237870562673,-0.05402254564310509,0.013779119005905506,-0.056919607164086276,0.024033971669786044,-0.05143866130020408,0.04381843198771862,-0.10077212898151737,0.10005387053883782,-0.04268201892762215,-0.021177133051131,0.050359988737388776,-0.004060444524294368,0.13511355379414527,-0.1513754586198275,-0.09054419137147446,0.013578189936883353,-0.14002048364922895,0.07071309884740437,0.1369518297404612,0.0055595422680753785,0.10301169655246804,0.0653777593315102,-0.024631198194310693,-0.11711968874739674,-0.05305578907305521,-0.001133683345207321,-0.09554215514692742,0.06913096016216144,-0.15013049182717844,0.16807932388917887,0.038198850467515685,0.008896666892432376,-0.03213309297533688,0.04643158147655563,-0.08766922198340302,0.1254239998910694,0.04830881348327869,-0.05985086324171357,0.022844454532027623,0.08611160817783484,0.013438055316375628,0.06603316868610196,-0.05961234871190052,0.08910898267190759,-0.09393443404815426,0.04898783619754799,-0.040617730164445746,-0.14447711723983356,-0.02662530052340106,-0.08466265806824237,-0.01381391736794825,0.04203984785211549,-0.02794824140546754,-0.08626017081112161,-0.11253652760114691,-0.20495920517921748,-0.023902059183802365,0.0115918676855888,0.04217578368469874,-0.04148597093209386,0.056030085153003784,-0.1374319094162279,0.012567001904272401,0.018303567899521485,0.14016550554242094,0.11715668297575021,0.13976104729174996,0.04080344580620423,0.04572352750549837,-0.06133948928689923,-0.0006202656738931826,-0.04248713759466734,0.06462422075767024,0.012794531729928511,-0.08394956109323544,0.12931501836557635,-0.09189097233950094,0.05620877774545524,0.1976721896944969,0.12292780646690224,0.046040532345050865,-0.01488758259382467,0.06166392346672212,-0.010291908580779538,0.028073877655586096,-0.12354518093959702,0.1411491047373491,0.13090072062973984,-0.021376583838250814,-0.05346394957056218,0.08991115771130241,-0.03578326886478153,0.005545137114638152,0.08226028697551535,0.16035717103882152,-0.02203974131873167,-0.05057858971672443,0.012278871328652088,0.0008737661594830299,0.1265012968398666,0.045623292885922234,0.012386385065651137,0.009487505949338868,0.01972524755653253,0.14833708335795778,0.0836906592039373,-0.06703005705779232,0.06903770137085061,-0.048370400564625035,-0.12243985756694115,0.09892354217196483,-0.0679580023997711,-0.12281096314716913,0.07728507394492914,0.12514479216976432,-0.03503700376575096,0.12933597129793165,-0.04011356966388535,-0.10023111493323926,-0.0072641728876837695,0.090001461804531,0.08839661308029291,0.08134003447696216,0.012063441628599292,0.07493456746633162,0.04653585497022582,0.0000368702955324679,0.03101062224641762,-0.03575085409585033,0.06124966177908689,-0.06980532584329147,0.0522376155760878,0.14545806071141512,-0.044929793559644604,0.013972475667749208,0.17787578449462998,0.0384600442365987,-0.07831644615944514,0.11465138036793243,-0.026325125972765238,0.0576464862633067,0.13033760002965414,0.13800976079458704,0.026828034461038434,0.01936817637200018,0.1181722038328255,0.009614718277804642,0.058920432659798516,0.00833829962287696,-0.08251019346493071,-0.04128239456140652,-0.010578523788332284,-0.0949742000979356,-0.01587063702073211,0.005291069400827311,0.043964800715072055,-0.0637093223915138,0.1009802817955918,0.01716051552082018,-0.17096343251455734,0.024370768025069288,0.023831976881358283,0.0644096689340045,-0.04621970882088841,0.06513686587098245,0.01788125599067758,-0.05782175219812625,-0.0528160864265956,0.10138798718349032,0.029767622202311564,-0.04429642322481468,-0.04212478947522994,-0.04236444270991327,-0.03626918880145997,-0.12173869094896798,0.017971524035817584,0.005597476800392735,-0.004912203449260709,0.11273129587849517,-0.08851226775599799,-0.06471195873822026,0.023048407191052476,0.018864000129256063,0.003279239793136629,-0.17130365253568205,-0.10171282090993598,0.005493193260503701,-0.03189489954163922,-0.05476957748770588,-0.04008439611748397,0.1928913557416554,0.11560156314886469,0.017138110562135746,0.02541409450788981,0.0540893587891107,-0.12638257721607316,0.0745268675924901,-0.08911252839963452,0.025150239172805802,0.007983125444288603,-0.014427466998582238,0.12463765934528297,0.01827908788328268,0.1004669525804005,-0.030529535481055012,-0.04865372220888409,-0.05760825218373444,-0.059941268126545925,-0.11274106540500274,-0.062456912302571055,-0.11678623888456549,0.1263157152983577,-0.08101987955074123,0.024821588134537748,0.10748195658468934,0.028014878855028562,-0.11109097651787922,0.08020936870267424,-0.04666418654972915,0.02313980387266652,-0.008175407530502655,-0.06980833102215724,-0.15310342857535109,0.06929705197395591,0.08291443739650865,-0.09755018965692991,0.03649117701691336,-0.02802815421943737,-0.008082693616497105,-0.05107991531445577,0.02977705245810171,0.0294447181828413,-0.12470873203198182,-0.011555579372131995,0.10082070108803551,-0.028303990843974405,-0.005128831530450715,-0.11361366974030439,0.104183847233903,-0.020253222634287433,0.028233612749748047,-0.017211365941708714,0.05595449156588419,0.25258971960762844,-0.0345115595381289,0.10787428232446972,0.1660193951301353,0.06208276594119342,-0.024082004663138395,-0.06202135793291755,-0.058240805906460184,0.1462913275844729,0.02636975930255868,-0.026266916285469514,-0.04549759393203269,-0.04691467295463976,-0.042209188853010296,-0.09007750601020155,0.07184142411176779,-0.0401505281629015,-0.011223291445287262,0.12173542745288521,0.08480595994754801,0.02700241798360102,-0.11999870349603306,0.060122180596594986,0.12192399983128592,0.07427893518739191,-0.10089412494955959,-0.013956263307946207,-0.06653944203450064,0.0571400634019213,-0.15787983024232286,-0.05508381504024968,-0.015851820643648033,-0.11551511705617035,0.1294704866063841];
let end_vector = [0.11436094682735992,-0.07066462806572853,0.11162053234667894,-0.02877932967793894,0.17303570710183253,0.07472714715306031,-0.03706493787938368,-0.03163210533214543,0.04415975509955992,0.060352473618660016,0.014800931272211063,0.013201922418414766,-0.16829100498183763,0.007280826729022208,0.08167843364367285,-0.17058980422490524,-0.08239995645330417,0.095908437598931,-0.11723123110842848,0.09386924714057389,0.011196388734908358,-0.016542465114930675,0.14706213893553088,-0.10817231476693345,0.10463358688818641,0.12920193577498282,0.12831569664082657,-0.0030668958982774143,-0.061942161600478135,0.04447193690357018,-0.04103947780901388,-0.1118525831161151,-0.036054058896565086,0.05432995385173572,0.01999310184032828,0.047163424904728385,-0.030018850362252786,0.05532914506051452,0.07501656678568089,0.056806527329878294,0.17594928670296817,0.12669766180849334,-0.14696833940805187,0.1402990315786739,-0.044553218301859016,0.10300139377464015,0.043318934970701085,-0.11088467568384697,-0.1121585049132726,-0.08363784351103665,-0.1725824736239297,-0.15500637743715012,-0.01981827347469974,-0.02543120366733432,-0.1416176819294156,0.11680808324761513,0.050487018519017275,0.18532550307732173,0.0892005555030283,-0.025597367320214958,0.11475234403066595,-0.03560067240069236,0.030194995281362085,0.0005212188874725923,0.0587213722167943,-0.01940348866409175,-0.0019187433505376966,0.024373141573357224,0.09111379381256361,0.03958319458112283,0.11014180862540415,-0.08256423739101947,0.07675455506581885,0.02744309602383173,-0.023655951562965724,-0.013670530192675633,0.10648843298435756,-0.008883758185403053,-0.12175902889256356,0.07941364252832603,-0.15002848933719443,0.052252197235766906,-0.027715393675458028,-0.038246368407726376,0.10104998745491584,0.034500649063683525,-0.045127296135708025,0.09043961910526879,-0.05558008014099529,-0.06494504500335649,-0.10637116025856029,-0.054387662873787365,0.01819212559064083,0.11600957526205506,0.15147293794931455,-0.12964314874815214,-0.12518089738593655,-0.05516746828939831,-0.0029719216792100734,-0.009035516800979748,-0.1924561940176608,-0.12134491022765626,-0.03157555853703073,0.029199317037682762,0.03328870023148049,-0.013393904260550208,0.15666552839520026,-0.051010793120467204,-0.09538568510971407,-0.13908480203521897,-0.09517826493595224,-0.18577345090847722,0.0479057489634364,-0.06644300299891973,0.08509501230723344,-0.15133978212554544,-0.02835337322520865,-0.01166594151114303,0.18562188613950364,0.014099373753934056,0.06147548515273547,-0.018926161146293148,-0.03981577625108086,-0.04709366111068515,-0.061368967334223014,-0.01956388661527286,0.0410155054371671,0.03511178057371001,-0.19806392749724827,0.13343949531346297,0.03253490320638966,0.031343479679291505,-0.1483933840648915,0.07730987748981193,0.02654748789415516,0.0915630580148106,-0.010599797064172148,0.07687882896569473,-0.1226687859233463,0.005390698851597202,-0.020698083487662236,-0.12026760532044294,-0.018605435352778033,0.04315803199936754,0.002914273605282125,0.03777369359838471,-0.10436690996339354,0.0417190459615747,0.040188742765739256,-0.01003232694266365,-0.03301797577183654,0.017450875619327462,-0.10976621255238557,0.11243404276324996,0.10981071845757245,-0.0033505809224781066,-0.029064158212748832,0.06449355951090689,-0.03806983732008672,-0.05542987507480229,0.15465744664474723,-0.04881048965203437,-0.01741502902434606,-0.055993703876750955,0.00010698025994133279,-0.030050683850221988,0.003564358440486963,-0.056261980776499174,-0.012041044658489868,-0.15849978119720112,-0.17487450794640266,0.05852443481465344,-0.04524419854827836,-0.07416051767725312,-0.024551340407466572,-0.07387613019351172,0.08334107030592916,-0.04127436298567935,0.09302557621103455,-0.026512868250658222,0.022418355312549106,0.06899780514927055,-0.11379516919910024,-0.22731791405118318,-0.06638213932197111,-0.12319427421372656,0.06583395580176624,0.06351195891605191,-0.016492534388663438,0.10681445718536872,0.0249772025801457,-0.023557594927683233,-0.07958098585738681,0.009108560466353319,-0.061839205331309884,0.0708895945770099,-0.06909505436044797,-0.04657930285109528,-0.015394057843052443,-0.0774416139439898,0.08690683034367896,0.035906051384332595,0.0714161000547944,0.014818440239970948,-0.05390206478265998,0.0357812747852622,-0.08127600323457679,0.05141949035992411,-0.019482475903497855,-0.03359676237571868,-0.19753897001312426,-0.038009018056062806,-0.03853421344172801,-0.07428725338904096,-0.004043617698755372,-0.12339268969396687,0.0009761087476149732,-0.036037145244988474,-0.008783114670484565,-0.03581727758797097,0.004716310509138827,0.13043936267814876,0.09347934459900116,0.20399911882374952,-0.0063346483930686,-0.07620015581851979,0.04713696986597639,-0.06024538632498832,-0.17309578504898054,-0.03087782033673884,-0.053105529976884794,-0.10903905696537297,-0.08069416073783593,0.04558168162136461,0.05681841482777393,-0.05414424869695807,0.19240014499312674,-0.09136403030142448,0.13584363426004042,0.07131560080242455,-0.0727345141601873,0.007152014860285119,-0.1272604280839657,0.012180454089640202,-0.04228532618680671,0.0628397522154644,0.11000427031375376,0.06538603827416334,0.05853760675371282,0.0013536592089579457,0.008007091255175222,0.14953178714992954,0.01270583550784659,-0.02887151725030221,-0.11113535032994203,0.011784897758123428,-0.06517679926718618,0.15461176181887987,-0.061926633315197537,-0.0995995534598585,0.019129993364077745,-0.014707208727293657,-0.013573511275849607,-0.02743165837775343,-0.09867373393976026,0.019503842893273338,-0.14884382649411718,-0.10531618304964872,-0.008390920333068519,-0.03972062834000656,-0.08118799445722878,-0.05341641213267332,-0.13628453487786946,0.05824097351319395,0.02573004075013077,0.09871984804798145,-0.024996009505527245,-0.057846839810811734,-0.06209042519859912,-0.10032008003503612,0.08846845674586902,0.018881029563799247,-0.04326643859816445,0.08806233906561722,0.057761409738061084,-0.13139467373698405,0.058597900650927494,-0.13483936907643002,-0.09058233118176832,-0.07586699771267227,-0.16131619667691793,0.09346795906244237,0.09096527699912102,0.12050377797639386,-0.05446424929047297,-0.04922278196219601,-0.04354960108895025,-0.11179413877619698,-0.10650679160568087,-0.06000104768120215,-0.11466011514547288,0.017015116822725773,-0.06048665289980902,0.12681076357380544,0.18029915999371812,-0.1575898425775146,0.041609054070801385,0.01727626946274112,0.13640113596528786,-0.08121431992056807,-0.03699331432517951,-0.1333293282713009,-0.0646688767051368,-0.07678005760546325,-0.03996323377779703,0.051255716706494835,-0.011845756284808193,0.02295295149327767,0.0705248520552289,0.03161945437504988,-0.015829061235823894,-0.05055519843579245,-0.016601432258469884,-0.19946872481535985,0.007573379629118748,0.04990736455387201,0.024742587272936493,-0.10877455000608251,0.014290178735886984,0.07182940315072742,0.017103759381063698,-0.006760726901138395,0.01309382471661176,-0.18575142302298542,0.009141690744201465,0.12623111528185374,-0.08627269514728918,-0.0008564970614152734,-0.10935143958891116,-0.15453704041459462,-0.020531495647360367,-0.004501422702007096,0.04646158791668864,-0.016685468531939154,0.159382230251981,0.04634137405683451,-0.07809599262570564,0.10391252930582048,0.1757929918767377,-0.02182690917771371,-0.018165300680170807,-0.04027544753919116,-0.08477677407490389,0.06783117162052106,0.04162344071487796,0.088676794960353,0.12567087138633315,0.1372394987692522,-0.0491818798427302,-0.11024726990585532,-0.0692009657208911,-0.002234520113838543,-0.0025420257101416745,0.03546402096098397,-0.06514634996415583,0.11086416081632758,0.012175873078452745,-0.02932739955236406,0.06673234167216216,-0.06070788628071338,-0.02859562899074321,-0.1553571120222071,0.13913244216119008,-0.07929395881139997,-0.036375175212052774,-0.010577384800586056,0.04238008443099145,0.019570365112785256,0.10294616775405992,0.13041086935427101,-0.0032463765274056908,-0.034346448645165034,0.1287879761762788,0.06630958385794652,0.09262472332765033,-0.044867335633547174,0.035940992596225185,-0.03398694624029906,0.10992208748913643,-0.042156563575076855,0.028240146753506366,-0.11977709941882787,0.15242039395372906,-0.09165464894121439,-0.04817123924755964,-0.10119285286298407,0.019402546504713063,-0.12498449553572233,-0.10328473978729971,-0.119239501726433,-0.0024000611961577933,-0.06198992645402591,-0.10656182313872994,-0.11844669515539813,-0.1120041019898989,-0.006295496701212273,0.061179153859600086,-0.05210556049714796,-0.08235619938470762,0.16299077661953287,0.09257831196673501,0.007895509320220807,0.0007886765569753568,-0.033673052657635275,0.0850762714229995,-0.09596744057669455,0.12063484676998112,0.10115210599785229,-0.09695874856986747,0.13640414789114114,-0.020784011493512798,-0.05729547274768333,-0.0069051687561521346,-0.1711867754243256,0.02314022894772565,-0.05639581485162442,-0.05158830258249951,-0.07811608291998744,-0.013189700220559368,0.030191824480932467,0.03347155131416983,-0.042988166832417636,0.003117181549878688,-0.07178729937779005,0.11572500954257191,0.17859693462533105,0.06346723852211861,0.07062059544358044,0.023698697658867937,-0.03285538936342594,0.03552943175616058,0.057228416563246655,-0.08276046292421105,0.02383816095012859,0.04593474150310156,-0.0008215564544236213,-0.062469814350372715,-0.022049605156840013,-0.013452133672271056,0.09207021326224421,-0.012803283070264543,0.009113927250993383,0.0904029806535564,-0.09387436240259871,0.01925481082561569,-0.033277333869691256,0.06355660623212496,-0.04210908759777581,0.09168012789196323,0.0312565393509756,0.18799084667976346,-0.021678995609628774,-0.06130138444041846,-0.04188613734670871,0.19050363443198315,-0.13693657193578057,-0.0032132740249118242,-0.05100331784663402,0.03078378784129252,0.015616271757173637,-0.20253365575502139,-0.014945060364632452,0.14877372833694497,0.03973928728726045,0.0067277247284906845,0.0076072408511660035,-0.062230473462254104,-0.07936316113501096,0.05343376797644468,-0.11090961977862253,0.132818023601628,-0.053822826342748945,0.08315219805190435,-0.009978310448603273,-0.05018923662332657,0.07860516561627584,-0.037843436897802674,0.027756752464816528,-0.05464063680685345,-0.048634474642512714,0.01058459381930258,0.04125682251389625,-0.03644224194498702,-0.09796004473510875,-0.10345281424038501,0.08774064751747222,-0.08358110589890477,0.14583153266246546,0.07983327271736114,-0.012671035175699254,-0.11056429260330344,-0.021122127853476468,0.1167187594822459,0.029058067958153563,-0.04099725382808636,0.027487171413487572,0.06671215108314987,-0.1493052159629365,-0.016510576202290753,-0.09882627908015187,0.008963868643736814,0.08193666660790887];
/*----------------------------*/
/* No need to edit below here */
let table;
let stock_data;
let data_min, data_max;
let vectors_out = [];
let total_frame_count;
function preload() {
table = loadTable(file, 'csv', 'header');
}
function setup() {
pixelDensity(1);
createCanvas(width, height);
// debug_csv() //uncomment this if you want to look at the data
stock_data = get_csv_column_data(column_num);
total_frame_count = stock_data.length;
data_min = Math.min(stock_data);
data_max = Math.max(stock_data);
//convert vectors to numjs format
v1 = nj.array(start_vector);
v2 = nj.array(end_vector);
for(let d = 0; d < stock_data.length-1; d++) {
let lerp_val = map(stock_data[d], data_min, data_max, 0.0, 1.0);
// print(lerp_val);
vectors_out.push(njlerp(v1,v2,lerp_val).tolist())
}
generateInterpolation();
}
function get_csv_column_data(column_counter){
//cycle through the table, get closing price
data = [];
for (let r = 0; r < table.getRowCount(); r++) {
data.push(table.getString(r, column_counter));
}
return data
}
function debug_csv(){
//count the columns
print(table.getRowCount() + ' total rows in table');
print(table.getColumnCount() + ' total columns in table');
//cycle through the table
for (let r = 0; r < table.getRowCount(); r++) {
for (let c = 0; c < table.getColumnCount(); c++) {
print(table.getString(r, c));
}
}
}
function generateInterpolation() {
a = vectors_out[count]
const path = "http://localhost:8000/query";
const data = {
z: a,
truncation: truncation_value
};
httpPost(path, 'json', data, gotImage, gotError);
}
function gotError(error) {
console.error(error);
}
function gotImage(result) {
i = createImg(result.image, "", 'anonymous', imageReady);
i.hide();
}
let count = 0;
function imageReady() {
image(i, 0, 0);
if (download_images) save(`step${nf(count, 4)}`);
count++;
if (count <= total_frame_count) {
print('generating image ' + (count) +'/'+ total_frame_count)
setTimeout(generateInterpolation, 100);
}
}
function njlerp(v0, v1, t) {
return v0.multiply(1-t).add(v1.multiply(t));
}