diff --git a/normalized_nrvs.archive.json b/normalized_nrvs.archive.json index 518fb3f..fa7f411 100644 --- a/normalized_nrvs.archive.json +++ b/normalized_nrvs.archive.json @@ -2,8 +2,748 @@ "data": { "m_def": "nomad_unisyscat.schema_packages.mypackage.NRVSpectroscopy", "name": "nrvs test", - "datetime": "2024-05-28T21:08:47.123017+00:00", + "datetime": "2024-05-29T13:52:14.690498+00:00", "measurement_data_file": "ReRH_Nia-C_H_NRVS_exp.dat", + "results": [ + { + "intensity": [ + 0.0, + 0.964988362420601, + 3.44977912878747, + 6.996691146042, + 12.6844551452426, + 19.2896961053206, + 24.1400974024066, + 27.5386824148664, + 30.9224569396232, + 35.2012171515541, + 40.7217807410163, + 46.4924642079573, + 51.7582240979192, + 56.6879545489399, + 61.2413049021138, + 65.2513596352892, + 68.2739044295877, + 69.9454116489551, + 70.9024841089647, + 71.5759934702104, + 71.5906053560461, + 71.1034737906402, + 70.6162917221748, + 70.2451128455812, + 70.2680679762493, + 71.0161316091145, + 72.2863403887373, + 73.4183823711477, + 73.6692560080901, + 73.1539946134176, + 72.8643017364611, + 72.9453344868842, + 72.7542262813353, + 72.5112048514479, + 72.6449281088994, + 72.77818963773, + 72.630513861093, + 72.0438119310502, + 70.5658408004847, + 68.6353785422938, + 67.4925233333758, + 67.2919499443919, + 67.3254611180707, + 67.6534258457074, + 68.6935825673097, + 69.8224225397483, + 69.5773787306177, + 67.2471881458145, + 63.8689717718224, + 61.2479222255732, + 60.2861602908243, + 60.9279036994497, + 63.0348896646076, + 66.2233339317592, + 69.4289542193422, + 71.5486166710923, + 72.59971157726, + 74.0306289894816, + 76.9944590359693, + 80.65815048389, + 83.7415658381832, + 86.5118686392253, + 89.9595271743718, + 94.3057372535494, + 98.3020061646193, + 99.9166211216993, + 98.9835119853731, + 97.5963415511908, + 96.6096183297535, + 94.2593043622169, + 88.8228534568875, + 81.2136747660198, + 74.8793029500698, + 72.1493047703345, + 71.2097710542051, + 69.2083710857892, + 66.2707136893124, + 64.0701392726937, + 63.2065973611586, + 62.7181945403362, + 60.5311620786819, + 55.7262754556078, + 50.5186106713306, + 48.2517599187191, + 49.9198361518851, + 52.9537355610425, + 53.4394981165529, + 50.6752626762076, + 47.8832703625029, + 46.9398115416293, + 45.9804616838895, + 43.5967691914412, + 41.3176412440593, + 40.5999029612239, + 40.3838046746848, + 39.0775179739806, + 37.0257327588384, + 35.3741855720864, + 34.3090973730367, + 33.8512397360915, + 34.5310112561293, + 36.885057092221, + 40.9656439258031, + 45.3501897864868, + 47.9225435134335, + 48.7270287903831, + 49.5759236255508, + 51.3663648655567, + 54.0297955383289, + 57.1696272313753, + 59.7898590488378, + 61.1870937756525, + 61.7230119419313, + 62.0529280573943, + 62.4902452077878, + 62.9559477029394, + 63.0888510638115, + 63.0431301140187, + 63.8695057073506, + 65.9985034448829, + 68.1587396460805, + 68.953329274419, + 68.2270493401389, + 66.1513005026477, + 62.7714183700752, + 58.7834802779816, + 55.16113634987, + 52.5278885148908, + 51.5245337494178, + 51.9005976327188, + 51.5592832546537, + 48.8917425774994, + 44.920285794152, + 41.639540625586, + 40.1409907716612, + 40.9512005151571, + 43.758499876115, + 46.3438383881545, + 46.6140044881177, + 45.7651687272972, + 46.00236338632, + 46.4549704484455, + 45.3588665225912, + 43.3447684643641, + 41.5516076679327, + 40.4183967446998, + 40.6341715709027, + 41.8292385516819, + 42.4182498584145, + 42.1323026268385, + 42.2875740844804, + 44.1197560369664, + 47.7463422019194, + 51.6687399818981, + 54.0793352387615, + 54.9369020873675, + 55.1370046608468, + 54.6700643277802, + 53.666474378896, + 53.3260390995928, + 53.5084490361448, + 52.1161848364082, + 48.7514551909875, + 45.3875025820665, + 43.072285427611, + 41.7292554702945, + 41.743189332585, + 43.143762008876, + 44.9659443822009, + 46.0551217214462, + 46.0080790562938, + 45.7047442715637, + 45.6181200724309, + 43.8795294966539, + 38.9084901107117, + 32.5886407765075, + 27.8523448919265, + 25.3061932129508, + 23.8834138638026, + 22.3645304210491, + 20.0060348149349, + 17.1646059540295, + 14.6650071154678, + 12.673103554811, + 11.0259727601973, + 9.68107302899578, + 8.50189632576231, + 7.42156787180301, + 6.57192206116464, + 5.97593396834189, + 5.51528816102207, + 5.22847239109234, + 5.39974971227051, + 6.14631074911456, + 7.11289124397356, + 7.94797417866643, + 8.49885914695224, + 8.34318308436142, + 7.26450477514253, + 5.98510759543225, + 5.27535448128956, + 5.12019779642175, + 5.41767079184023, + 6.18942433680882, + 7.0437748573942, + 7.69246001733471, + 8.26089195467966, + 8.42812776012297, + 7.70354248536919, + 6.42870024403, + 5.18510970112388, + 4.10113125288308, + 3.32064779454708, + 3.00455569785422, + 2.9215041522858, + 2.76885460303865, + 2.58879054050155, + 2.61135827727752, + 2.8962311130721, + 3.21814072609327, + 3.34492026079357, + 3.34123235838131, + 3.4057845127411, + 3.51564031665884, + 3.41837755778227, + 2.9154016606209, + 2.11735888322686, + 1.39795200482365, + 1.03284903738835, + 1.05665764884938, + 1.44404635127638, + 2.02745874724907, + 2.44278547458296, + 2.6279329925443, + 3.0014934376432, + 3.87263640526763, + 5.0945102667615, + 6.31486197151981, + 7.28755383317391, + 8.04303313321428, + 8.82000453830017, + 9.75012915660184, + 10.699888487217, + 11.4142919236448, + 11.6511194810904, + 11.2731900098013, + 10.2633873863599, + 8.61660833686044, + 6.60617355503708, + 5.00527882425605, + 4.41613190618914, + 4.69345110876999, + 5.19101001171074, + 5.19574634780736, + 4.52494286706335, + 3.78000590224646, + 3.51208061168057, + 3.64583656474013, + 4.05328506113576, + 4.86635992313562, + 6.08478824117524, + 7.50206251035516, + 8.87414498415445, + 9.74220535660258, + 9.46011107532112, + 7.93918348299739, + 6.04928274130765, + 4.75126409547602, + 4.20878849689169, + 4.08651288651864, + 4.06255687197271, + 3.82975236128979, + 3.26372118511768, + 2.62583234144654, + 2.19690600085129, + 1.93795170787371, + 1.71616476266138, + 1.50712116382161, + 1.27774120854229, + 0.999020698495817, + 0.758836105191676, + 0.66319230474915, + 0.718437256314809, + 0.841792539840138, + 0.918507156428632, + 0.917666097998729, + 0.921273412564109, + 0.983285970784254, + 1.06545689219939, + 1.10488601448378, + 1.0787024991428, + 1.05226760920543, + 1.09702614411007, + 1.12892377513117, + 1.02419781074083, + 0.848005840199014, + 0.734588035986815, + 0.691112793950569, + 0.697007778237783, + 0.777580488546573, + 0.885473996169724, + 0.919980100951747, + 0.879668441455458, + 0.842223392998535, + 0.831234780734996, + 0.794543715177249, + 0.685185120114247, + 0.538814610894077, + 0.452366271948801, + 0.473728982294334, + 0.568392863466035, + 0.683840540283503, + 0.764650971921112, + 0.768259615047039, + 0.753435050750549, + 0.832453779413443, + 0.971272188086344, + 0.994720542743776, + 0.837600003876385, + 0.642266950077424, + 0.557254509384738, + 0.576644020410911, + 0.631076535155798, + 0.678058787367661, + 0.68594171670609, + 0.660735719038716, + 0.608044639952203, + 0.490913001501928, + 0.378928080145494, + 0.407295219492822, + 0.507485980673482, + 0.521726431269689, + 0.481204319456692, + 0.480680999894152, + 0.491589256592185, + 0.436412150651624, + 0.311990061705228, + 0.229100972290308, + 0.276904156670873, + 0.362517534502753, + 0.38079310265747, + 0.400888118925845, + 0.479575865539985, + 0.552421352648087, + 0.587406547078307, + 0.577588502413777, + 0.49336295668482, + 0.394173470397101, + 0.355844215499416, + 0.32963602606816, + 0.28498302145498, + 0.279613306831612, + 0.301257569822565, + 0.287815889897255, + 0.252378183628085, + 0.244330950874281, + 0.290177667406802, + 0.362896905539216, + 0.373407710338743, + 0.290732588838644, + 0.215370859330088, + 0.263154911663025, + 0.405211252038087, + 0.436773780121369, + 0.236006901974587, + -0.012471621289699 + ], + "wavenumber": [ + 0.0, + 2.26922612407368, + 4.53845224814734, + 6.80767837222099, + 9.07690449629464, + 11.3461306203683, + 13.615356744442, + 15.8845828685156, + 18.1538089925893, + 20.4230351166629, + 22.6922612407367, + 24.9614873648103, + 27.230713488884, + 29.4999396129576, + 31.7691657370312, + 34.038391861105, + 36.3076179851786, + 38.5768441092523, + 40.8460702333259, + 43.1152963573996, + 45.3845224814733, + 47.6537486055469, + 49.9229747296206, + 52.1922008536942, + 54.4614269777679, + 56.7306531018416, + 58.9998792259152, + 61.2691053499889, + 63.5383314740625, + 65.8075575981362, + 68.0767837222099, + 70.3460098462835, + 72.6152359703572, + 74.8844620944308, + 77.1536882185046, + 79.4229143425782, + 81.6921404666516, + 83.9613665907259, + 86.2305927147994, + 88.4998188388729, + 90.7690449629464, + 93.0382710870199, + 95.3074972110942, + 97.5767233351677, + 99.8459494592412, + 102.115175583315, + 104.384401707388, + 106.653627831462, + 108.922853955536, + 111.192080079609, + 113.461306203683, + 115.730532327756, + 117.999758451831, + 120.268984575904, + 122.538210699978, + 124.807436824051, + 127.076662948125, + 129.345889072199, + 131.615115196273, + 133.884341320346, + 136.15356744442, + 138.422793568493, + 140.692019692567, + 142.961245816641, + 145.230471940714, + 147.499698064788, + 149.768924188861, + 152.038150312936, + 154.307376437009, + 156.576602561083, + 158.845828685156, + 161.11505480923, + 163.384280933304, + 165.653507057377, + 167.922733181451, + 170.191959305524, + 172.461185429598, + 174.730411553672, + 176.999637677746, + 179.268863801819, + 181.538089925893, + 183.807316049966, + 186.076542174041, + 188.345768298114, + 190.614994422188, + 192.884220546261, + 195.153446670335, + 197.422672794409, + 199.691898918482, + 201.961125042556, + 204.230351166629, + 206.499577290703, + 208.768803414777, + 211.038029538851, + 213.307255662924, + 215.576481786998, + 217.845707911072, + 220.114934035145, + 222.384160159219, + 224.653386283292, + 226.922612407366, + 229.19183853144, + 231.461064655514, + 233.730290779587, + 235.999516903661, + 238.268743027734, + 240.537969151809, + 242.807195275882, + 245.076421399956, + 247.345647524029, + 249.614873648103, + 251.884099772177, + 254.15332589625, + 256.422552020324, + 258.691778144397, + 260.961004268471, + 263.230230392545, + 265.499456516619, + 267.768682640692, + 270.037908764766, + 272.307134888839, + 274.576361012913, + 276.845587136987, + 279.11481326106, + 281.384039385134, + 283.653265509207, + 285.922491633282, + 288.191717757355, + 290.460943881429, + 292.730170005502, + 294.999396129576, + 297.26862225365, + 299.537848377723, + 301.807074501797, + 304.07630062587, + 306.345526749944, + 308.614752874018, + 310.883978998092, + 313.153205122165, + 315.422431246239, + 317.691657370312, + 319.960883494387, + 322.23010961846, + 324.499335742534, + 326.768561866607, + 329.037787990681, + 331.307014114755, + 333.576240238828, + 335.845466362902, + 338.114692486975, + 340.383918611049, + 342.653144735123, + 344.922370859197, + 347.19159698327, + 349.460823107344, + 351.730049231417, + 353.999275355491, + 356.268501479565, + 358.537727603638, + 360.806953727712, + 363.076179851785, + 365.34540597586, + 367.614632099933, + 369.883858224007, + 372.15308434808, + 374.422310472155, + 376.691536596228, + 378.960762720302, + 381.229988844375, + 383.499214968449, + 385.768441092523, + 388.037667216596, + 390.30689334067, + 392.576119464743, + 394.845345588817, + 397.114571712891, + 399.383797836965, + 401.653023961038, + 403.922250085112, + 406.191476209185, + 408.460702333259, + 410.729928457333, + 412.999154581406, + 415.26838070548, + 417.537606829553, + 419.806832953628, + 422.076059077701, + 424.345285201775, + 426.614511325848, + 428.883737449922, + 431.152963573996, + 433.42218969807, + 435.691415822143, + 437.960641946217, + 440.22986807029, + 442.499094194364, + 444.768320318438, + 447.037546442511, + 449.306772566585, + 451.575998690658, + 453.845224814733, + 456.114450938806, + 458.38367706288, + 460.652903186953, + 462.922129311027, + 465.191355435101, + 467.460581559174, + 469.729807683248, + 471.999033807321, + 474.268259931396, + 476.537486055469, + 478.806712179543, + 481.075938303616, + 483.34516442769, + 485.614390551764, + 487.883616675838, + 490.152842799911, + 492.422068923985, + 494.691295048058, + 496.960521172132, + 499.229747296206, + 501.498973420279, + 503.768199544353, + 506.037425668426, + 508.306651792501, + 510.575877916574, + 512.845104040648, + 515.114330164721, + 517.383556288795, + 519.652782412869, + 521.922008536942, + 524.191234661016, + 526.460460785089, + 528.729686909163, + 530.998913033237, + 533.268139157311, + 535.537365281384, + 537.806591405458, + 540.075817529531, + 542.345043653606, + 544.614269777679, + 546.883495901753, + 549.152722025826, + 551.4219481499, + 553.691174273974, + 555.960400398047, + 558.229626522121, + 560.498852646194, + 562.768078770268, + 565.037304894342, + 567.306531018416, + 569.575757142489, + 571.844983266563, + 574.114209390636, + 576.38343551471, + 578.652661638784, + 580.921887762857, + 583.191113886931, + 585.460340011004, + 587.729566135079, + 589.998792259152, + 592.268018383226, + 594.537244507299, + 596.806470631373, + 599.075696755447, + 601.34492287952, + 603.614149003594, + 605.883375127667, + 608.152601251742, + 610.421827375815, + 612.691053499889, + 614.960279623962, + 617.229505748036, + 619.49873187211, + 621.767957996184, + 624.037184120257, + 626.306410244331, + 628.575636368404, + 630.844862492478, + 633.114088616552, + 635.383314740625, + 637.652540864699, + 639.921766988772, + 642.190993112847, + 644.46021923692, + 646.729445360994, + 648.998671485067, + 651.267897609141, + 653.537123733215, + 655.806349857288, + 658.075575981362, + 660.344802105435, + 662.614028229509, + 664.883254353583, + 667.152480477657, + 669.42170660173, + 671.690932725804, + 673.960158849877, + 676.229384973951, + 678.498611098025, + 680.767837222098, + 683.037063346172, + 685.306289470245, + 687.57551559432, + 689.844741718393, + 692.113967842467, + 694.38319396654, + 696.652420090614, + 698.921646214688, + 701.190872338762, + 703.460098462835, + 705.729324586909, + 707.998550710982, + 710.267776835056, + 712.53700295913, + 714.806229083203, + 717.075455207277, + 719.34468133135, + 721.613907455425, + 723.883133579498, + 726.152359703572, + 728.421585827645, + 730.690811951719, + 732.960038075793, + 735.229264199867, + 737.49849032394, + 739.767716448014, + 742.036942572087, + 744.306168696161, + 746.575394820235, + 748.844620944308, + 751.113847068382, + 753.383073192455, + 755.65229931653, + 757.921525440603, + 760.190751564677, + 762.45997768875, + 764.729203812824, + 766.998429936898, + 769.267656060971, + 771.536882185045, + 773.806108309118, + 776.075334433192, + 778.344560557266, + 780.61378668134, + 782.883012805413, + 785.152238929487, + 787.421465053561, + 789.690691177635, + 791.959917301708, + 794.229143425782, + 796.498369549855, + 798.767595673929, + 801.036821798003, + 803.306047922076, + 805.57527404615, + 807.844500170222, + 810.113726294299, + 812.382952418369, + 814.652178542446, + 816.921404666516, + 819.190630790593, + 821.459856914663, + 823.72908303874, + 825.99830916281, + 828.267535286887 + ] + } + ], "figures": [ { "label": "NRVS", @@ -1620,11 +2360,11 @@ "entry_type": "NRVSpectroscopy", "mainfile": "/workspaces/nomad-unisyscat-plugin/tests/data/nrvs_test.archive.yaml", "text_search_contents": [ - "nrvs test", "NRVS", + "nrvs test", "ReRH_Nia-C_H_NRVS_exp.dat" ], - "n_quantities": 19, + "n_quantities": 22, "quantities": [ "", "data", @@ -1634,6 +2374,9 @@ "data.figures.label", "data.measurement_data_file", "data.name", + "data.results", + "data.results.intensity", + "data.results.wavenumber", "metadata", "metadata.entry_name", "metadata.entry_type", @@ -1661,6 +2404,7 @@ "nomad.datamodel.results.ELN", "nomad.datamodel.results.Properties", "nomad.datamodel.results.Results", + "nomad_unisyscat.schema_packages.mypackage.NRVSResult", "nomad_unisyscat.schema_packages.mypackage.NRVSpectroscopy" ], "section_defs": [ @@ -1689,6 +2433,11 @@ "definition_id": "fc2735d177bf36f9718ca66a764a56fc0c6200a0", "used_directly": false }, + { + "definition_qualified_name": "nomad.datamodel.metainfo.basesections.ActivityResult", + "definition_id": "7a45b4ea57a5d815e77298f59597f9d85fb93499", + "used_directly": false + }, { "definition_qualified_name": "nomad.datamodel.metainfo.basesections.BaseSection", "definition_id": "add2edfa25a61ff3bbfdebacc870181f64f41634", @@ -1699,6 +2448,11 @@ "definition_id": "92a193e908065fa4ff809fb88e83e3057876be33", "used_directly": true }, + { + "definition_qualified_name": "nomad.datamodel.metainfo.basesections.MeasurementResult", + "definition_id": "b41fee755770982d78a427f10debb30fea469269", + "used_directly": true + }, { "definition_qualified_name": "nomad.datamodel.metainfo.plot.Figure", "definition_id": "55ef08f33dcf9fb374aea217458bd34a23bec57b", @@ -1739,9 +2493,14 @@ "definition_id": "d77c26594ec0501fb0de8daaa4d7b25d54b9e0cf", "used_directly": true }, + { + "definition_qualified_name": "nomad_unisyscat.schema_packages.mypackage.NRVSResult", + "definition_id": "16f9d82d6fdb8c783d4caeb3d926ceee0e466bc6", + "used_directly": true + }, { "definition_qualified_name": "nomad_unisyscat.schema_packages.mypackage.NRVSpectroscopy", - "definition_id": "5c3b207f2a4037048153552df6506dea1a8e42bb", + "definition_id": "cc6f99a3291cf2333e30aab300f1ccd793321337", "used_directly": true } ], @@ -1768,7 +2527,7 @@ "id": "data.datetime#nomad_unisyscat.schema_packages.mypackage.NRVSpectroscopy", "definition": "nomad.datamodel.metainfo.basesections.Activity.datetime", "path_archive": "data.datetime", - "datetime_value": "2024-05-28T21:08:47.123017+00:00" + "datetime_value": "2024-05-29T13:52:14.690498+00:00" } ] }, diff --git a/src/nomad_unisyscat/schema_packages/mypackage.py b/src/nomad_unisyscat/schema_packages/mypackage.py index 1ec5d39..69712ab 100644 --- a/src/nomad_unisyscat/schema_packages/mypackage.py +++ b/src/nomad_unisyscat/schema_packages/mypackage.py @@ -6,17 +6,12 @@ import numpy as np if TYPE_CHECKING: - from nomad.datamodel.datamodel import ( - EntryArchive, - ) - from structlog.stdlib import ( - BoundLogger, - ) + pass import plotly.express as px from nomad.config import config from nomad.datamodel.data import Schema -from nomad.datamodel.metainfo.annotations import ELNAnnotation, ELNComponentEnum +from nomad.datamodel.metainfo.annotations import ELNAnnotation from nomad.datamodel.metainfo.basesections import Measurement, MeasurementResult from nomad.datamodel.metainfo.plot import PlotlyFigure, PlotSection from nomad.metainfo import Quantity, SchemaPackage, Section @@ -112,9 +107,12 @@ def normalize(self, archive, logger): col_names = ['wavenumber, cm-1', '57Fe PVDOS'] data = pd.read_csv(f.name, header=None, names=col_names) - - self.results.wavenumber = data['wavenumber, cm-1'] - self.results.intensity = data['57Fe PVDOS'] + result = NRVSResult() + result.wavenumber = data['wavenumber, cm-1'] + result.intensity = data['57Fe PVDOS'] + results = [] + results.append(result) + self.results = results self.figures = [] @@ -123,4 +121,5 @@ def normalize(self, archive, logger): fig.update_yaxes(title_text=col_names[1]) self.figures.append(PlotlyFigure(label='NRVS', figure=fig.to_plotly_json())) + m_package.__init_metainfo__()