diff --git a/src/__tests__/__snapshots__/spectra.test.js.snap b/src/__tests__/__snapshots__/spectra.test.js.snap new file mode 100644 index 0000000..f51c1f5 --- /dev/null +++ b/src/__tests__/__snapshots__/spectra.test.js.snap @@ -0,0 +1,3022 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Load set of data 1`] = ` +Object { + "ids": Array [ + "MS5093A", + "MS5095A", + ], + "matrix": Array [ + Array [ + -0.7848870185221859, + -0.7868401207951673, + -0.7862175816674386, + -0.7879266337974759, + -0.7882085453728678, + -0.7876317144982394, + -0.7897432156213902, + -0.7905723600010536, + -0.7905869793944205, + -0.7898207831628216, + -0.7895243707938459, + -0.7913303100106223, + -0.7898853275695965, + -0.7886818822660532, + -0.7873732717036258, + -0.787525394360398, + -0.7846649405451127, + -0.7830922387400273, + -0.7829099394663254, + -0.7812016828800086, + -0.7805034974979314, + -0.7778108450961458, + -0.7754585667553462, + -0.7768816913812997, + -0.7756928626184763, + -0.7749140350767344, + -0.773509342281057, + -0.771705394987271, + -0.7719396950028751, + -0.7713506956506451, + -0.771608487556759, + -0.7720104192485352, + -0.7718835981459542, + -0.7724586429029933, + -0.7742795675910958, + -0.7749918491565418, + -0.7765226182112877, + -0.7798106683101731, + -0.7780218213825361, + -0.7789299890630372, + -0.7806133497635601, + -0.7841531908468092, + -0.7855965190925677, + -0.7863128312858353, + -0.786586472279229, + -0.7876237533201557, + -0.7925552372449379, + -0.794425105438592, + -0.7932149803943483, + -0.797817196625557, + -0.7962437657398566, + -0.7979523039329349, + -0.7975065287991929, + -0.7960344744419994, + -0.7973317904281851, + -0.8005880145785772, + -0.8003565055893415, + -0.7968729065984463, + -0.7958413515924321, + -0.7956874484049601, + -0.7977304047318111, + -0.7924934816788293, + -0.7978886356663527, + -0.7976819741503235, + -0.796196038417853, + -0.7842893490241527, + -0.7888949916558263, + -0.7869122370928565, + -0.7957801965631693, + -0.7757888111909498, + -0.7900695681665862, + -0.7811543895782426, + -0.7756074050825172, + -0.7784046477848447, + -0.7926398305986216, + -0.7758051489963346, + -0.7802634661311355, + -0.7687666958943489, + -0.7721624060274079, + -0.7691639006556539, + -0.7588397144371185, + -0.771998135102875, + -0.7764198872235101, + -0.7758722054225422, + -0.7746760411571326, + -0.765121357574332, + -0.7983724269500927, + -0.7921282157479961, + -0.7813097352861921, + -0.803806390155608, + -0.7801278758199358, + -0.751653706357488, + -0.8024413484173912, + -0.792749725826525, + -0.25635044875793306, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + Array [ + -0.8500366491825189, + -0.848911967226283, + -0.8476860740419556, + -0.8463923764462873, + -0.8453840011704968, + -0.8433588579071036, + -0.8425883665474958, + -0.8417168417149359, + -0.8398567920684952, + -0.8391549557240703, + -0.838013391890419, + -0.8374429173476983, + -0.8375561517048776, + -0.8365795399330437, + -0.8366541540548715, + -0.8365664109482817, + -0.8363201183093205, + -0.8367402580077866, + -0.8380027137500575, + -0.8394717212685757, + -0.8401024665516881, + -0.8406616733492295, + -0.8419455432157477, + -0.8442718575683648, + -0.8452545063574128, + -0.8463736497186932, + -0.8482051204171828, + -0.8490705299881873, + -0.8509914971153842, + -0.8517992811556995, + -0.8529001061213574, + -0.8534140118599446, + -0.8550479236933909, + -0.8546875958064706, + -0.854912756017052, + -0.8552710028812924, + -0.8540050830512051, + -0.8549683128650593, + -0.8533356343963785, + -0.8529065858302278, + -0.8523943488514313, + -0.8505599877882287, + -0.8504196067476356, + -0.8500064891857687, + -0.8473058688963836, + -0.8455110580033359, + -0.8450033400838337, + -0.8450976013411348, + -0.8411144640272747, + -0.8427630836314658, + -0.840245748525282, + -0.83881010985806, + -0.8380415006896682, + -0.8371065340418268, + -0.8397018053232763, + -0.8384403684566378, + -0.8397571746851653, + -0.8368450779559747, + -0.836774041805231, + -0.8343163812831449, + -0.8367767178933924, + -0.8354104566813328, + -0.8409417991540113, + -0.840591195236538, + -0.8401744848421543, + -0.8400768404333058, + -0.8429388064252826, + -0.8437789404363726, + -0.8505906587455404, + -0.8481187043953148, + -0.8564889988389537, + -0.8514292307071689, + -0.8521353867241802, + -0.866271981913722, + -0.8718621144341306, + -0.8771626535542589, + -0.8848141366184834, + -0.8868077962262699, + -0.882666616184646, + -0.8798722386952391, + -0.8840385087135043, + -0.907747852095092, + -0.8878038025469275, + -0.9065647960139921, + -0.8957985415660717, + -0.9036827929704866, + -0.9236890771308778, + -0.9006657312200288, + -0.9041258088883867, + -0.9112607793486942, + -0.9379583212664669, + -0.9295634913349412, + -0.925697608530207, + -0.9587512678943199, + -0.27590092029398655, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ], + "meta": Array [ + Object {}, + Object {}, + ], + "x": Array [ + 800, + 803.2032032032032, + 806.4064064064064, + 809.6096096096096, + 812.8128128128128, + 816.016016016016, + 819.2192192192192, + 822.4224224224224, + 825.6256256256256, + 828.8288288288288, + 832.032032032032, + 835.2352352352352, + 838.4384384384384, + 841.6416416416416, + 844.8448448448448, + 848.048048048048, + 851.2512512512512, + 854.4544544544544, + 857.6576576576576, + 860.8608608608608, + 864.064064064064, + 867.2672672672672, + 870.4704704704704, + 873.6736736736736, + 876.8768768768768, + 880.08008008008, + 883.2832832832833, + 886.4864864864865, + 889.6896896896897, + 892.8928928928929, + 896.0960960960961, + 899.2992992992993, + 902.5025025025025, + 905.7057057057057, + 908.9089089089089, + 912.1121121121121, + 915.3153153153153, + 918.5185185185185, + 921.7217217217217, + 924.9249249249249, + 928.1281281281281, + 931.3313313313313, + 934.5345345345345, + 937.7377377377377, + 940.9409409409409, + 944.1441441441441, + 947.3473473473473, + 950.5505505505505, + 953.7537537537537, + 956.9569569569569, + 960.1601601601601, + 963.3633633633633, + 966.5665665665665, + 969.7697697697697, + 972.9729729729729, + 976.1761761761761, + 979.3793793793793, + 982.5825825825825, + 985.7857857857857, + 988.9889889889889, + 992.1921921921921, + 995.3953953953953, + 998.5985985985985, + 1001.8018018018017, + 1005.0050050050049, + 1008.2082082082081, + 1011.4114114114113, + 1014.6146146146145, + 1017.8178178178177, + 1021.0210210210209, + 1024.2242242242241, + 1027.4274274274273, + 1030.6306306306305, + 1033.8338338338338, + 1037.037037037037, + 1040.2402402402402, + 1043.4434434434434, + 1046.6466466466466, + 1049.8498498498498, + 1053.053053053053, + 1056.2562562562562, + 1059.4594594594594, + 1062.6626626626626, + 1065.8658658658658, + 1069.069069069069, + 1072.2722722722722, + 1075.4754754754754, + 1078.6786786786786, + 1081.8818818818818, + 1085.085085085085, + 1088.2882882882882, + 1091.4914914914914, + 1094.6946946946946, + 1097.8978978978978, + 1101.101101101101, + 1104.3043043043042, + 1107.5075075075074, + 1110.7107107107106, + 1113.9139139139138, + 1117.117117117117, + 1120.3203203203202, + 1123.5235235235234, + 1126.7267267267266, + 1129.9299299299298, + 1133.133133133133, + 1136.3363363363362, + 1139.5395395395394, + 1142.7427427427426, + 1145.9459459459458, + 1149.149149149149, + 1152.3523523523522, + 1155.5555555555554, + 1158.7587587587586, + 1161.9619619619618, + 1165.165165165165, + 1168.3683683683682, + 1171.5715715715714, + 1174.7747747747746, + 1177.9779779779778, + 1181.181181181181, + 1184.3843843843842, + 1187.5875875875874, + 1190.7907907907907, + 1193.9939939939939, + 1197.197197197197, + 1200.4004004004003, + 1203.6036036036035, + 1206.8068068068067, + 1210.0100100100099, + 1213.213213213213, + 1216.4164164164163, + 1219.6196196196195, + 1222.8228228228227, + 1226.0260260260259, + 1229.229229229229, + 1232.4324324324323, + 1235.6356356356355, + 1238.8388388388387, + 1242.0420420420419, + 1245.245245245245, + 1248.4484484484483, + 1251.6516516516515, + 1254.8548548548547, + 1258.058058058058, + 1261.261261261261, + 1264.4644644644643, + 1267.6676676676675, + 1270.8708708708707, + 1274.074074074074, + 1277.277277277277, + 1280.4804804804803, + 1283.6836836836835, + 1286.8868868868867, + 1290.09009009009, + 1293.2932932932931, + 1296.4964964964963, + 1299.6996996996995, + 1302.9029029029027, + 1306.106106106106, + 1309.3093093093091, + 1312.5125125125123, + 1315.7157157157155, + 1318.9189189189187, + 1322.122122122122, + 1325.3253253253251, + 1328.5285285285283, + 1331.7317317317315, + 1334.9349349349347, + 1338.138138138138, + 1341.3413413413411, + 1344.5445445445444, + 1347.7477477477476, + 1350.9509509509508, + 1354.154154154154, + 1357.3573573573572, + 1360.5605605605604, + 1363.7637637637636, + 1366.9669669669668, + 1370.17017017017, + 1373.3733733733732, + 1376.5765765765764, + 1379.7797797797796, + 1382.9829829829828, + 1386.186186186186, + 1389.3893893893892, + 1392.5925925925924, + 1395.7957957957956, + 1398.9989989989988, + 1402.202202202202, + 1405.4054054054052, + 1408.6086086086084, + 1411.8118118118116, + 1415.0150150150148, + 1418.218218218218, + 1421.4214214214212, + 1424.6246246246244, + 1427.8278278278276, + 1431.0310310310308, + 1434.234234234234, + 1437.4374374374372, + 1440.6406406406404, + 1443.8438438438436, + 1447.0470470470468, + 1450.25025025025, + 1453.4534534534532, + 1456.6566566566564, + 1459.8598598598596, + 1463.0630630630628, + 1466.266266266266, + 1469.4694694694692, + 1472.6726726726724, + 1475.8758758758756, + 1479.0790790790788, + 1482.282282282282, + 1485.4854854854852, + 1488.6886886886884, + 1491.8918918918916, + 1495.0950950950948, + 1498.298298298298, + 1501.5015015015013, + 1504.7047047047045, + 1507.9079079079077, + 1511.1111111111109, + 1514.314314314314, + 1517.5175175175173, + 1520.7207207207205, + 1523.9239239239237, + 1527.1271271271269, + 1530.33033033033, + 1533.5335335335333, + 1536.7367367367365, + 1539.9399399399397, + 1543.1431431431429, + 1546.346346346346, + 1549.5495495495493, + 1552.7527527527525, + 1555.9559559559557, + 1559.159159159159, + 1562.362362362362, + 1565.5655655655653, + 1568.7687687687685, + 1571.9719719719717, + 1575.175175175175, + 1578.378378378378, + 1581.5815815815813, + 1584.7847847847845, + 1587.9879879879877, + 1591.191191191191, + 1594.394394394394, + 1597.5975975975973, + 1600.8008008008005, + 1604.0040040040037, + 1607.207207207207, + 1610.4104104104101, + 1613.6136136136133, + 1616.8168168168165, + 1620.0200200200197, + 1623.223223223223, + 1626.4264264264261, + 1629.6296296296293, + 1632.8328328328325, + 1636.0360360360357, + 1639.239239239239, + 1642.4424424424421, + 1645.6456456456453, + 1648.8488488488485, + 1652.0520520520517, + 1655.255255255255, + 1658.4584584584582, + 1661.6616616616614, + 1664.8648648648646, + 1668.0680680680678, + 1671.271271271271, + 1674.4744744744742, + 1677.6776776776774, + 1680.8808808808806, + 1684.0840840840838, + 1687.287287287287, + 1690.4904904904902, + 1693.6936936936934, + 1696.8968968968966, + 1700.1001001000998, + 1703.303303303303, + 1706.5065065065062, + 1709.7097097097094, + 1712.9129129129126, + 1716.1161161161158, + 1719.319319319319, + 1722.5225225225222, + 1725.7257257257254, + 1728.9289289289286, + 1732.1321321321318, + 1735.335335335335, + 1738.5385385385382, + 1741.7417417417414, + 1744.9449449449446, + 1748.1481481481478, + 1751.351351351351, + 1754.5545545545542, + 1757.7577577577574, + 1760.9609609609606, + 1764.1641641641638, + 1767.367367367367, + 1770.5705705705702, + 1773.7737737737734, + 1776.9769769769766, + 1780.1801801801798, + 1783.383383383383, + 1786.5865865865862, + 1789.7897897897894, + 1792.9929929929926, + 1796.1961961961958, + 1799.399399399399, + 1802.6026026026022, + 1805.8058058058054, + 1809.0090090090087, + 1812.2122122122119, + 1815.415415415415, + 1818.6186186186183, + 1821.8218218218215, + 1825.0250250250247, + 1828.2282282282279, + 1831.431431431431, + 1834.6346346346343, + 1837.8378378378375, + 1841.0410410410407, + 1844.2442442442439, + 1847.447447447447, + 1850.6506506506503, + 1853.8538538538535, + 1857.0570570570567, + 1860.2602602602599, + 1863.463463463463, + 1866.6666666666663, + 1869.8698698698695, + 1873.0730730730727, + 1876.276276276276, + 1879.479479479479, + 1882.6826826826823, + 1885.8858858858855, + 1889.0890890890887, + 1892.292292292292, + 1895.495495495495, + 1898.6986986986983, + 1901.9019019019015, + 1905.1051051051047, + 1908.308308308308, + 1911.5115115115111, + 1914.7147147147143, + 1917.9179179179175, + 1921.1211211211207, + 1924.324324324324, + 1927.5275275275271, + 1930.7307307307303, + 1933.9339339339335, + 1937.1371371371367, + 1940.34034034034, + 1943.5435435435431, + 1946.7467467467463, + 1949.9499499499495, + 1953.1531531531527, + 1956.356356356356, + 1959.5595595595591, + 1962.7627627627623, + 1965.9659659659656, + 1969.1691691691688, + 1972.372372372372, + 1975.5755755755752, + 1978.7787787787784, + 1981.9819819819816, + 1985.1851851851848, + 1988.388388388388, + 1991.5915915915912, + 1994.7947947947944, + 1997.9979979979976, + 2001.2012012012008, + 2004.404404404404, + 2007.6076076076072, + 2010.8108108108104, + 2014.0140140140136, + 2017.2172172172168, + 2020.42042042042, + 2023.6236236236232, + 2026.8268268268264, + 2030.0300300300296, + 2033.2332332332328, + 2036.436436436436, + 2039.6396396396392, + 2042.8428428428424, + 2046.0460460460456, + 2049.249249249249, + 2052.4524524524522, + 2055.6556556556557, + 2058.858858858859, + 2062.0620620620625, + 2065.265265265266, + 2068.4684684684694, + 2071.671671671673, + 2074.8748748748762, + 2078.0780780780797, + 2081.281281281283, + 2084.4844844844865, + 2087.68768768769, + 2090.8908908908934, + 2094.094094094097, + 2097.2972972973002, + 2100.5005005005037, + 2103.703703703707, + 2106.9069069069105, + 2110.110110110114, + 2113.3133133133174, + 2116.516516516521, + 2119.7197197197243, + 2122.9229229229277, + 2126.126126126131, + 2129.3293293293345, + 2132.532532532538, + 2135.7357357357414, + 2138.938938938945, + 2142.1421421421483, + 2145.3453453453517, + 2148.548548548555, + 2151.7517517517585, + 2154.954954954962, + 2158.1581581581654, + 2161.361361361369, + 2164.5645645645723, + 2167.7677677677757, + 2170.970970970979, + 2174.1741741741826, + 2177.377377377386, + 2180.5805805805894, + 2183.783783783793, + 2186.9869869869963, + 2190.1901901901997, + 2193.393393393403, + 2196.5965965966066, + 2199.79979979981, + 2203.0030030030134, + 2206.206206206217, + 2209.4094094094203, + 2212.6126126126237, + 2215.815815815827, + 2219.0190190190306, + 2222.222222222234, + 2225.4254254254374, + 2228.628628628641, + 2231.8318318318443, + 2235.0350350350477, + 2238.238238238251, + 2241.4414414414546, + 2244.644644644658, + 2247.8478478478614, + 2251.051051051065, + 2254.2542542542683, + 2257.4574574574717, + 2260.660660660675, + 2263.8638638638786, + 2267.067067067082, + 2270.2702702702854, + 2273.473473473489, + 2276.6766766766923, + 2279.8798798798957, + 2283.083083083099, + 2286.2862862863026, + 2289.489489489506, + 2292.6926926927094, + 2295.895895895913, + 2299.0990990991163, + 2302.3023023023197, + 2305.505505505523, + 2308.7087087087266, + 2311.91191191193, + 2315.1151151151334, + 2318.318318318337, + 2321.5215215215403, + 2324.7247247247437, + 2327.927927927947, + 2331.1311311311506, + 2334.334334334354, + 2337.5375375375575, + 2340.740740740761, + 2343.9439439439643, + 2347.1471471471677, + 2350.350350350371, + 2353.5535535535746, + 2356.756756756778, + 2359.9599599599815, + 2363.163163163185, + 2366.3663663663883, + 2369.5695695695917, + 2372.772772772795, + 2375.9759759759986, + 2379.179179179202, + 2382.3823823824055, + 2385.585585585609, + 2388.7887887888123, + 2391.9919919920158, + 2395.195195195219, + 2398.3983983984226, + 2401.601601601626, + 2404.8048048048295, + 2408.008008008033, + 2411.2112112112363, + 2414.4144144144398, + 2417.617617617643, + 2420.8208208208466, + 2424.02402402405, + 2427.2272272272535, + 2430.430430430457, + 2433.6336336336603, + 2436.8368368368638, + 2440.040040040067, + 2443.2432432432706, + 2446.446446446474, + 2449.6496496496775, + 2452.852852852881, + 2456.0560560560843, + 2459.259259259288, + 2462.462462462491, + 2465.6656656656946, + 2468.868868868898, + 2472.0720720721015, + 2475.275275275305, + 2478.4784784785084, + 2481.681681681712, + 2484.884884884915, + 2488.0880880881186, + 2491.291291291322, + 2494.4944944945255, + 2497.697697697729, + 2500.9009009009324, + 2504.104104104136, + 2507.307307307339, + 2510.5105105105426, + 2513.713713713746, + 2516.9169169169495, + 2520.120120120153, + 2523.3233233233564, + 2526.52652652656, + 2529.729729729763, + 2532.9329329329667, + 2536.13613613617, + 2539.3393393393735, + 2542.542542542577, + 2545.7457457457804, + 2548.948948948984, + 2552.152152152187, + 2555.3553553553907, + 2558.558558558594, + 2561.7617617617975, + 2564.964964965001, + 2568.1681681682044, + 2571.371371371408, + 2574.5745745746112, + 2577.7777777778147, + 2580.980980981018, + 2584.1841841842215, + 2587.387387387425, + 2590.5905905906284, + 2593.793793793832, + 2596.9969969970352, + 2600.2002002002387, + 2603.403403403442, + 2606.6066066066455, + 2609.809809809849, + 2613.0130130130524, + 2616.216216216256, + 2619.4194194194592, + 2622.6226226226627, + 2625.825825825866, + 2629.0290290290695, + 2632.232232232273, + 2635.4354354354764, + 2638.63863863868, + 2641.8418418418833, + 2645.0450450450867, + 2648.24824824829, + 2651.4514514514935, + 2654.654654654697, + 2657.8578578579004, + 2661.061061061104, + 2664.2642642643073, + 2667.4674674675107, + 2670.670670670714, + 2673.8738738739175, + 2677.077077077121, + 2680.2802802803244, + 2683.483483483528, + 2686.6866866867313, + 2689.8898898899347, + 2693.093093093138, + 2696.2962962963416, + 2699.499499499545, + 2702.7027027027484, + 2705.905905905952, + 2709.1091091091553, + 2712.3123123123587, + 2715.515515515562, + 2718.7187187187656, + 2721.921921921969, + 2725.1251251251724, + 2728.328328328376, + 2731.5315315315793, + 2734.7347347347827, + 2737.937937937986, + 2741.1411411411896, + 2744.344344344393, + 2747.5475475475964, + 2750.7507507508, + 2753.9539539540033, + 2757.1571571572067, + 2760.36036036041, + 2763.5635635636136, + 2766.766766766817, + 2769.9699699700204, + 2773.173173173224, + 2776.3763763764273, + 2779.5795795796307, + 2782.782782782834, + 2785.9859859860376, + 2789.189189189241, + 2792.3923923924444, + 2795.595595595648, + 2798.7987987988513, + 2802.0020020020547, + 2805.205205205258, + 2808.4084084084616, + 2811.611611611665, + 2814.8148148148684, + 2818.018018018072, + 2821.2212212212753, + 2824.4244244244787, + 2827.627627627682, + 2830.8308308308856, + 2834.034034034089, + 2837.2372372372924, + 2840.440440440496, + 2843.6436436436993, + 2846.8468468469027, + 2850.050050050106, + 2853.2532532533096, + 2856.456456456513, + 2859.6596596597165, + 2862.86286286292, + 2866.0660660661233, + 2869.2692692693267, + 2872.47247247253, + 2875.6756756757336, + 2878.878878878937, + 2882.0820820821405, + 2885.285285285344, + 2888.4884884885473, + 2891.6916916917507, + 2894.894894894954, + 2898.0980980981576, + 2901.301301301361, + 2904.5045045045645, + 2907.707707707768, + 2910.9109109109713, + 2914.1141141141748, + 2917.317317317378, + 2920.5205205205816, + 2923.723723723785, + 2926.9269269269885, + 2930.130130130192, + 2933.3333333333953, + 2936.5365365365988, + 2939.739739739802, + 2942.9429429430056, + 2946.146146146209, + 2949.3493493494125, + 2952.552552552616, + 2955.7557557558193, + 2958.9589589590228, + 2962.162162162226, + 2965.3653653654296, + 2968.568568568633, + 2971.7717717718365, + 2974.97497497504, + 2978.1781781782433, + 2981.3813813814468, + 2984.58458458465, + 2987.7877877878536, + 2990.990990991057, + 2994.1941941942605, + 2997.397397397464, + 3000.6006006006673, + 3003.803803803871, + 3007.007007007074, + 3010.2102102102776, + 3013.413413413481, + 3016.6166166166845, + 3019.819819819888, + 3023.0230230230914, + 3026.226226226295, + 3029.429429429498, + 3032.6326326327016, + 3035.835835835905, + 3039.0390390391085, + 3042.242242242312, + 3045.4454454455154, + 3048.648648648719, + 3051.851851851922, + 3055.0550550551256, + 3058.258258258329, + 3061.4614614615325, + 3064.664664664736, + 3067.8678678679394, + 3071.071071071143, + 3074.274274274346, + 3077.4774774775497, + 3080.680680680753, + 3083.8838838839565, + 3087.08708708716, + 3090.2902902903634, + 3093.493493493567, + 3096.6966966967702, + 3099.8998998999737, + 3103.103103103177, + 3106.3063063063805, + 3109.509509509584, + 3112.7127127127874, + 3115.915915915991, + 3119.1191191191942, + 3122.3223223223977, + 3125.525525525601, + 3128.7287287288045, + 3131.931931932008, + 3135.1351351352114, + 3138.338338338415, + 3141.5415415416182, + 3144.7447447448217, + 3147.947947948025, + 3151.1511511512285, + 3154.354354354432, + 3157.5575575576354, + 3160.760760760839, + 3163.9639639640423, + 3167.1671671672457, + 3170.370370370449, + 3173.5735735736525, + 3176.776776776856, + 3179.9799799800594, + 3183.183183183263, + 3186.3863863864663, + 3189.5895895896697, + 3192.792792792873, + 3195.9959959960765, + 3199.19919919928, + 3202.4024024024834, + 3205.605605605687, + 3208.8088088088903, + 3212.0120120120937, + 3215.215215215297, + 3218.4184184185006, + 3221.621621621704, + 3224.8248248249074, + 3228.028028028111, + 3231.2312312313143, + 3234.4344344345177, + 3237.637637637721, + 3240.8408408409246, + 3244.044044044128, + 3247.2472472473314, + 3250.450450450535, + 3253.6536536537383, + 3256.8568568569417, + 3260.060060060145, + 3263.2632632633486, + 3266.466466466552, + 3269.6696696697554, + 3272.872872872959, + 3276.0760760761623, + 3279.2792792793657, + 3282.482482482569, + 3285.6856856857726, + 3288.888888888976, + 3292.0920920921794, + 3295.295295295383, + 3298.4984984985863, + 3301.7017017017897, + 3304.904904904993, + 3308.1081081081966, + 3311.3113113114, + 3314.5145145146034, + 3317.717717717807, + 3320.9209209210103, + 3324.1241241242137, + 3327.327327327417, + 3330.5305305306206, + 3333.733733733824, + 3336.9369369370274, + 3340.140140140231, + 3343.3433433434343, + 3346.5465465466377, + 3349.749749749841, + 3352.9529529530446, + 3356.156156156248, + 3359.3593593594514, + 3362.562562562655, + 3365.7657657658583, + 3368.9689689690617, + 3372.172172172265, + 3375.3753753754686, + 3378.578578578672, + 3381.7817817818755, + 3384.984984985079, + 3388.1881881882823, + 3391.3913913914857, + 3394.594594594689, + 3397.7977977978926, + 3401.001001001096, + 3404.2042042042995, + 3407.407407407503, + 3410.6106106107063, + 3413.8138138139097, + 3417.017017017113, + 3420.2202202203166, + 3423.42342342352, + 3426.6266266267235, + 3429.829829829927, + 3433.0330330331303, + 3436.2362362363338, + 3439.439439439537, + 3442.6426426427406, + 3445.845845845944, + 3449.0490490491475, + 3452.252252252351, + 3455.4554554555543, + 3458.6586586587578, + 3461.861861861961, + 3465.0650650651646, + 3468.268268268368, + 3471.4714714715715, + 3474.674674674775, + 3477.8778778779783, + 3481.0810810811818, + 3484.284284284385, + 3487.4874874875886, + 3490.690690690792, + 3493.8938938939955, + 3497.097097097199, + 3500.3003003004023, + 3503.5035035036058, + 3506.706706706809, + 3509.9099099100126, + 3513.113113113216, + 3516.3163163164195, + 3519.519519519623, + 3522.7227227228263, + 3525.92592592603, + 3529.129129129233, + 3532.3323323324366, + 3535.53553553564, + 3538.7387387388435, + 3541.941941942047, + 3545.1451451452504, + 3548.348348348454, + 3551.551551551657, + 3554.7547547548606, + 3557.957957958064, + 3561.1611611612675, + 3564.364364364471, + 3567.5675675676744, + 3570.770770770878, + 3573.973973974081, + 3577.1771771772846, + 3580.380380380488, + 3583.5835835836915, + 3586.786786786895, + 3589.9899899900984, + 3593.193193193302, + 3596.396396396505, + 3599.5995995997087, + 3602.802802802912, + 3606.0060060061155, + 3609.209209209319, + 3612.4124124125224, + 3615.615615615726, + 3618.8188188189292, + 3622.0220220221327, + 3625.225225225336, + 3628.4284284285395, + 3631.631631631743, + 3634.8348348349464, + 3638.03803803815, + 3641.2412412413532, + 3644.4444444445567, + 3647.64764764776, + 3650.8508508509635, + 3654.054054054167, + 3657.2572572573704, + 3660.460460460574, + 3663.6636636637772, + 3666.8668668669807, + 3670.070070070184, + 3673.2732732733875, + 3676.476476476591, + 3679.6796796797944, + 3682.882882882998, + 3686.0860860862012, + 3689.2892892894047, + 3692.492492492608, + 3695.6956956958115, + 3698.898898899015, + 3702.1021021022184, + 3705.305305305422, + 3708.5085085086253, + 3711.7117117118287, + 3714.914914915032, + 3718.1181181182355, + 3721.321321321439, + 3724.5245245246424, + 3727.727727727846, + 3730.9309309310493, + 3734.1341341342527, + 3737.337337337456, + 3740.5405405406595, + 3743.743743743863, + 3746.9469469470664, + 3750.15015015027, + 3753.3533533534733, + 3756.5565565566767, + 3759.75975975988, + 3762.9629629630836, + 3766.166166166287, + 3769.3693693694904, + 3772.572572572694, + 3775.7757757758973, + 3778.9789789791007, + 3782.182182182304, + 3785.3853853855076, + 3788.588588588711, + 3791.7917917919144, + 3794.994994995118, + 3798.1981981983213, + 3801.4014014015247, + 3804.604604604728, + 3807.8078078079316, + 3811.011011011135, + 3814.2142142143384, + 3817.417417417542, + 3820.6206206207453, + 3823.8238238239487, + 3827.027027027152, + 3830.2302302303556, + 3833.433433433559, + 3836.6366366367624, + 3839.839839839966, + 3843.0430430431693, + 3846.2462462463727, + 3849.449449449576, + 3852.6526526527796, + 3855.855855855983, + 3859.0590590591864, + 3862.26226226239, + 3865.4654654655933, + 3868.6686686687967, + 3871.871871872, + 3875.0750750752036, + 3878.278278278407, + 3881.4814814816104, + 3884.684684684814, + 3887.8878878880173, + 3891.0910910912207, + 3894.294294294424, + 3897.4974974976276, + 3900.700700700831, + 3903.9039039040345, + 3907.107107107238, + 3910.3103103104413, + 3913.5135135136447, + 3916.716716716848, + 3919.9199199200516, + 3923.123123123255, + 3926.3263263264585, + 3929.529529529662, + 3932.7327327328653, + 3935.9359359360687, + 3939.139139139272, + 3942.3423423424756, + 3945.545545545679, + 3948.7487487488825, + 3951.951951952086, + 3955.1551551552893, + 3958.3583583584928, + 3961.561561561696, + 3964.7647647648996, + 3967.967967968103, + 3971.1711711713065, + 3974.37437437451, + 3977.5775775777133, + 3980.7807807809168, + 3983.98398398412, + 3987.1871871873236, + 3990.390390390527, + 3993.5935935937305, + 3996.796796796934, + 4000.0000000001373, + ], +} +`; diff --git a/src/__tests__/spectra.test.js b/src/__tests__/spectra.test.js index 443afc3..4feb3a8 100644 --- a/src/__tests__/spectra.test.js +++ b/src/__tests__/spectra.test.js @@ -5,20 +5,20 @@ import { fromJcamp } from '..'; import { Spectra } from '../Spectra'; -const testFilesDir = '../../testFiles/xtc'; +const testFilesDir = '../../testFiles/'; test('Load set of data', () => { let files = readdirSync(join(__dirname, testFilesDir)).filter((file) => - file.match(/0140|0189|0235/) + file.match(/DX/) ); let spectra = new Spectra({ from: 800, to: 4000, numberOfPoints: 1024 }); for (let file of files) { let jcamp = readFileSync(join(__dirname, testFilesDir, file), 'utf8'); let spectrum = fromJcamp(jcamp); - spectra.addSpectrum(spectrum, file.replace('.jdx', '')); + spectra.addSpectrum(spectrum, file.replace('.DX', '')); } - expect(spectra.data).toHaveLength(45); + expect(spectra.data).toHaveLength(2); spectra.getNormalizedData(); expect(spectra.getNormalizedData()).toMatchSnapshot(); }); diff --git a/src/from/__tests__/jcamp.test.js b/src/from/__tests__/jcamp.test.js index 084548e..af5334a 100644 --- a/src/from/__tests__/jcamp.test.js +++ b/src/from/__tests__/jcamp.test.js @@ -4,19 +4,10 @@ import { join } from 'path'; import { fromJcamp } from '../..'; test('fromJcamp absorbance', () => { - const path = join(__dirname, '../../../testFiles/absorbance.jdx'); + const path = join(__dirname, '../../../testFiles/MS5093A.DX'); const jcamp = readFileSync(path, 'utf8'); const spectrum = fromJcamp(jcamp); - expect(spectrum.wavelength).toHaveLength(1738); - expect(spectrum.absorbance).toHaveLength(1738); - expect(spectrum.transmittance).toHaveLength(1738); -}); - -test('fromJcamp transmittance', () => { - const path = join(__dirname, '../../../testFiles/transmittance1.jdx'); - const jcamp = readFileSync(path, 'utf8'); - const spectrum = fromJcamp(jcamp); - expect(spectrum.wavelength).toHaveLength(1991); - expect(spectrum.absorbance).toHaveLength(1991); - expect(spectrum.transmittance).toHaveLength(1991); + expect(spectrum.wavelength).toHaveLength(911); + expect(spectrum.absorbance).toHaveLength(911); + expect(spectrum.transmittance).toHaveLength(911); }); diff --git a/src/spectrum/__tests__/peakPicking.test.js b/src/spectrum/__tests__/peakPicking.test.js index 9f089e3..4e9aaf2 100644 --- a/src/spectrum/__tests__/peakPicking.test.js +++ b/src/spectrum/__tests__/peakPicking.test.js @@ -11,14 +11,13 @@ let text = ` `; describe('Test addPeaks', () => { it('default options', () => { - let irSpectrum = fromText(text); + let uvSpectrum = fromText(text); - expect(irSpectrum.peaks).toStrictEqual([]); - irSpectrum.peakPicking(3); - expect(irSpectrum.peaks).toStrictEqual([ + expect(uvSpectrum.peaks).toStrictEqual([]); + uvSpectrum.peakPicking(3); + expect(uvSpectrum.peaks).toStrictEqual([ { absorbance: 0.3010299956639812, - kind: 'm', transmittance: 0.5, wavelength: 3 } @@ -26,14 +25,13 @@ describe('Test addPeaks', () => { }); it('large range', () => { - let irSpectrum = fromText(text); + let uvSpectrum = fromText(text); - irSpectrum.peaks = []; - irSpectrum.peakPicking(3, { range: 10 }); - expect(irSpectrum.peaks).toStrictEqual([ + uvSpectrum.peaks = []; + uvSpectrum.peakPicking(3, { range: 10 }); + expect(uvSpectrum.peaks).toStrictEqual([ { absorbance: 0.6989700043360187, - kind: 'S', transmittance: 0.2, wavelength: 6 } @@ -41,14 +39,13 @@ describe('Test addPeaks', () => { }); it('small range', () => { - let irSpectrum = fromText(text); + let uvSpectrum = fromText(text); - irSpectrum.peaks = []; - irSpectrum.peakPicking(4, { range: 1 }); - expect(irSpectrum.peaks).toStrictEqual([ + uvSpectrum.peaks = []; + uvSpectrum.peakPicking(4, { range: 1 }); + expect(uvSpectrum.peaks).toStrictEqual([ { absorbance: 0.3010299956639812, - kind: 'm', transmittance: 0.5, wavelength: 3 } @@ -56,20 +53,18 @@ describe('Test addPeaks', () => { }); it('test optimize', () => { - let irSpectrum = fromText(text); + let uvSpectrum = fromText(text); - irSpectrum.peakPicking(7, { optimize: true }); - irSpectrum.peakPicking(1, { optimize: true }); - expect(irSpectrum.peaks).toStrictEqual([ + uvSpectrum.peakPicking(7, { optimize: true }); + uvSpectrum.peakPicking(1, { optimize: true }); + expect(uvSpectrum.peaks).toStrictEqual([ { absorbance: 0.6989700043360187, - kind: 'S', transmittance: 0.2, wavelength: 6 }, { absorbance: 0.3010299956639812, - kind: 'm', transmittance: 0.5, wavelength: 3 } @@ -77,14 +72,13 @@ describe('Test addPeaks', () => { }); it('test duplicate', () => { - let irSpectrum = fromText(text); + let uvSpectrum = fromText(text); - irSpectrum.peakPicking(3, { range: 1 }); - irSpectrum.peakPicking(3, { optimize: true }); - expect(irSpectrum.peaks).toStrictEqual([ + uvSpectrum.peakPicking(3, { range: 1 }); + uvSpectrum.peakPicking(3, { optimize: true }); + expect(uvSpectrum.peaks).toStrictEqual([ { absorbance: 0.3010299956639812, - kind: 'm', transmittance: 0.5, wavelength: 3 } diff --git a/testFiles/simple.txt b/testFiles/simple.txt new file mode 100644 index 0000000..48b0774 --- /dev/null +++ b/testFiles/simple.txt @@ -0,0 +1,3 @@ +1 2 +2 3 +3 2