diff --git a/pygui/ETC/.gitignore b/pygui/ETC/.gitignore new file mode 100644 index 00000000..3c4ae657 --- /dev/null +++ b/pygui/ETC/.gitignore @@ -0,0 +1,8 @@ +.* +!.gitignore +*.png +__pycache__/ +sources/current_calspec_all/* +old/ +skybrightness/ +scratch/ diff --git a/pygui/ETC/CSV/QE-LBNL-CCD-blue.csv b/pygui/ETC/CSV/QE-LBNL-CCD-blue.csv deleted file mode 100644 index f9c21516..00000000 --- a/pygui/ETC/CSV/QE-LBNL-CCD-blue.csv +++ /dev/null @@ -1,742 +0,0 @@ -Wavelength (nm),Blue QE -310,0.434667605 -311,0.437895211 -312,0.441300214 -313,0.444793043 -314,0.448285872 -315,0.4517787 -316,0.455271529 -317,0.458764358 -318,0.462195307 -319,0.465543252 -320,0.468891196 -321,0.472239141 -322,0.475587086 -323,0.47893503 -324,0.482282975 -325,0.485733862 -326,0.489204564 -327,0.492675266 -328,0.496145968 -329,0.49961667 -330,0.503087373 -331,0.506558075 -332,0.510028777 -333,0.513499479 -334,0.517349601 -335,0.521281485 -336,0.52521337 -337,0.529145254 -338,0.533077139 -339,0.537009024 -340,0.540981195 -341,0.545085105 -342,0.549189014 -343,0.553292924 -344,0.557396834 -345,0.561500744 -346,0.566262491 -347,0.571131914 -348,0.576001338 -349,0.580870762 -350,0.58647176 -351,0.592389029 -352,0.598306299 -353,0.604223568 -354,0.60993593 -355,0.615289677 -356,0.620643424 -357,0.625997171 -358,0.632875662 -359,0.64033949 -360,0.647803318 -361,0.655267146 -362,0.661268005 -363,0.667120972 -364,0.672973938 -365,0.678826904 -366,0.687462172 -367,0.696338066 -368,0.70364005 -369,0.709323755 -370,0.715007459 -371,0.720639571 -372,0.72606374 -373,0.731487909 -374,0.738413445 -375,0.746348009 -376,0.752071301 -377,0.756805112 -378,0.761538923 -379,0.76619169 -380,0.770562417 -381,0.774933143 -382,0.77930387 -383,0.783638421 -384,0.787920657 -385,0.792202894 -386,0.796356619 -387,0.799516977 -388,0.802677334 -389,0.805837692 -390,0.808976114 -391,0.812063388 -392,0.815150662 -393,0.818237936 -394,0.821178399 -395,0.823795654 -396,0.826412908 -397,0.829030163 -398,0.831647417 -399,0.834063289 -400,0.836430197 -401,0.838797105 -402,0.841164014 -403,0.843530922 -404,0.845897831 -405,0.847930118 -406,0.849842403 -407,0.851754687 -408,0.853666972 -409,0.855579256 -410,0.857491541 -411,0.859403825 -412,0.861149946 -413,0.862797372 -414,0.864444798 -415,0.866092224 -416,0.86773965 -417,0.869387076 -418,0.871034502 -419,0.872681928 -420,0.873820611 -421,0.87495856 -422,0.87609651 -423,0.877234459 -424,0.878372408 -425,0.879510358 -426,0.880638328 -427,0.881734108 -428,0.882829889 -429,0.88392567 -430,0.88502145 -431,0.885946847 -432,0.886735816 -433,0.887524786 -434,0.888313756 -435,0.889102726 -436,0.889891695 -437,0.890680665 -438,0.891469635 -439,0.892180711 -440,0.892866255 -441,0.893551799 -442,0.894237343 -443,0.894922887 -444,0.895608431 -445,0.896293975 -446,0.896810093 -447,0.897232749 -448,0.897655405 -449,0.89807806 -450,0.898500716 -451,0.898923372 -452,0.899346027 -453,0.89967378 -454,0.899834583 -455,0.899995387 -456,0.90015619 -457,0.900316993 -458,0.900477797 -459,0.9006386 -460,0.900799403 -461,0.900914826 -462,0.90095832 -463,0.901001815 -464,0.90104531 -465,0.901088804 -466,0.901132299 -467,0.901109856 -468,0.901019293 -469,0.900928729 -470,0.900838166 -471,0.900747603 -472,0.90065704 -473,0.900566477 -474,0.900475914 -475,0.900385351 -476,0.900214973 -477,0.900044285 -478,0.899873597 -479,0.899702909 -480,0.899532221 -481,0.899361533 -482,0.899190845 -483,0.899020157 -484,0.898849469 -485,0.898271518 -486,0.897685366 -487,0.897099214 -488,0.896513062 -489,0.895926909 -490,0.895340757 -491,0.894754605 -492,0.894168452 -493,0.8935823 -494,0.893069753 -495,0.892576653 -496,0.892083553 -497,0.891590453 -498,0.891097352 -499,0.890604252 -500,0.890111152 -501,0.889618052 -502,0.889124952 -503,0.888631852 -504,0.887914819 -505,0.88717516 -506,0.886435501 -507,0.885695841 -508,0.884956182 -509,0.884216523 -510,0.883476863 -511,0.882737204 -512,0.881997545 -513,0.881257885 -514,0.880518226 -515,0.87991839 -516,0.879350976 -517,0.878783562 -518,0.878216147 -519,0.877648733 -520,0.877081319 -521,0.876513905 -522,0.87594649 -523,0.875379076 -524,0.874811662 -525,0.874244247 -526,0.873676833 -527,0.873106945 -528,0.872523555 -529,0.871940166 -530,0.871356776 -531,0.870773387 -532,0.870189997 -533,0.869606608 -534,0.869023219 -535,0.868439829 -536,0.86785644 -537,0.86727305 -538,0.866689661 -539,0.866106271 -540,0.865435498 -541,0.864748665 -542,0.864061833 -543,0.863375 -544,0.862688167 -545,0.862001335 -546,0.861314502 -547,0.860627669 -548,0.859940837 -549,0.859254004 -550,0.858567171 -551,0.857880339 -552,0.857193506 -553,0.856506673 -554,0.855801918 -555,0.855051225 -556,0.854300532 -557,0.853549839 -558,0.852799146 -559,0.852048453 -560,0.85129776 -561,0.850547067 -562,0.849796374 -563,0.849045681 -564,0.848294988 -565,0.847544295 -566,0.846800927 -567,0.846061265 -568,0.845321602 -569,0.844581939 -570,0.843842277 -571,0.843102614 -572,0.842362952 -573,0.841623289 -574,0.840883626 -575,0.840143964 -576, -577, -578, -579, -580, -581, -582, -583, -584, -585, -586, -587, -588, -589, -590, -591, -592, -593, -594, -595, -596, -597, -598, -599, -600, -601, -602, -603, -604, -605, -606, -607, -608, -609, -610, -611, -612, -613, -614, -615, -616, -617, -618, -619, -620, -621, -622, -623, -624, -625, -626, -627, -628, -629, -630, -631, -632, -633, -634, -635, -636, -637, -638, -639, -640, -641, -642, -643, -644, -645, -646, -647, -648, -649, -650, -651, -652, -653, -654, -655, -656, -657, -658, -659, -660, -661, -662, -663, -664, -665, -666, -667, -668, -669, -670, -671, -672, -673, -674, -675, -676, -677, -678, -679, -680, -681, -682, -683, -684, -685, -686, -687, -688, -689, -690, -691, -692, -693, -694, -695, -696, -697, -698, -699, -700, -701, -702, -703, -704, -705, -706, -707, -708, -709, -710, -711, -712, -713, -714, -715, -716, -717, -718, -719, -720, -721, -722, -723, -724, -725, -726, -727, -728, -729, -730, -731, -732, -733, -734, -735, -736, -737, -738, -739, -740, -741, -742, -743, -744, -745, -746, -747, -748, -749, -750, -751, -752, -753, -754, -755, -756, -757, -758, -759, -760, -761, -762, -763, -764, -765, -766, -767, -768, -769, -770, -771, -772, -773, -774, -775, -776, -777, -778, -779, -780, -781, -782, -783, -784, -785, -786, -787, -788, -789, -790, -791, -792, -793, -794, -795, -796, -797, -798, -799, -800, -801, -802, -803, -804, -805, -806, -807, -808, -809, -810, -811, -812, -813, -814, -815, -816, -817, -818, -819, -820, -821, -822, -823, -824, -825, -826, -827, -828, -829, -830, -831, -832, -833, -834, -835, -836, -837, -838, -839, -840, -841, -842, -843, -844, -845, -846, -847, -848, -849, -850, -851, -852, -853, -854, -855, -856, -857, -858, -859, -860, -861, -862, -863, -864, -865, -866, -867, -868, -869, -870, -871, -872, -873, -874, -875, -876, -877, -878, -879, -880, -881, -882, -883, -884, -885, -886, -887, -888, -889, -890, -891, -892, -893, -894, -895, -896, -897, -898, -899, -900, -901, -902, -903, -904, -905, -906, -907, -908, -909, -910, -911, -912, -913, -914, -915, -916, -917, -918, -919, -920, -921, -922, -923, -924, -925, -926, -927, -928, -929, -930, -931, -932, -933, -934, -935, -936, -937, -938, -939, -940, -941, -942, -943, -944, -945, -946, -947, -948, -949, -950, -951, -952, -953, -954, -955, -956, -957, -958, -959, -960, -961, -962, -963, -964, -965, -966, -967, -968, -969, -970, -971, -972, -973, -974, -975, -976, -977, -978, -979, -980, -981, -982, -983, -984, -985, -986, -987, -988, -989, -990, -991, -992, -993, -994, -995, -996, -997, -998, -999, -1000, -1001, -1002, -1003, -1004, -1005, -1006, -1007, -1008, -1009, -1010, -1011, -1012, -1013, -1014, -1015, -1016, -1017, -1018, -1019, -1020, -1021, -1022, -1023, -1024, -1025, -1026, -1027, -1028, -1029, -1030, -1031, -1032, -1033, -1034, -1035, -1036, -1037, -1038, -1039, -1040, -1041, -1042, -1043, -1044, -1045, -1046, -1047, -1048, -1049, -1050, \ No newline at end of file diff --git a/pygui/ETC/CSV/QE-LBNL-CCD-red.csv b/pygui/ETC/CSV/QE-LBNL-CCD-red.csv deleted file mode 100644 index 2ab7a9d6..00000000 --- a/pygui/ETC/CSV/QE-LBNL-CCD-red.csv +++ /dev/null @@ -1,742 +0,0 @@ -Wavelength (nm),Red QE -310, -311, -312, -313, -314, -315, -316, -317, -318, -319, -320, -321, -322, -323, -324, -325, -326, -327, -328, -329, -330, -331, -332, -333, -334, -335, -336, -337, -338, -339, -340, -341,0.0834 -342,0.0876 -343,0.0917 -344,0.0959 -345,0.1 -346,0.1042 -347,0.1084 -348,0.1125 -349,0.1167 -350,0.1208 -351,0.125 -352,0.1292 -353,0.1333 -354,0.1375 -355,0.1416 -356,0.1458 -357,0.15 -358,0.1541 -359,0.1583 -360,0.1624 -361,0.1727 -362,0.1832 -363,0.1936 -364,0.2041 -365,0.2146 -366,0.225 -367,0.2355 -368,0.246 -369,0.2564 -370,0.2669 -371,0.2774 -372,0.2878 -373,0.2983 -374,0.3088 -375,0.3192 -376,0.3297 -377,0.3401 -378,0.3506 -379,0.3611 -380,0.371 -381,0.3769 -382,0.3828 -383,0.3887 -384,0.3946 -385,0.4005 -386,0.4064 -387,0.4123 -388,0.4182 -389,0.4241 -390,0.43 -391,0.4359 -392,0.4418 -393,0.4477 -394,0.4536 -395,0.4595 -396,0.4654 -397,0.4713 -398,0.4772 -399,0.4831 -400,0.489 -401,0.4949 -402,0.5007 -403,0.5055 -404,0.5101 -405,0.5147 -406,0.5194 -407,0.524 -408,0.5287 -409,0.5333 -410,0.538 -411,0.5426 -412,0.5473 -413,0.5519 -414,0.5565 -415,0.5612 -416,0.5658 -417,0.5705 -418,0.5751 -419,0.5798 -420,0.5844 -421,0.5869 -422,0.5892 -423,0.5915 -424,0.5939 -425,0.5962 -426,0.5985 -427,0.6008 -428,0.6031 -429,0.6055 -430,0.6078 -431,0.6101 -432,0.6124 -433,0.6148 -434,0.6171 -435,0.6194 -436,0.6217 -437,0.624 -438,0.6264 -439,0.6287 -440,0.631 -441,0.6333 -442,0.6355 -443,0.6375 -444,0.6394 -445,0.6414 -446,0.6433 -447,0.6453 -448,0.6472 -449,0.6492 -450,0.6511 -451,0.6531 -452,0.655 -453,0.657 -454,0.6589 -455,0.6609 -456,0.6628 -457,0.6648 -458,0.6667 -459,0.6687 -460,0.6706 -461,0.6719 -462,0.6733 -463,0.6746 -464,0.676 -465,0.6774 -466,0.6787 -467,0.6801 -468,0.6815 -469,0.6828 -470,0.6842 -471,0.6855 -472,0.6869 -473,0.6883 -474,0.6896 -475,0.691 -476,0.6924 -477,0.6937 -478,0.6951 -479,0.6965 -480,0.6978 -481,0.6992 -482,0.7005 -483,0.7024 -484,0.7042 -485,0.706 -486,0.7078 -487,0.7096 -488,0.7115 -489,0.7133 -490,0.7151 -491,0.7169 -492,0.7188 -493,0.7206 -494,0.7224 -495,0.7242 -496,0.7261 -497,0.7279 -498,0.7297 -499,0.7315 -500,0.7331 -501,0.7341 -502,0.7352 -503,0.7363 -504,0.7374 -505,0.7385 -506,0.7396 -507,0.7407 -508,0.7418 -509,0.7429 -510,0.744 -511,0.7451 -512,0.7462 -513,0.7473 -514,0.7484 -515,0.7495 -516,0.7506 -517,0.7517 -518,0.7528 -519,0.7539 -520,0.755 -521,0.7567 -522,0.7584 -523,0.7602 -524,0.7619 -525,0.7636 -526,0.7654 -527,0.7671 -528,0.7689 -529,0.7706 -530,0.7723 -531,0.7741 -532,0.7758 -533,0.7776 -534,0.7793 -535,0.7811 -536,0.7828 -537,0.7845 -538,0.7863 -539,0.788 -540,0.7896 -541,0.7906 -542,0.7916 -543,0.7925 -544,0.7935 -545,0.7945 -546,0.7954 -547,0.7964 -548,0.7974 -549,0.7984 -550,0.7993 -551,0.8003 -552,0.8013 -553,0.8022 -554,0.8032 -555,0.8042 -556,0.8051 -557,0.8061 -558,0.8071 -559,0.808 -560,0.809 -561,0.8103 -562,0.812 -563,0.8136 -564,0.8152 -565,0.8168 -566,0.8184 -567,0.8201 -568,0.8217 -569,0.8233 -570,0.8249 -571,0.8265 -572,0.8281 -573,0.8298 -574,0.8314 -575,0.833 -576,0.8346 -577,0.8362 -578,0.8378 -579,0.8395 -580,0.8411 -581,0.8422 -582,0.8432 -583,0.8442 -584,0.8453 -585,0.8463 -586,0.8473 -587,0.8483 -588,0.8493 -589,0.8504 -590,0.8514 -591,0.8524 -592,0.8534 -593,0.8544 -594,0.8555 -595,0.8565 -596,0.8575 -597,0.8585 -598,0.8596 -599,0.8606 -600,0.8616 -601,0.8625 -602,0.8635 -603,0.8644 -604,0.8654 -605,0.8664 -606,0.8673 -607,0.8683 -608,0.8692 -609,0.8702 -610,0.8712 -611,0.8721 -612,0.8731 -613,0.8741 -614,0.875 -615,0.876 -616,0.8769 -617,0.8779 -618,0.8789 -619,0.8798 -620,0.8808 -621,0.8818 -622,0.8828 -623,0.8838 -624,0.8848 -625,0.8858 -626,0.8868 -627,0.8878 -628,0.8888 -629,0.8898 -630,0.8908 -631,0.8918 -632,0.8928 -633,0.8939 -634,0.8949 -635,0.8959 -636,0.8969 -637,0.8979 -638,0.8989 -639,0.8999 -640,0.9009 -641,0.9016 -642,0.9022 -643,0.9029 -644,0.9035 -645,0.9041 -646,0.9048 -647,0.9054 -648,0.906 -649,0.9067 -650,0.9073 -651,0.908 -652,0.9086 -653,0.9092 -654,0.9099 -655,0.9105 -656,0.9111 -657,0.9118 -658,0.9124 -659,0.913 -660,0.9137 -661,0.9144 -662,0.9152 -663,0.9159 -664,0.9167 -665,0.9174 -666,0.9182 -667,0.9189 -668,0.9197 -669,0.9204 -670,0.9212 -671,0.922 -672,0.9227 -673,0.9235 -674,0.9242 -675,0.925 -676,0.9257 -677,0.9265 -678,0.9272 -679,0.928 -680,0.9285 -681,0.9287 -682,0.9289 -683,0.9291 -684,0.9292 -685,0.9294 -686,0.9296 -687,0.9298 -688,0.93 -689,0.9301 -690,0.9303 -691,0.9305 -692,0.9307 -693,0.9309 -694,0.931 -695,0.9312 -696,0.9314 -697,0.9316 -698,0.9318 -699,0.9319 -700,0.9321 -701,0.9326 -702,0.9332 -703,0.9338 -704,0.9343 -705,0.9349 -706,0.9355 -707,0.936 -708,0.9366 -709,0.9372 -710,0.9377 -711,0.9383 -712,0.9389 -713,0.9394 -714,0.94 -715,0.9406 -716,0.9411 -717,0.9417 -718,0.9423 -719,0.9428 -720,0.9433 -721,0.9437 -722,0.944 -723,0.9443 -724,0.9446 -725,0.945 -726,0.9453 -727,0.9456 -728,0.946 -729,0.9463 -730,0.9466 -731,0.947 -732,0.9473 -733,0.9476 -734,0.948 -735,0.9483 -736,0.9486 -737,0.949 -738,0.9493 -739,0.9496 -740,0.95 -741,0.9501 -742,0.9502 -743,0.9503 -744,0.9504 -745,0.9505 -746,0.9506 -747,0.9507 -748,0.9508 -749,0.9509 -750,0.951 -751,0.9511 -752,0.9512 -753,0.9513 -754,0.9514 -755,0.9515 -756,0.9516 -757,0.9517 -758,0.9518 -759,0.9519 -760,0.952 -761,0.9522 -762,0.9525 -763,0.9528 -764,0.9531 -765,0.9534 -766,0.9536 -767,0.9539 -768,0.9542 -769,0.9545 -770,0.9548 -771,0.9551 -772,0.9553 -773,0.9556 -774,0.9559 -775,0.9562 -776,0.9565 -777,0.9568 -778,0.9571 -779,0.9573 -780,0.9576 -781,0.9575 -782,0.9573 -783,0.9571 -784,0.9569 -785,0.9568 -786,0.9566 -787,0.9564 -788,0.9562 -789,0.956 -790,0.9558 -791,0.9556 -792,0.9554 -793,0.9552 -794,0.9551 -795,0.9549 -796,0.9547 -797,0.9545 -798,0.9543 -799,0.9541 -800,0.9539 -801,0.9538 -802,0.9538 -803,0.9537 -804,0.9536 -805,0.9535 -806,0.9534 -807,0.9533 -808,0.9532 -809,0.9531 -810,0.953 -811,0.9529 -812,0.9528 -813,0.9527 -814,0.9526 -815,0.9525 -816,0.9524 -817,0.9523 -818,0.9522 -819,0.9521 -820,0.952 -821,0.952 -822,0.952 -823,0.952 -824,0.952 -825,0.952 -826,0.952 -827,0.952 -828,0.952 -829,0.952 -830,0.952 -831,0.952 -832,0.952 -833,0.952 -834,0.952 -835,0.952 -836,0.952 -837,0.952 -838,0.952 -839,0.952 -840,0.952 -841,0.9519 -842,0.9516 -843,0.9514 -844,0.9512 -845,0.951 -846,0.9507 -847,0.9505 -848,0.9503 -849,0.9501 -850,0.9498 -851,0.9496 -852,0.9494 -853,0.9492 -854,0.949 -855,0.9487 -856,0.9485 -857,0.9483 -858,0.9481 -859,0.9478 -860,0.9476 -861,0.9475 -862,0.9475 -863,0.9474 -864,0.9473 -865,0.9472 -866,0.9472 -867,0.9471 -868,0.947 -869,0.9469 -870,0.9469 -871,0.9468 -872,0.9467 -873,0.9467 -874,0.9466 -875,0.9465 -876,0.9464 -877,0.9464 -878,0.9463 -879,0.9462 -880,0.9462 -881,0.9457 -882,0.9451 -883,0.9445 -884,0.9439 -885,0.9433 -886,0.9427 -887,0.9421 -888,0.9415 -889,0.9409 -890,0.9403 -891,0.9397 -892,0.9391 -893,0.9385 -894,0.9379 -895,0.9373 -896,0.9367 -897,0.9361 -898,0.9355 -899,0.9349 -900,0.9342 -901,0.9328 -902,0.9315 -903,0.9302 -904,0.9289 -905,0.9275 -906,0.9262 -907,0.9249 -908,0.9236 -909,0.9223 -910,0.9209 -911,0.9196 -912,0.9183 -913,0.917 -914,0.9157 -915,0.9143 -916,0.913 -917,0.9117 -918,0.9104 -919,0.9087 -920,0.9069 -921,0.9051 -922,0.9033 -923,0.9015 -924,0.8997 -925,0.8979 -926,0.8962 -927,0.8944 -928,0.8926 -929,0.8908 -930,0.889 -931,0.8872 -932,0.8854 -933,0.8836 -934,0.8818 -935,0.88 -936,0.8782 -937,0.8764 -938,0.8746 -939,0.8728 -940,0.8706 -941,0.8675 -942,0.8644 -943,0.8613 -944,0.8583 -945,0.8552 -946,0.8521 -947,0.849 -948,0.8459 -949,0.8428 -950,0.8397 -951,0.8366 -952,0.8336 -953,0.8305 -954,0.8274 -955,0.8243 -956,0.8212 -957,0.8181 -958,0.815 -959,0.8119 -960,0.8088 -961,0.8032 -962,0.7965 -963,0.7898 -964,0.7831 -965,0.7763 -966,0.7696 -967,0.7629 -968,0.7562 -969,0.7494 -970,0.7427 -971,0.736 -972,0.7293 -973,0.7225 -974,0.7158 -975,0.7091 -976,0.7024 -977,0.6956 -978,0.6889 -979,0.6822 -980,0.6755 -981,0.6674 -982,0.6584 -983,0.6494 -984,0.6404 -985,0.6314 -986,0.6224 -987,0.6134 -988,0.6044 -989,0.5954 -990,0.5864 -991,0.5774 -992,0.5685 -993,0.5595 -994,0.5505 -995,0.5415 -996,0.5325 -997,0.5235 -998,0.5145 -999,0.5055 -1000,0.4964 -1001,0.4858 -1002,0.4753 -1003,0.4648 -1004,0.4543 -1005,0.4438 -1006,0.4333 -1007,0.4228 -1008,0.4123 -1009,0.4018 -1010,0.3913 -1011,0.3807 -1012,0.3702 -1013,0.3597 -1014,0.3492 -1015,0.3387 -1016,0.3282 -1017,0.3177 -1018,0.3072 -1019,0.2967 -1020,0.2861 -1021,0.2763 -1022,0.2669 -1023,0.2576 -1024,0.2483 -1025,0.2389 -1026,0.2296 -1027,0.2203 -1028,0.211 -1029,0.2016 -1030,0.1923 -1031,0.183 -1032,0.1737 -1033,0.1643 -1034,0.155 -1035,0.1457 -1036,0.1364 -1037,0.127 -1038,0.1177 -1039,0.1084 -1040,0.0997 -1041,0.097 -1042,0.0943 -1043,0.0916 -1044,0.0889 -1045,0.0862 -1046,0.0835 -1047,0.0808 -1048,0.0781 -1049,0.0754 -1050,0.0727 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-NGPS-spectrograph-G.csv b/pygui/ETC/CSV/throughput-NGPS-spectrograph-G.csv deleted file mode 100644 index 1f6c80ed..00000000 --- a/pygui/ETC/CSV/throughput-NGPS-spectrograph-G.csv +++ /dev/null @@ -1,754 +0,0 @@ -# Based on MODELS of NGPS spectrograph optics: dichroics, collimator, gratings, camera", -# Does NOT include losses from slit and slicer, -Wavelength (nm),G -300, -301, -302, -303, -304, -305, -306, -307, -308, -309, -310,0 -311,0 -312,0 -313,0 -314,0 -315,0 -316,0 -317,0 -318,0 -319,0 -320,0 -321,0 -322,0 -323,0 -324,0 -325,0 -326,0 -327,0 -328,0 -329,0 -330,0 -331,0 -332,0 -333,0 -334,0 -335,0 -336,0 -337,0 -338,0 -339,0 -340,0 -341,0 -342,0 -343,0 -344,0 -345,0 -346,0 -347,0 -348,0 -349,0 -350,0 -351,0 -352,0 -353,0 -354,0 -355,0 -356,0 -357,0 -358,0 -359,0 -360,0 -361,0 -362,0 -363,0 -364,0 -365,0 -366,0 -367,0 -368,0 -369,0 -370,0 -371,0 -372,0 -373,0 -374,0 -375,0 -376,0 -377,0 -378,0 -379,0 -380,0 -381,0 -382,0 -383,0 -384,0 -385,0 -386,0 -387,0 -388,0 -389,0 -390,0 -391,0 -392,0 -393,0 -394,0 -395,0 -396,0 -397,0 -398,0 -399,0 -400,0 -401,0 -402,0 -403,0 -404,0 -405,0 -406,0 -407,0 -408,0 -409,0 -410,0 -411,0 -412,0 -413,0 -414,0 -415,0 -416,0 -417,0.027976472 -418,0.056740609 -419,0.109199322 -420,0.174949179 -421,0.219993355 -422,0.238836142 -423,0.250608037 -424,0.266397095 -425,0.28734428 -426,0.309678353 -427,0.328064244 -428,0.338901546 -429,0.342373982 -430,0.341643664 -431,0.340671522 -432,0.343262181 -433,0.355151612 -434,0.392595286 -435,0.511252471 -436,0.674340149 -437,0.70594771 -438,0.690929653 -439,0.692279977 -440,0.703894335 -441,0.714000388 -442,0.717988517 -443,0.71861268 -444,0.720467254 -445,0.725806996 -446,0.733925951 -447,0.742357523 -448,0.74854023 -449,0.751205252 -450,0.750839164 -451,0.749842831 -452,0.749061678 -453,0.749508371 -454,0.751766531 -455,0.755940297 -456,0.761687646 -457,0.768316146 -458,0.774942404 -459,0.780701445 -460,0.7849609 -461,0.787466404 -462,0.788365295 -463,0.788115525 -464,0.787328757 -465,0.786615016 -466,0.78647151 -467,0.787222272 -468,0.788996286 -469,0.791728854 -470,0.795193885 -471,0.799045834 -472,0.802816526 -473,0.806151186 -474,0.808857357 -475,0.810830562 -476,0.812124511 -477,0.812917009 -478,0.813454076 -479,0.813989756 -480,0.814792812 -481,0.816161373 -482,0.818082916 -483,0.820492171 -484,0.823302603 -485,0.826355358 -486,0.829437812 -487,0.832315756 -488,0.834768985 -489,0.836624747 -490,0.837784581 -491,0.838238837 -492,0.838064542 -493,0.837408658 -494,0.836459339 -495,0.835411738 -496,0.834430124 -497,0.833599035 -498,0.832845097 -499,0.832123461 -500,0.832667051 -501,0.83431499 -502,0.835879928 -503,0.83728082 -504,0.838484629 -505,0.839390193 -506,0.839884521 -507,0.83987871 -508,0.839328558 -509,0.838244476 -510,0.836694098 -511,0.834793811 -512,0.832692229 -513,0.830549128 -514,0.828506691 -515,0.826632921 -516,0.824964023 -517,0.823444915 -518,0.821192059 -519,0.815654942 -520,0.798109292 -521,0.793223628 -522,0.813294307 -523,0.821870242 -524,0.825841262 -525,0.828131992 -526,0.829534968 -527,0.830278912 -528,0.830430823 -529,0.83001405 -530,0.829048464 -531,0.827563009 -532,0.825593263 -533,0.823156284 -534,0.819936172 -535,0.815733956 -536,0.813597669 -537,0.809618146 -538,0.804819835 -539,0.798931341 -540,0.791725075 -541,0.783739588 -542,0.777112902 -543,0.774311524 -544,0.775126323 -545,0.777331342 -546,0.779288889 -547,0.780432306 -548,0.780717467 -549,0.780232163 -550,0.77905228 -551,0.777225803 -552,0.774765877 -553,0.771654542 -554,0.767840453 -555,0.76323056 -556,0.757606364 -557,0.750587714 -558,0.742037654 -559,0.731417517 -560,0.717929135 -561,0.700424398 -562,0.677344521 -563,0.64681759 -564,0.607201126 -565,0.55844546 -566,0.504138562 -567,0.452712661 -568,0.415379925 -569,0.397592669 -570,0.394531354 -571,0.398729638 -572,0.404605887 -573,0.40896374 -574,0.410386809 -575,0.408522629 -576,0.400086125 -577,0.393213276 -578,0.3844371 -579,0.374382339 -580,0.363543925 -581,0.352099993 -582,0.339694738 -583,0.325148564 -584,0.306079115 -585,0.278483456 -586,0.236846101 -587,0.176920454 -588,0.104294187 -589,0.041322877 -590,0.009916995 -591,0 -592,0 -593,0 -594,0 -595,0 -596,0 -597,0 -598,0 -599,0 -600,0 -601,0 -602,0 -603,0 -604,0 -605,0 -606,0 -607,0 -608,0 -609,0 -610,0 -611,0 -612,0 -613,0 -614,0 -615,0 -616,0 -617,0 -618,0 -619,0 -620,0 -621,0 -622,0 -623,0 -624,0 -625,0 -626,0 -627,0 -628,0 -629,0 -630,0 -631,0 -632,0 -633,0 -634,0 -635,0 -636,0 -637,0 -638,0 -639,0 -640,0 -641,0 -642,0 -643,0 -644,0 -645,0 -646,0 -647,0 -648,0 -649,0 -650,0 -651,0 -652,0 -653,0 -654,0 -655,0 -656,0 -657,0 -658,0 -659,0 -660,0 -661,0 -662,0 -663,0 -664,0 -665,0 -666,0 -667,0 -668,0 -669,0 -670,0 -671,0 -672,0 -673,0 -674,0 -675,0 -676,0 -677,0 -678,0 -679,0 -680,0 -681,0 -682,0 -683,0 -684,0 -685,0 -686,0 -687,0 -688,0 -689,0 -690,0 -691,0 -692,0 -693,0 -694,0 -695,0 -696,0 -697,0 -698,0 -699,0 -700,0 -701,0 -702,0 -703,0 -704,0 -705,0 -706,0 -707,0 -708,0 -709,0 -710,0 -711,0 -712,0 -713,0 -714,0 -715,0 -716,0 -717,0 -718,0 -719,0 -720,0 -721,0 -722,0 -723,0 -724,0 -725,0 -726,0 -727,0 -728,0 -729,0 -730,0 -731,0 -732,0 -733,0 -734,0 -735,0 -736,0 -737,0 -738,0 -739,0 -740,0 -741,0 -742,0 -743,0 -744,0 -745,0 -746,0 -747,0 -748,0 -749,0 -750,0 -751,0 -752,0 -753,0 -754,0 -755,0 -756,0 -757,0 -758,0 -759,0 -760,0 -761,0 -762,0 -763,0 -764,0 -765,0 -766,0 -767,0 -768,0 -769,0 -770,0 -771,0 -772,0 -773,0 -774,0 -775,0 -776,0 -777,0 -778,0 -779,0 -780,0 -781,0 -782,0 -783,0 -784,0 -785,0 -786,0 -787,0 -788,0 -789,0 -790,0 -791,0 -792,0 -793,0 -794,0 -795,0 -796,0 -797,0 -798,0 -799,0 -800,0 -801,0 -802,0 -803,0 -804,0 -805,0 -806,0 -807,0 -808,0 -809,0 -810,0 -811,0 -812,0 -813,0 -814,0 -815,0 -816,0 -817,0 -818,0 -819,0 -820,0 -821,0 -822,0 -823,0 -824,0 -825,0 -826,0 -827,0 -828,0 -829,0 -830,0 -831,0 -832,0 -833,0 -834,0 -835,0 -836,0 -837,0 -838,0 -839,0 -840,0 -841,0 -842,0 -843,0 -844,0 -845,0 -846,0 -847,0 -848,0 -849,0 -850,0 -851,0 -852,0 -853,0 -854,0 -855,0 -856,0 -857,0 -858,0 -859,0 -860,0 -861,0 -862,0 -863,0 -864,0 -865,0 -866,0 -867,0 -868,0 -869,0 -870,0 -871,0 -872,0 -873,0 -874,0 -875,0 -876,0 -877,0 -878,0 -879,0 -880,0 -881,0 -882,0 -883,0 -884,0 -885,0 -886,0 -887,0 -888,0 -889,0 -890,0 -891,0 -892,0 -893,0 -894,0 -895,0 -896,0 -897,0 -898,0 -899,0 -900,0 -901,0 -902,0 -903,0 -904,0 -905,0 -906,0 -907,0 -908,0 -909,0 -910,0 -911,0 -912,0 -913,0 -914,0 -915,0 -916,0 -917,0 -918,0 -919,0 -920,0 -921,0 -922,0 -923,0 -924,0 -925,0 -926,0 -927,0 -928,0 -929,0 -930,0 -931,0 -932,0 -933,0 -934,0 -935,0 -936,0 -937,0 -938,0 -939,0 -940,0 -941,0 -942,0 -943,0 -944,0 -945,0 -946,0 -947,0 -948,0 -949,0 -950,0 -951,0 -952,0 -953,0 -954,0 -955,0 -956,0 -957,0 -958,0 -959,0 -960,0 -961,0 -962,0 -963,0 -964,0 -965,0 -966,0 -967,0 -968,0 -969,0 -970,0 -971,0 -972,0 -973,0 -974,0 -975,0 -976,0 -977,0 -978,0 -979,0 -980,0 -981,0 -982,0 -983,0 -984,0 -985,0 -986,0 -987,0 -988,0 -989,0 -990,0 -991,0 -992,0 -993,0 -994,0 -995,0 -996,0 -997,0 -998,0 -999,0 -1000,0 -1001,0 -1002,0 -1003,0 -1004,0 -1005,0 -1006,0 -1007,0 -1008,0 -1009,0 -1010,0 -1011,0 -1012,0 -1013,0 -1014,0 -1015,0 -1016,0 -1017,0 -1018,0 -1019,0 -1020,0 -1021,0 -1022,0 -1023,0 -1024,0 -1025,0 -1026,0 -1027,0 -1028,0 -1029,0 -1030,0 -1031,0 -1032,0 -1033,0 -1034,0 -1035,0 -1036,0 -1037,0 -1038,0 -1039,0 -1040,0 -1041,0 -1042,0 -1043,0 -1044,0 -1045,0 -1046,0 -1047,0 -1048,0 -1049,0 -1050,0 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-NGPS-spectrograph-I.csv b/pygui/ETC/CSV/throughput-NGPS-spectrograph-I.csv deleted file mode 100644 index ee68eb7f..00000000 --- a/pygui/ETC/CSV/throughput-NGPS-spectrograph-I.csv +++ /dev/null @@ -1,754 +0,0 @@ -# Based on MODELS of NGPS spectrograph optics: dichroics, collimator, gratings, camera", -# Does NOT include losses from slit and slicer, -Wavelength (nm),I -300, -301, -302, -303, -304, -305, -306, -307, -308, -309, -310,0 -311,0 -312,0 -313,0 -314,0 -315,0 -316,0 -317,0 -318,0 -319,0 -320,0 -321,0 -322,0 -323,0 -324,0 -325,0 -326,0 -327,0 -328,0 -329,0 -330,0 -331,0 -332,0 -333,0 -334,0 -335,0 -336,0 -337,0 -338,0 -339,0 -340,0 -341,0 -342,0 -343,0 -344,0 -345,0 -346,0 -347,0 -348,0 -349,0 -350,0 -351,0 -352,0 -353,0 -354,0 -355,0 -356,0 -357,0 -358,0 -359,0 -360,0 -361,0 -362,0 -363,0 -364,0 -365,0 -366,0 -367,0 -368,0 -369,0 -370,0 -371,0 -372,0 -373,0 -374,0 -375,0 -376,0 -377,0 -378,0 -379,0 -380,0 -381,0 -382,0 -383,0 -384,0 -385,0 -386,0 -387,0 -388,0 -389,0 -390,0 -391,0 -392,0 -393,0 -394,0 -395,0 -396,0 -397,0 -398,0 -399,0 -400,0 -401,0 -402,0 -403,0 -404,0 -405,0 -406,0 -407,0 -408,0 -409,0 -410,0 -411,0 -412,0 -413,0 -414,0 -415,0 -416,0 -417,0 -418,0 -419,0 -420,0 -421,0 -422,0 -423,0 -424,0 -425,0 -426,0 -427,0 -428,0 -429,0 -430,0 -431,0 -432,0 -433,0 -434,0 -435,0 -436,0 -437,0 -438,0 -439,0 -440,0 -441,0 -442,0 -443,0 -444,0 -445,0 -446,0 -447,0 -448,0 -449,0 -450,0 -451,0 -452,0 -453,0 -454,0 -455,0 -456,0 -457,0 -458,0 -459,0 -460,0 -461,0 -462,0 -463,0 -464,0 -465,0 -466,0 -467,0 -468,0 -469,0 -470,0 -471,0 -472,0 -473,0 -474,0 -475,0 -476,0 -477,0 -478,0 -479,0 -480,0 -481,0 -482,0 -483,0 -484,0 -485,0 -486,0 -487,0 -488,0 -489,0 -490,0 -491,0 -492,0 -493,0 -494,0 -495,0 -496,0 -497,0 -498,0 -499,0 -500,0 -501,0 -502,0 -503,0 -504,0 -505,0 -506,0 -507,0 -508,0 -509,0 -510,0 -511,0 -512,0 -513,0 -514,0 -515,0 -516,0 -517,0 -518,0 -519,0 -520,0 -521,0 -522,0 -523,0 -524,0 -525,0 -526,0 -527,0 -528,0 -529,0 -530,0 -531,0 -532,0 -533,0 -534,0 -535,0 -536,0 -537,0 -538,0 -539,0 -540,0 -541,0 -542,0 -543,0 -544,0 -545,0 -546,0 -547,0 -548,0 -549,0 -550,0 -551,0 -552,0 -553,0 -554,0 -555,0 -556,0 -557,0 -558,0 -559,0 -560,0 -561,0 -562,0 -563,0 -564,0 -565,0 -566,0 -567,0 -568,0 -569,0 -570,0 -571,0 -572,0 -573,0 -574,0 -575,0 -576,0 -577,0 -578,0 -579,0 -580,0 -581,0 -582,0 -583,0 -584,0 -585,0 -586,0 -587,0 -588,0 -589,0 -590,0 -591,0 -592,0 -593,0 -594,0 -595,0 -596,0 -597,0 -598,0 -599,0 -600,0 -601,0 -602,0 -603,0 -604,0 -605,0 -606,0 -607,0 -608,0 -609,0 -610,0 -611,0 -612,0 -613,0 -614,0 -615,0 -616,0 -617,0 -618,0 -619,0 -620,0 -621,0 -622,0 -623,0 -624,0 -625,0 -626,0 -627,0 -628,0 -629,0 -630,0 -631,0 -632,0 -633,0 -634,0 -635,0 -636,0 -637,0 -638,0 -639,0 -640,0 -641,0 -642,0 -643,0 -644,0 -645,0 -646,0 -647,0 -648,0 -649,0 -650,0 -651,0 -652,0 -653,0 -654,0 -655,0 -656,0 -657,0 -658,0 -659,0 -660,0 -661,0 -662,0 -663,0 -664,0 -665,0 -666,0 -667,0 -668,0 -669,0 -670,0 -671,0 -672,0 -673,0 -674,0 -675,0 -676,0 -677,0 -678,0 -679,0 -680,0 -681,0 -682,0 -683,0 -684,0 -685,0 -686,0 -687,0 -688,0 -689,0 -690,0 -691,0 -692,0 -693,0 -694,0 -695,0 -696,0 -697,0 -698,0 -699,0 -700,0 -701,0 -702,0 -703,0 -704,0 -705,0 -706,0 -707,0 -708,0 -709,0 -710,0 -711,0 -712,0 -713,0 -714,0 -715,0 -716,0 -717,0 -718,0 -719,0 -720,0 -721,0 -722,0 -723,0 -724,0 -725,0 -726,0 -727,0 -728,0 -729,0 -730,0 -731,0 -732,0 -733,0 -734,0 -735,0 -736,0 -737,0 -738,0 -739,0 -740,0 -741,0 -742,0 -743,0 -744,0 -745,0 -746,0 -747,0 -748,0 -749,0 -750,0 -751,0 -752,0 -753,0 -754,0 -755,0 -756,0.050468073 -757,0.063506348 -758,0.080619711 -759,0.102907314 -760,0.130455731 -761,0.166013312 -762,0.209331663 -763,0.252800325 -764,0.284709087 -765,0.309308345 -766,0.325384596 -767,0.332523327 -768,0.332834849 -769,0.329210739 -770,0.320418218 -771,0.316097595 -772,0.312964879 -773,0.311471324 -774,0.311742896 -775,0.313707332 -776,0.317172745 -777,0.321877617 -778,0.327521957 -779,0.333795694 -780,0.34040778 -781,0.347119143 -782,0.35377905 -783,0.360365287 -784,0.367027829 -785,0.374142437 -786,0.382385448 -787,0.392848796 -788,0.407211111 -789,0.427944222 -790,0.458379747 -791,0.502047342 -792,0.560076121 -793,0.626399995 -794,0.685902196 -795,0.723606565 -796,0.736979411 -797,0.734499182 -798,0.725983857 -799,0.717606279 -800,0.71206589 -801,0.709937753 -802,0.71105047 -803,0.714709291 -804,0.72005544 -805,0.726192785 -806,0.732277506 -807,0.737601416 -808,0.741664795 -809,0.744221439 -810,0.745278971 -811,0.745055995 -812,0.743908807 -813,0.742249766 -814,0.740477415 -815,0.738927219 -816,0.737844114 -817,0.737374885 -818,0.737572109 -819,0.738407282 -820,0.739786949 -821,0.741572555 -822,0.743599864 -823,0.745699355 -824,0.747713947 -825,0.749514243 -826,0.751009309 -827,0.752152414 -828,0.752941119 -829,0.753412297 -830,0.75363455 -831,0.753697693 -832,0.753702005 -833,0.753748649 -834,0.75393093 -835,0.754327721 -836,0.754998605 -837,0.75598049 -838,0.757286043 -839,0.758903119 -840,0.760796129 -841,0.762907681 -842,0.765162736 -843,0.767473382 -844,0.769744539 -845,0.771881325 -846,0.773795631 -847,0.77541325 -848,0.776679123 -849,0.777561691 -850,0.778054391 -851,0.77817545 -852,0.777965425 -853,0.77748277 -854,0.776799891 -855,0.775996663 -856,0.775154903 -857,0.774354579 -858,0.773669217 -859,0.773163431 -860,0.772890076 -861,0.772888878 -862,0.773185326 -863,0.773789949 -864,0.774698244 -865,0.775891002 -866,0.777334964 -867,0.778984509 -868,0.780783607 -869,0.782668473 -870,0.78457058 -871,0.786419783 -872,0.788148199 -873,0.789693166 -874,0.791000856 -875,0.792028271 -876,0.792743796 -877,0.793133639 -878,0.793196812 -879,0.792945892 -880,0.792405664 -881,0.791611306 -882,0.79060546 -883,0.789436191 -884,0.7881533 -885,0.786807 -886,0.785444761 -887,0.784109853 -888,0.782840034 -889,0.781666371 -890,0.780674592 -891,0.779824575 -892,0.779118704 -893,0.778558221 -894,0.778137417 -895,0.777844606 -896,0.777663239 -897,0.777572925 -898,0.777550113 -899,0.777569904 -900,0.777606758 -901,0.777635906 -902,0.77763439 -903,0.77758227 -904,0.777463283 -905,0.777265391 -906,0.776981609 -907,0.776609963 -908,0.776153663 -909,0.775620309 -910,0.775021938 -911,0.774374022 -912,0.773694749 -913,0.773003871 -914,0.77232161 -915,0.771668295 -916,0.771062742 -917,0.770522084 -918,0.770060614 -919,0.769689464 -920,0.769416403 -921,0.769245155 -922,0.769175748 -923,0.769204232 -924,0.769322945 -925,0.769520916 -926,0.769783502 -927,0.770094014 -928,0.770433263 -929,0.770780796 -930,0.77111505 -931,0.771414445 -932,0.771657786 -933,0.771825739 -934,0.771900904 -935,0.771869197 -936,0.771719973 -937,0.771446893 -938,0.771048086 -939,0.770526039 -940,0.769887497 -941,0.769142708 -942,0.768304281 -943,0.76738648 -944,0.766403921 -945,0.765370681 -946,0.764299727 -947,0.76320285 -948,0.762090321 -949,0.760971684 -950,0.75985595 -951,0.758752044 -952,0.757669395 -953,0.756618286 -954,0.755610002 -955,0.754657271 -956,0.753774532 -957,0.752977148 -958,0.752280922 -959,0.75169983 -960,0.751244173 -961,0.750917828 -962,0.750715965 -963,0.750624129 -964,0.75061877 -965,0.750669068 -966,0.750740148 -967,0.750795461 -968,0.750799827 -969,0.750721316 -970,0.750532068 -971,0.750209024 -972,0.749734171 -973,0.749094514 -974,0.748281648 -975,0.747291968 -976,0.74612584 -977,0.744787904 -978,0.743286242 -979,0.74163223 -980,0.739840228 -981,0.7379268 -982,0.735910427 -983,0.733810939 -984,0.731649147 -985,0.729446257 -986,0.727223394 -987,0.725001525 -988,0.722800371 -989,0.720638472 -990,0.71853209 -991,0.716495383 -992,0.714539679 -993,0.712674271 -994,0.710905902 -995,0.709239459 -996,0.707677484 -997,0.706220467 -998,0.70486665 -999,0.703612459 -1000,0.702452133 -1001,0.701366411 -1002,0.700352472 -1003,0.699400549 -1004,0.698499843 -1005,0.697638661 -1006,0.696804571 -1007,0.695984776 -1008,0.695166249 -1009,0.694336068 -1010,0.693481723 -1011,0.692591184 -1012,0.691653497 -1013,0.690658424 -1014,0.6895974 -1015,0.688463271 -1016,0.687249631 -1017,0.685951933 -1018,0.684566891 -1019,0.683092572 -1020,0.681528201 -1021,0.679874093 -1022,0.678131211 -1023,0.676301217 -1024,0.674386255 -1025,0.672388711 -1026,0.670311202 -1027,0.668156072 -1028,0.665925645 -1029,0.663621744 -1030,0.661245722 -1031,0.658798019 -1032,0.656278286 -1033,0.653685021 -1034,0.651015324 -1035,0.648264978 -1036,0.64542821 -1037,0.642497332 -1038,0.639463039 -1039,0.636314026 -1040,0.633037197 -1041,0 -1042,0 -1043,0 -1044,0 -1045,0 -1046,0 -1047,0 -1048,0 -1049,0 -1050,0 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-NGPS-spectrograph-R.csv b/pygui/ETC/CSV/throughput-NGPS-spectrograph-R.csv deleted file mode 100644 index 5bf4e577..00000000 --- a/pygui/ETC/CSV/throughput-NGPS-spectrograph-R.csv +++ /dev/null @@ -1,754 +0,0 @@ -# Based on MODELS of NGPS spectrograph optics: dichroics, collimator, gratings, camera", -# Does NOT include losses from slit and slicer, -Wavelength (nm),R -300, -301, -302, -303, -304, -305, -306, -307, -308, -309, -310,0 -311,0 -312,0 -313,0 -314,0 -315,0 -316,0 -317,0 -318,0 -319,0 -320,0 -321,0 -322,0 -323,0 -324,0 -325,0 -326,0 -327,0 -328,0 -329,0 -330,0 -331,0 -332,0 -333,0 -334,0 -335,0 -336,0 -337,0 -338,0 -339,0 -340,0 -341,0 -342,0 -343,0 -344,0 -345,0 -346,0 -347,0 -348,0 -349,0 -350,0 -351,0 -352,0 -353,0 -354,0 -355,0 -356,0 -357,0 -358,0 -359,0 -360,0 -361,0 -362,0 -363,0 -364,0 -365,0 -366,0 -367,0 -368,0 -369,0 -370,0 -371,0 -372,0 -373,0 -374,0 -375,0 -376,0 -377,0 -378,0 -379,0 -380,0 -381,0 -382,0 -383,0 -384,0 -385,0 -386,0 -387,0 -388,0 -389,0 -390,0 -391,0 -392,0 -393,0 -394,0 -395,0 -396,0 -397,0 -398,0 -399,0 -400,0 -401,0 -402,0 -403,0 -404,0 -405,0 -406,0 -407,0 -408,0 -409,0 -410,0 -411,0 -412,0 -413,0 -414,0 -415,0 -416,0 -417,0 -418,0 -419,0 -420,0 -421,0 -422,0 -423,0 -424,0 -425,0 -426,0 -427,0 -428,0 -429,0 -430,0 -431,0 -432,0 -433,0 -434,0 -435,0 -436,0 -437,0 -438,0 -439,0 -440,0 -441,0 -442,0 -443,0 -444,0 -445,0 -446,0 -447,0 -448,0 -449,0 -450,0 -451,0 -452,0 -453,0 -454,0 -455,0 -456,0 -457,0 -458,0 -459,0 -460,0 -461,0 -462,0 -463,0 -464,0 -465,0 -466,0 -467,0 -468,0 -469,0 -470,0 -471,0 -472,0 -473,0 -474,0 -475,0 -476,0 -477,0 -478,0 -479,0 -480,0 -481,0 -482,0 -483,0 -484,0 -485,0 -486,0 -487,0 -488,0 -489,0 -490,0 -491,0 -492,0 -493,0 -494,0 -495,0 -496,0 -497,0 -498,0 -499,0 -500,0 -501,0 -502,0 -503,0 -504,0 -505,0 -506,0 -507,0 -508,0 -509,0 -510,0 -511,0 -512,0 -513,0 -514,0 -515,0 -516,0 -517,0 -518,0 -519,0 -520,0 -521,0 -522,0 -523,0 -524,0 -525,0 -526,0 -527,0 -528,0 -529,0 -530,0 -531,0 -532,0 -533,0 -534,0 -535,0 -536,0 -537,0 -538,0 -539,0 -540,0 -541,0 -542,0 -543,0 -544,0 -545,0 -546,0 -547,0 -548,0 -549,0 -550,0 -551,0 -552,0 -553,0 -554,0 -555,0 -556,0 -557,0 -558,0 -559,0 -560,0 -561,0.054869555 -562,0.073187651 -563,0.098435761 -564,0.131863236 -565,0.173852273 -566,0.221425687 -567,0.267096803 -568,0.300623795 -569,0.316747367 -570,0.319530849 -571,0.315607769 -572,0.310034069 -573,0.305760216 -574,0.304130661 -575,0.305510932 -576,0.307042336 -577,0.314036862 -578,0.322876628 -579,0.333030337 -580,0.344072164 -581,0.355777383 -582,0.368445431 -583,0.383273044 -584,0.402734175 -585,0.431035891 -586,0.474067804 -587,0.536552853 -588,0.61314072 -589,0.68050864 -590,0.71519604 -591,0.719024016 -592,0.70913566 -593,0.698517438 -594,0.692445334 -595,0.691803108 -596,0.69567663 -597,0.702517622 -598,0.710621321 -599,0.718392677 -600,0.724508202 -601,0.72700992 -602,0.711753369 -603,0.730718447 -604,0.730496691 -605,0.729530113 -606,0.728791641 -607,0.728734201 -608,0.729530954 -609,0.731131759 -610,0.733322983 -611,0.735805767 -612,0.738244828 -613,0.740347553 -614,0.741916821 -615,0.74287275 -616,0.743253109 -617,0.74319318 -618,0.742893205 -619,0.74258211 -620,0.742484892 -621,0.742796602 -622,0.743665643 -623,0.74517904 -624,0.747353576 -625,0.750139955 -626,0.753424584 -627,0.757039862 -628,0.760780776 -629,0.764427585 -630,0.767771111 -631,0.770638079 -632,0.772910966 -633,0.774539897 -634,0.775543676 -635,0.776000488 -636,0.77603269 -637,0.775787236 -638,0.775417118 -639,0.775065223 -640,0.774852757 -641,0.774871534 -642,0.775180076 -643,0.775806002 -644,0.776737091 -645,0.777932616 -646,0.779327722 -647,0.780839001 -648,0.782372626 -649,0.783834184 -650,0.785138395 -651,0.786217928 -652,0.787032128 -653,0.787569466 -654,0.787848464 -655,0.787914588 -656,0.787834176 -657,0.787686408 -658,0.787555034 -659,0.787520183 -660,0.787651914 -661,0.788005337 -662,0.788617415 -663,0.789505126 -664,0.790664928 -665,0.792072809 -666,0.793685014 -667,0.795442933 -668,0.797292396 -669,0.799207955 -670,0.801137668 -671,0.802964633 -672,0.804587292 -673,0.805941963 -674,0.806988588 -675,0.807706546 -676,0.808095727 -677,0.80817518 -678,0.807983078 -679,0.807572813 -680,0.807008286 -681,0.8063587 -682,0.805692948 -683,0.805074751 -684,0.804558802 -685,0.804187342 -686,0.803988546 -687,0.803975302 -688,0.804144894 -689,0.804479685 -690,0.804947691 -691,0.805502945 -692,0.806086513 -693,0.80664397 -694,0.807079461 -695,0.807292381 -696,0.807137643 -697,0.806354698 -698,0.80434343 -699,0.799639085 -700,0.792309043 -701,0.793136046 -702,0.797025548 -703,0.798230671 -704,0.797974924 -705,0.797150282 -706,0.796150109 -707,0.795149648 -708,0.794226881 -709,0.793416565 -710,0.792736954 -711,0.792202471 -712,0.791826176 -713,0.791618125 -714,0.791581729 -715,0.791710813 -716,0.791986999 -717,0.792377507 -718,0.792832264 -719,0.793272365 -720,0.793460969 -721,0.79321909 -722,0.793616232 -723,0.792893193 -724,0.7911783 -725,0.787919523 -726,0.78221161 -727,0.772979537 -728,0.760606353 -729,0.750682924 -730,0.750498096 -731,0.757164494 -732,0.763817379 -733,0.768011472 -734,0.769927978 -735,0.770215741 -736,0.769407072 -737,0.767871948 -738,0.765863895 -739,0.763560371 -740,0.761088841 -741,0.758541275 -742,0.755982761 -743,0.75345572 -744,0.750982148 -745,0.748564415 -746,0.746184561 -747,0.743803368 -748,0.741357375 -749,0.738755187 -750,0.73587164 -751,0.732539742 -752,0.728537858 -753,0.723574151 -754,0.717264713 -755,0.709105495 -756,0.698440553 -757,0.684434218 -758,0.66606639 -759,0.642185231 -760,0.611643923 -761,0.573431768 -762,0.527087543 -763,0.480747677 -764,0.446707545 -765,0.420346128 -766,0.402816408 -767,0.394424317 -768,0.39287245 -769,0.395111864 -770,0.394014137 -771,0.397566062 -772,0.399743087 -773,0.400141639 -774,0.398691881 -775,0.3955222 -776,0.390874428 -777,0.385054574 -778,0.378396694 -779,0.371235059 -780,0.363875717 -781,0.356565335 -782,0.349457292 -783,0.34257617 -784,0.335779274 -785,0.328710511 -786,0.32073557 -787,0.310842142 -788,0.297490805 -789,0.278438306 -790,0.250695534 -791,0.211159876 -792,0.158967825 -793,0.099797214 -794,0.047364617 -795,0 -796,0 -797,0 -798,0 -799,0 -800,0 -801,0 -802,0 -803,0 -804,0 -805,0 -806,0 -807,0 -808,0 -809,0 -810,0 -811,0 -812,0 -813,0 -814,0 -815,0 -816,0 -817,0 -818,0 -819,0 -820,0 -821,0 -822,0 -823,0 -824,0 -825,0 -826,0 -827,0 -828,0 -829,0 -830,0 -831,0 -832,0 -833,0 -834,0 -835,0 -836,0 -837,0 -838,0 -839,0 -840,0 -841,0 -842,0 -843,0 -844,0 -845,0 -846,0 -847,0 -848,0 -849,0 -850,0 -851,0 -852,0 -853,0 -854,0 -855,0 -856,0 -857,0 -858,0 -859,0 -860,0 -861,0 -862,0 -863,0 -864,0 -865,0 -866,0 -867,0 -868,0 -869,0 -870,0 -871,0 -872,0 -873,0 -874,0 -875,0 -876,0 -877,0 -878,0 -879,0 -880,0 -881,0 -882,0 -883,0 -884,0 -885,0 -886,0 -887,0 -888,0 -889,0 -890,0 -891,0 -892,0 -893,0 -894,0 -895,0 -896,0 -897,0 -898,0 -899,0 -900,0 -901,0 -902,0 -903,0 -904,0 -905,0 -906,0 -907,0 -908,0 -909,0 -910,0 -911,0 -912,0 -913,0 -914,0 -915,0 -916,0 -917,0 -918,0 -919,0 -920,0 -921,0 -922,0 -923,0 -924,0 -925,0 -926,0 -927,0 -928,0 -929,0 -930,0 -931,0 -932,0 -933,0 -934,0 -935,0 -936,0 -937,0 -938,0 -939,0 -940,0 -941,0 -942,0 -943,0 -944,0 -945,0 -946,0 -947,0 -948,0 -949,0 -950,0 -951,0 -952,0 -953,0 -954,0 -955,0 -956,0 -957,0 -958,0 -959,0 -960,0 -961,0 -962,0 -963,0 -964,0 -965,0 -966,0 -967,0 -968,0 -969,0 -970,0 -971,0 -972,0 -973,0 -974,0 -975,0 -976,0 -977,0 -978,0 -979,0 -980,0 -981,0 -982,0 -983,0 -984,0 -985,0 -986,0 -987,0 -988,0 -989,0 -990,0 -991,0 -992,0 -993,0 -994,0 -995,0 -996,0 -997,0 -998,0 -999,0 -1000,0 -1001,0 -1002,0 -1003,0 -1004,0 -1005,0 -1006,0 -1007,0 -1008,0 -1009,0 -1010,0 -1011,0 -1012,0 -1013,0 -1014,0 -1015,0 -1016,0 -1017,0 -1018,0 -1019,0 -1020,0 -1021,0 -1022,0 -1023,0 -1024,0 -1025,0 -1026,0 -1027,0 -1028,0 -1029,0 -1030,0 -1031,0 -1032,0 -1033,0 -1034,0 -1035,0 -1036,0 -1037,0 -1038,0 -1039,0 -1040,0 -1041,0 -1042,0 -1043,0 -1044,0 -1045,0 -1046,0 -1047,0 -1048,0 -1049,0 -1050,0 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-NGPS-spectrograph-U.csv b/pygui/ETC/CSV/throughput-NGPS-spectrograph-U.csv deleted file mode 100644 index fc87e4c2..00000000 --- a/pygui/ETC/CSV/throughput-NGPS-spectrograph-U.csv +++ /dev/null @@ -1,754 +0,0 @@ -# Based on MODELS of NGPS spectrograph optics: dichroics, collimator, gratings, camera", -# Does NOT include losses from slit and slicer, -Wavelength (nm),U -300, -301, -302, -303, -304, -305, -306, -307, -308, -309, -310,0.519132624 -311,0.529638678 -312,0.539757368 -313,0.549466376 -314,0.558712167 -315,0.567419935 -316,0.575612098 -317,0.583811295 -318,0.592839741 -319,0.602231286 -320,0.611114796 -321,0.619363874 -322,0.627110846 -323,0.634465454 -324,0.641492763 -325,0.648230905 -326,0.654711579 -327,0.66094198 -328,0.66693042 -329,0.672685827 -330,0.678211755 -331,0.683491661 -332,0.688504974 -333,0.693205057 -334,0.697513038 -335,0.701386898 -336,0.705163703 -337,0.70952668 -338,0.714139265 -339,0.718295394 -340,0.721780499 -341,0.724287466 -342,0.72513601 -343,0.726145413 -344,0.723913879 -345,0.7219103 -346,0.730090978 -347,0.742928761 -348,0.75144413 -349,0.757009696 -350,0.761762958 -351,0.763770174 -352,0.765417864 -353,0.766542635 -354,0.767312304 -355,0.766508884 -356,0.765023305 -357,0.768449513 -358,0.772784199 -359,0.775390574 -360,0.777040345 -361,0.778210443 -362,0.779092837 -363,0.779771095 -364,0.780283424 -365,0.780643838 -366,0.780828128 -367,0.780686819 -368,0.78076059 -369,0.781002041 -370,0.780980592 -371,0.780834818 -372,0.780607932 -373,0.780316508 -374,0.779970065 -375,0.779574004 -376,0.779144785 -377,0.778646362 -378,0.778027765 -379,0.776868601 -380,0.773717602 -381,0.775480711 -382,0.77585449 -383,0.775577351 -384,0.775147852 -385,0.774658249 -386,0.774126646 -387,0.773543862 -388,0.772866535 -389,0.771862981 -390,0.770024743 -391,0.761488358 -392,0.767304742 -393,0.769462095 -394,0.769586582 -395,0.769446712 -396,0.769295239 -397,0.769164157 -398,0.767937612 -399,0.769002003 -400,0.768964016 -401,0.768907847 -402,0.768820988 -403,0.768695668 -404,0.768522324 -405,0.768272665 -406,0.767914856 -407,0.767477945 -408,0.766942804 -409,0.766282494 -410,0.765915259 -411,0.765588417 -412,0.764867879 -413,0.763529396 -414,0.761132231 -415,0.756756767 -416,0.748392482 -417,0.731615124 -418,0.697735009 -419,0.63717369 -420,0.562296797 -421,0.511538898 -422,0.490444968 -423,0.477253089 -424,0.459664382 -425,0.436464108 -426,0.411825836 -427,0.391477697 -428,0.379125103 -429,0.374368888 -430,0.373712665 -431,0.372945749 -432,0.368156999 -433,0.353606529 -434,0.310996376 -435,0.193756074 -436,0.029671637 -437,0 -438,0 -439,0 -440,0 -441,0 -442,0 -443,0 -444,0 -445,0 -446,0 -447,0 -448,0 -449,0 -450,0 -451,0 -452,0 -453,0 -454,0 -455,0 -456,0 -457,0 -458,0 -459,0 -460,0 -461,0 -462,0 -463,0 -464,0 -465,0 -466,0 -467,0 -468,0 -469,0 -470,0 -471,0 -472,0 -473,0 -474,0 -475,0 -476,0 -477,0 -478,0 -479,0 -480,0 -481,0 -482,0 -483,0 -484,0 -485,0 -486,0 -487,0 -488,0 -489,0 -490,0 -491,0 -492,0 -493,0 -494,0 -495,0 -496,0 -497,0 -498,0 -499,0 -500,0 -501,0 -502,0 -503,0 -504,0 -505,0 -506,0 -507,0 -508,0 -509,0 -510,0 -511,0 -512,0 -513,0 -514,0 -515,0 -516,0 -517,0 -518,0 -519,0 -520,0 -521,0 -522,0 -523,0 -524,0 -525,0 -526,0 -527,0 -528,0 -529,0 -530,0 -531,0 -532,0 -533,0 -534,0 -535,0 -536,0 -537,0 -538,0 -539,0 -540,0 -541,0 -542,0 -543,0 -544,0 -545,0 -546,0 -547,0 -548,0 -549,0 -550,0 -551,0 -552,0 -553,0 -554,0 -555,0 -556,0 -557,0 -558,0 -559,0 -560,0 -561,0 -562,0 -563,0 -564,0 -565,0 -566,0 -567,0 -568,0 -569,0 -570,0 -571,0 -572,0 -573,0 -574,0 -575,0 -576,0 -577,0 -578,0 -579,0 -580,0 -581,0 -582,0 -583,0 -584,0 -585,0 -586,0 -587,0 -588,0 -589,0 -590,0 -591,0 -592,0 -593,0 -594,0 -595,0 -596,0 -597,0 -598,0 -599,0 -600,0 -601,0 -602,0 -603,0 -604,0 -605,0 -606,0 -607,0 -608,0 -609,0 -610,0 -611,0 -612,0 -613,0 -614,0 -615,0 -616,0 -617,0 -618,0 -619,0 -620,0 -621,0 -622,0 -623,0 -624,0 -625,0 -626,0 -627,0 -628,0 -629,0 -630,0 -631,0 -632,0 -633,0 -634,0 -635,0 -636,0 -637,0 -638,0 -639,0 -640,0 -641,0 -642,0 -643,0 -644,0 -645,0 -646,0 -647,0 -648,0 -649,0 -650,0 -651,0 -652,0 -653,0 -654,0 -655,0 -656,0 -657,0 -658,0 -659,0 -660,0 -661,0 -662,0 -663,0 -664,0 -665,0 -666,0 -667,0 -668,0 -669,0 -670,0 -671,0 -672,0 -673,0 -674,0 -675,0 -676,0 -677,0 -678,0 -679,0 -680,0 -681,0 -682,0 -683,0 -684,0 -685,0 -686,0 -687,0 -688,0 -689,0 -690,0 -691,0 -692,0 -693,0 -694,0 -695,0 -696,0 -697,0 -698,0 -699,0 -700,0 -701,0 -702,0 -703,0 -704,0 -705,0 -706,0 -707,0 -708,0 -709,0 -710,0 -711,0 -712,0 -713,0 -714,0 -715,0 -716,0 -717,0 -718,0 -719,0 -720,0 -721,0 -722,0 -723,0 -724,0 -725,0 -726,0 -727,0 -728,0 -729,0 -730,0 -731,0 -732,0 -733,0 -734,0 -735,0 -736,0 -737,0 -738,0 -739,0 -740,0 -741,0 -742,0 -743,0 -744,0 -745,0 -746,0 -747,0 -748,0 -749,0 -750,0 -751,0 -752,0 -753,0 -754,0 -755,0 -756,0 -757,0 -758,0 -759,0 -760,0 -761,0 -762,0 -763,0 -764,0 -765,0 -766,0 -767,0 -768,0 -769,0 -770,0 -771,0 -772,0 -773,0 -774,0 -775,0 -776,0 -777,0 -778,0 -779,0 -780,0 -781,0 -782,0 -783,0 -784,0 -785,0 -786,0 -787,0 -788,0 -789,0 -790,0 -791,0 -792,0 -793,0 -794,0 -795,0 -796,0 -797,0 -798,0 -799,0 -800,0 -801,0 -802,0 -803,0 -804,0 -805,0 -806,0 -807,0 -808,0 -809,0 -810,0 -811,0 -812,0 -813,0 -814,0 -815,0 -816,0 -817,0 -818,0 -819,0 -820,0 -821,0 -822,0 -823,0 -824,0 -825,0 -826,0 -827,0 -828,0 -829,0 -830,0 -831,0 -832,0 -833,0 -834,0 -835,0 -836,0 -837,0 -838,0 -839,0 -840,0 -841,0 -842,0 -843,0 -844,0 -845,0 -846,0 -847,0 -848,0 -849,0 -850,0 -851,0 -852,0 -853,0 -854,0 -855,0 -856,0 -857,0 -858,0 -859,0 -860,0 -861,0 -862,0 -863,0 -864,0 -865,0 -866,0 -867,0 -868,0 -869,0 -870,0 -871,0 -872,0 -873,0 -874,0 -875,0 -876,0 -877,0 -878,0 -879,0 -880,0 -881,0 -882,0 -883,0 -884,0 -885,0 -886,0 -887,0 -888,0 -889,0 -890,0 -891,0 -892,0 -893,0 -894,0 -895,0 -896,0 -897,0 -898,0 -899,0 -900,0 -901,0 -902,0 -903,0 -904,0 -905,0 -906,0 -907,0 -908,0 -909,0 -910,0 -911,0 -912,0 -913,0 -914,0 -915,0 -916,0 -917,0 -918,0 -919,0 -920,0 -921,0 -922,0 -923,0 -924,0 -925,0 -926,0 -927,0 -928,0 -929,0 -930,0 -931,0 -932,0 -933,0 -934,0 -935,0 -936,0 -937,0 -938,0 -939,0 -940,0 -941,0 -942,0 -943,0 -944,0 -945,0 -946,0 -947,0 -948,0 -949,0 -950,0 -951,0 -952,0 -953,0 -954,0 -955,0 -956,0 -957,0 -958,0 -959,0 -960,0 -961,0 -962,0 -963,0 -964,0 -965,0 -966,0 -967,0 -968,0 -969,0 -970,0 -971,0 -972,0 -973,0 -974,0 -975,0 -976,0 -977,0 -978,0 -979,0 -980,0 -981,0 -982,0 -983,0 -984,0 -985,0 -986,0 -987,0 -988,0 -989,0 -990,0 -991,0 -992,0 -993,0 -994,0 -995,0 -996,0 -997,0 -998,0 -999,0 -1000,0 -1001,0 -1002,0 -1003,0 -1004,0 -1005,0 -1006,0 -1007,0 -1008,0 -1009,0 -1010,0 -1011,0 -1012,0 -1013,0 -1014,0 -1015,0 -1016,0 -1017,0 -1018,0 -1019,0 -1020,0 -1021,0 -1022,0 -1023,0 -1024,0 -1025,0 -1026,0 -1027,0 -1028,0 -1029,0 -1030,0 -1031,0 -1032,0 -1033,0 -1034,0 -1035,0 -1036,0 -1037,0 -1038,0 -1039,0 -1040,0 -1041,0 -1042,0 -1043,0 -1044,0 -1045,0 -1046,0 -1047,0 -1048,0 -1049,0 -1050,0 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-spectrograph-20260206-G.csv b/pygui/ETC/CSV/throughput-spectrograph-20260206-G.csv new file mode 100644 index 00000000..dfdd073f --- /dev/null +++ b/pygui/ETC/CSV/throughput-spectrograph-20260206-G.csv @@ -0,0 +1,55 @@ +x, y +300,0 +413.63617,0 +417.02702,0.01853 +418.75926,0.0455 +421.10332,0.0873 +423.41945,0.12623 +426.10031,0.13749 +429.00119,0.13959 +431.20986,0.16348 +432.96579,0.19615 +433.84164,0.23671 +435.17445,0.28517 +436.55465,0.32293 +437.59467,0.35809 +442.12201,0.372 +445.69395,0.37904 +449.7584,0.40021 +453.03755,0.41357 +456.88451,0.43651 +461.61833,0.45174 +466.91066,0.46323 +474.14594,0.47773 +482.29176,0.50179 +489.13016,0.51187 +493.03129,0.52199 +501.19403,0.5466 +506.33996,0.55401 +512.43198,0.55773 +521.14901,0.5644 +528.00264,0.57386 +535.36655,0.57918 +543.74593,0.57192 +551.29346,0.58064 +557.17477,0.58704 +561.14698,0.57084 +563.53505,0.53981 +565.22328,0.49957 +566.92505,0.44182 +568.67336,0.37819 +569.74808,0.33999 +571.50655,0.32166 +575.06749,0.3245 +578.31278,0.34226 +580.89294,0.3404 +582.84774,0.32348 +584.74583,0.29047 +586.68794,0.2294 +588.23231,0.15912 +589.42126,0.10012 +591.94388,0.02933 +594.91246,0.00922 +596.35613,0 +598.46409,0 +1200,0 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-spectrograph-20260206-I.csv b/pygui/ETC/CSV/throughput-spectrograph-20260206-I.csv new file mode 100644 index 00000000..b311c2eb --- /dev/null +++ b/pygui/ETC/CSV/throughput-spectrograph-20260206-I.csv @@ -0,0 +1,48 @@ +x, y +300,0 +743.96007,0 +748.50343,0.00141 +750.82587,0.01305 +753.60862,0.03459 +758.27158,0.09927 +761.85676,0.13199 +766.03993,0.2039 +768.93811,0.24398 +774.26582,0.2909 +777.34479,0.30952 +779.92451,0.30405 +782.5821,0.33607 +785.22996,0.38649 +788.77342,0.50852 +789.58001,0.54617 +792.99553,0.5967 +797.34558,0.62497 +806.28767,0.64793 +812.27178,0.64454 +815.42724,0.6342 +826.72653,0.64952 +841.53313,0.68651 +858.91666,0.70297 +869.15069,0.70823 +886.77481,0.71827 +892.09556,0.71167 +895.48743,0.66583 +904.96354,0.6761 +907.11215,0.64376 +918.8801,0.64672 +927.0448,0.61031 +929.84981,0.53621 +933.83967,0.43849 +951.18148,0.4718 +970.09337,0.45913 +973.49776,0.4145 +984.4925,0.39414 +996.50661,0.29391 +1004.6268,0.23916 +1016.5074,0.14171 +1030.11106,0.04339 +1034.97844,0.02443 +1039.40638,0.03266 +1042.31568,0 +1045.57405,0 +1200,0 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-spectrograph-20260206-R.csv b/pygui/ETC/CSV/throughput-spectrograph-20260206-R.csv new file mode 100644 index 00000000..05b5d06e --- /dev/null +++ b/pygui/ETC/CSV/throughput-spectrograph-20260206-R.csv @@ -0,0 +1,69 @@ +x, y +300,0 +556.02526,0 +561.20948,0 +562.12304,0.02507 +564.05189,0.04369 +566.55386,0.09023 +569.94621,0.17965 +571.56584,0.20072 +573.04547,0.20827 +577.28994,0.1915 +580.24214,0.19651 +582.28078,0.21651 +584.21768,0.23783 +586.8385,0.29531 +587.87293,0.34286 +589.82394,0.42604 +590.92585,0.47077 +592.90002,0.51224 +594.80973,0.50602 +596.87859,0.50647 +601.05356,0.5262 +605.30509,0.55527 +610.22743,0.56811 +618.19262,0.58154 +624.32767,0.59446 +628.412,0.59126 +636.32481,0.62104 +641.42946,0.63488 +644.98801,0.6385 +648.11648,0.63213 +653.17983,0.63857 +656.15519,0.63176 +658.7881,0.65231 +664.89092,0.66015 +675.14756,0.67384 +676.51034,0.66647 +682.50237,0.68003 +689.30521,0.65158 +694.4703,0.68296 +700.5147,0.68293 +705.10465,0.69213 +709.55057,0.69851 +714.81739,0.69881 +718.523,0.65766 +727.89126,0.69024 +730.21696,0.71233 +737.54457,0.74129 +743.37241,0.74827 +751.01831,0.73037 +754.64032,0.68514 +757.07983,0.61401 +759.12451,0.57322 +762.92681,0.36098 +765.66044,0.38994 +768.82718,0.38693 +773.17137,0.34869 +776.97569,0.33466 +780.59165,0.32934 +783.22254,0.30362 +785.52104,0.24661 +788.00588,0.16181 +790.27719,0.08514 +791.34788,0.06108 +793.25356,0.04401 +795.86128,0.03774 +796.53915,0 +798.45491,0 +1200,0 \ No newline at end of file diff --git a/pygui/ETC/CSV/throughput-spectrograph-20260206-U.csv b/pygui/ETC/CSV/throughput-spectrograph-20260206-U.csv new file mode 100644 index 00000000..5dfd939d --- /dev/null +++ b/pygui/ETC/CSV/throughput-spectrograph-20260206-U.csv @@ -0,0 +1,63 @@ +x, y +300.01047,0 +304.64481,0 +304.91886,0.04319 +305.53241,0.0641 +306.37973,0.07051 +307.58309,0.09834 +309.55464,0.09967 +310.61703,0.11366 +312.8504,0.19044 +313.78187,0.1888 +314.19258,0.21649 +315.40242,0.22051 +316.81365,0.24149 +320.08136,0.24344 +321.36672,0.27661 +322.31833,0.27868 +324.5402,0.31346 +332.59689,0.36195 +333.79018,0.36106 +337.06364,0.38122 +339.93215,0.41083 +341.55341,0.41059 +348.01546,0.44959 +352.02043,0.4681 +355.19319,0.47412 +362.03214,0.49747 +366.42696,0.5114 +367.5735,0.50272 +370.17227,0.50645 +374.86487,0.5427 +376.64438,0.5088 +378.59436,0.55817 +383.85376,0.55221 +385.30096,0.56396 +386.88698,0.59627 +392.22047,0.62934 +394.27546,0.59929 +397.19575,0.63202 +399.03928,0.62837 +403.86279,0.62908 +409.94002,0.61076 +415.10232,0.61122 +417.04798,0.58946 +418.32543,0.55438 +420.18765,0.49129 +421.77439,0.42416 +422.99789,0.39016 +424.57816,0.36587 +427.89622,0.37487 +430.2605,0.36293 +431.62426,0.32918 +432.96716,0.2737 +433.25847,0.24229 +434.86895,0.15484 +435.62636,0.1126 +436.09461,0.08549 +436.84698,0.0532 +437.82161,0.02395 +439.98809,0.00629 +443.33636,0 +459.94102,0 +1200,0 \ No newline at end of file diff --git a/pygui/ETC/ETC_arguments.py b/pygui/ETC/ETC_arguments.py index 0b6e2387..f775ef8c 100644 --- a/pygui/ETC/ETC_arguments.py +++ b/pygui/ETC/ETC_arguments.py @@ -71,8 +71,8 @@ def slitfloat(value): # require slit in slit_w_range help = 'Only use flux from the center slit, not side slices' parser.add_argument('-noslicer', action='store_true', help=help) -help = 'Assume astronomer only uses 2 brightest pixels in center slice for SNR' -parser.add_argument('-fastSNR', action='store_true', help=help) +help = 'Assume astronomer computes SNR by summing 2N brightest pixels of profile in center slice (symmetric profile, N on 1 side of peak)' +parser.add_argument('-fastSNR', type=int, default=None, help=help) help = 'Plot SNR vs. wavelength for the solution' parser.add_argument('-plotSNR', action='store_true', help=help) diff --git a/pygui/ETC/ETC_config.py b/pygui/ETC/ETC_config.py index 3c3e15a1..c1035f6f 100644 --- a/pygui/ETC/ETC_config.py +++ b/pygui/ETC/ETC_config.py @@ -41,10 +41,12 @@ chanConfig=QTable([channels], names=['channel']) chanConfig.add_index('channel') # Allows us to specify rows by channel -chanConfig['channelRange']=[[310.,436.], [417.,590.], [561.,794.], [756.,1040.]] * u.nm +# chanConfig['channelRange']=[[305.1,443.5], [415.7,593.1], [561.9,793.4], [751.2,1040.5]] * u.nm +chanConfig['channelRange']=[[3051.,4435.], [4157.,5931.], [5619.,7934.], [7512.,10405.]] * u.AA # Width of detector (px) in the dispersion direction -chanConfig['Npix_dispers']=(4096, 4096, 4096, 4096) +chanConfig['Npix_dispers']=(4114, 4114, 4114, 4114) +chanConfig['dLambda'] = [ (cr[1]-cr[0])/npd for (cr,npd) in zip(chanConfig['channelRange'], chanConfig['Npix_dispers']) ] chanConfig['platescale']=(0.191, 0.191, 0.191, 0.191)*u.arcsec/u.pix @@ -54,24 +56,20 @@ #LSFFile={} # Wait for data -#1/2 of FWHM requirement --> sigma -chanConfig['LSFsigma']=(1.0, 1.4, 1.85, 2.25)*u.AA /2/2.35 +#FWHM ~ sigma*2.35 +#chanConfig['LSFsigma_px']=[2.585, 2.585, 2.585, 2.585] # R, I widths measured by Matt Matuszewski, 2025 +chanConfig['LSFsigma_px']=[1.23, 1.14, 1.25, 1.25] # Measured by C. Fremling, 2026 +chanConfig['LSFsigma'] = chanConfig['LSFsigma_px'] * chanConfig['dLambda'] # Colors for plotting chanConfig['channelColor']=('blue','green','red','magenta') +# Spectrograph Throughput here includes CCD QE chanConfig['throughputFile_spectrograph']=( - 'throughput-NGPS-spectrograph-U.csv', - 'throughput-NGPS-spectrograph-G.csv', - 'throughput-NGPS-spectrograph-R.csv', - 'throughput-NGPS-spectrograph-I.csv' -) - -chanConfig['QEFile']=( - 'QE-LBNL-CCD-blue.csv', - 'QE-LBNL-CCD-red.csv', - 'QE-LBNL-CCD-red.csv', - 'QE-LBNL-CCD-red.csv' + 'throughput-spectrograph-20260206-U.csv', + 'throughput-spectrograph-20260206-G.csv', + 'throughput-spectrograph-20260206-R.csv', + 'throughput-spectrograph-20260206-I.csv' ) # Make standalone dicts from the columns in the data table diff --git a/pygui/ETC/ETC_import.py b/pygui/ETC/ETC_import.py index 1d1bd0ee..2199a044 100644 --- a/pygui/ETC/ETC_import.py +++ b/pygui/ETC/ETC_import.py @@ -95,7 +95,7 @@ def seeingLambda(w ,FWHM ,pivot=500.*u.nm): '''Seeing law scaled to wavelength''' assert u.get_physical_type(w) == 'length', "w must have units of length" #pivot = 500.*u.nm - return FWHM*(w/pivot)**0.2 + return (FWHM*(w/pivot)**0.2).to('arcsec') # Force units to simplify def makeSource(args): ''' Load the source model, mix with astrophysics, normalize. @@ -567,7 +567,7 @@ def applySlit(slitw, source_at_slit, sky_at_slit, throughput_slicerOptics, args else: Npix_spatial = args.extended - if args.fastSNR: Npix_spatial = 2 # overrides extended source size + if args.fastSNR: Npix_spatial = 2*args.fastSNR # overrides extended source size sharpness = { k : { s: 1./array([Npix_spatial]*len(binCenters[k])) if Npix_spatial is not None # 1/sharpness = [N, N, N...] @@ -598,9 +598,10 @@ def applySlit(slitw, source_at_slit, sky_at_slit, throughput_slicerOptics, args if POINTSOURCE: spec = source_at_slit[k] * throughput_slicer[s] # This applies slit loss and optics - # scale signal down to 2 center pixels + # scale signal down to 2N center pixels if args.fastSNR: - spec *= SpectralElement(Empirical1D, points=binCenters[k], lookup_table=2*profile_slit[k][s][0]) + spec *= 2*profile_slit[k][s][0:args.fastSNR].sum() + #spec *= SpectralElement(Empirical1D, points=binCenters[k], lookup_table=2*profile_slit[k][s][0]) else: # extended source is normalized to mag/arcsec^2, so multiplying by arcsec^2/px gives signal in 1 pixel @@ -633,7 +634,7 @@ def applySlit_extended(slitw, source_at_slit, sky_at_slit, throughput_slicerOpti if args.noslicer or args.fastSNR: slicer_paths = ['center'] else: slicer_paths = ['center','side'] - if args.fastSNR: Npix_spatial = 2 + if args.fastSNR: Npix_spatial = 2*args.fastSNR elif args.extended != None: Npix_spatial = args.extended else: Npix_spatial = None diff --git a/pygui/ETC/ETC_main.py b/pygui/ETC/ETC_main.py index 44998138..c4b33bca 100755 --- a/pygui/ETC/ETC_main.py +++ b/pygui/ETC/ETC_main.py @@ -32,12 +32,11 @@ # Load telescope throughput throughput_telescope = LoadCSVSpec(throughputFile_telescope) -# Load throughputs and detector QE for all spectrograph channels +# Load throughputs for all spectrograph channels throughput_spectrograph = { k : LoadCSVSpec(throughputFile_spectrograph[k]) for k in channels } -QE = { k : LoadCSVSpec(QEFile[k]) for k in channels } # Combine spectra with all throughputs except for slit/slicer -TP = { k : throughput_spectrograph[k]*QE[k]*throughput_telescope for k in channels } +TP = { k : throughput_spectrograph[k]*throughput_telescope for k in channels } # Load throughput for slicer optics (either side of slit) throughput_slicerOptics = LoadCSVSpec(throughputFile_slicer) @@ -301,7 +300,8 @@ def SNRfunc_W(slitw_arcsec, SNRgoal=0): print( ' '.join(['%s=%s' % (k.upper(),v.round(3)) for (k,v) in result.items()]) ) if args.plotSNR: - result['plotSNR'] = computeSNR(t, slitw_result ,args, SSSfocalplane, allChans=True) + result['plotSNR'] = computeSNR(res_exptime, res_slitw ,args, SSSfocalplane, allChans=True) + result['SSSfocalplane'] = SSSfocalplane # return extra functions and data for plotting if ETCextras: return result, efffunc, SNRfunc @@ -371,17 +371,51 @@ def runETC(row ,check=False, skyspec=None): result_plot = main(args ,quiet=True ,plotSNR=True) SNR1 = result_plot['plotSNR'] - fig, ax = plt.subplots(figsize=(15,4)) + SSSfocalplane = result_plot['SSSfocalplane'] # signal, background, sharpness + # Access SIGNAL ct/s as e.g. SSSfocalplane(args.slit)[0]['R']['center'] + # breakpoint() binCenters = makeBinCenters(args.binspect) + + fig, axes = plt.subplots(3, 1, figsize=(15,9), sharex=True) + title = f'EXPTIME={result["exptime"].round(3)} ; SLIT={result["slitwidth"].round(3)} ; ' + title += f'BINSPECT={args.binspect} ; BINSPAT={args.binspat}' + # plt.suptitle('EXPTIME = '+str(result['exptime'].round(3))) + plt.suptitle(title) + + # SNR + ax = axes[0] for k in channels: ax.plot(binCenters[k], SNR1[k] ,color=channelColor[k] ,label=k) - plt.ylabel('SNR / wavelength bin') - plt.legend() + ax.set_ylabel('SNR / wavelength bin') + ax.legend() + ax.axvspan(args.wrange[0], args.wrange[1], alpha=0.2, color='grey') # shade user range + + # Counts + ax = axes[1] + for k in channels: + y = SSSfocalplane(args.slit)[0][k]['center']*args.ETCfixed # total counts in center slit + ax.plot(binCenters[k], y ,color=channelColor[k] ,label=k) + + ax.set_ylabel('Center signal e-') + ax.legend() ax.axvspan(args.wrange[0], args.wrange[1], alpha=0.2, color='grey') # shade user range - plt.title('EXPTIME = '+str(result['exptime'].round(3))) - plt.savefig('plotSNR.png') + + # Background + ax = axes[2] + for k in channels: + y = SSSfocalplane(args.slit)[1][k]['center']*args.ETCfixed*args.binspat # total counts per background pixel + ax.plot(binCenters[k], y ,color=channelColor[k] ,label=k) + + ax.set_ylabel('Center background e-') + ax.legend() + ax.axvspan(args.wrange[0], args.wrange[1], alpha=0.2, color='grey') # shade user range + + # Save + plt.tight_layout() + plt.show() + #plt.savefig('plotSNR.png') print('Wrote', 'plotSNR.png') if args.plotslit: diff --git a/pygui/ETC/requirements.txt b/pygui/ETC/requirements.txt deleted file mode 100644 index 7d8b3ffa..00000000 --- a/pygui/ETC/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -astropy==7.0.0 -matplotlib==3.10.0 -numpy==2.2.1 -scipy==1.15.0 -synphot==1.5.0 diff --git a/pygui/ETC/test.py b/pygui/ETC/test.py new file mode 100644 index 00000000..95da5370 --- /dev/null +++ b/pygui/ETC/test.py @@ -0,0 +1,21 @@ +from muchospec_etc.main import main +from muchospec_etc.arguments import parser, check_inputs_add_units + +# Minimal valid argument set +cmd = """ +G 500 510 SNR 10 +-slit SET 0.5 +-seeing 1 500 +-airmass 1 +-skymag 21.4 +-mag 18 +-magsystem AB +-magfilter match +""" + +args = parser.parse_args(cmd.split()) +check_inputs_add_units(args) + +result = main(args, quiet=True) + +print(result) diff --git a/pygui/calib/thrufocus b/pygui/calib/thrufocus index 2a1bb0e9..c330f156 100755 --- a/pygui/calib/thrufocus +++ b/pygui/calib/thrufocus @@ -31,6 +31,10 @@ camera exptime 10000 # 3. Camera BOI camera boi R 410 200 camera boi I 580 200 +camera boi G 360 200 +### Add G channel BOI +### Add U channel BOI once BOI with binning works. + # 3.5 Get some information from the camera and set some information imnum0=(`camera imnum`[1]) @@ -41,16 +45,21 @@ focusbase="focus_internal_`date +%g%m%d_%H%M%S`" camera basename $focusbase # 4. Turn on lamp and wait -fociI=( 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 ) +fociI=( 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 ) fociR=( 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 ) +fociG=( 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 ) +### Add fociU focpos="1 2 3 4 5 6 7 8 9 10 11 12" echo $foci for fp in $focpos; do # set the focus # focus set I $focus - echo " FOC I ${fociI[$fp]} R ${fociR[$fp]} No `camera imnum`" + echo " FOC I ${fociI[$fp]} R ${fociR[$fp]} G ${fociG[$fp]} No `camera imnum`" focus set I ${fociI[$fp]} focus set R ${fociR[$fp]} + focus set G ${fociG[$fp]} + ### focus set G ${fociG[$fp]} + ### focus set U ..... echo sleep 4 imnum1=(`camera imnum`[1]) @@ -75,17 +84,30 @@ calib set door=close # revert BOI camera boi R full camera boi I full +camera boi G full + +#Add camera boi U full + +# now set the foci to nominal values, just because we can + +focus set G 3.35 +focus set R 2.45 +focus set I 4.75 + # now run the analysis script. + + + # now display the results allfiles="$focusbase*.fits" cd /home/observer/focus/ -/home/developer/Software/run/focus_spec.py /data/latest/$allfiles -fa x -fk FOCUS --range $imnum0 $imnum1 +/home/developer/Software/run/focus_spec.py /data/latest/$allfiles -fa x -fk FOCUS -G /home/observer/focus/gfocus.reg -eog focus_spec_*.png +eog focus_spec_?.png echo "Done." diff --git a/pygui/control_tab.py b/pygui/control_tab.py index 7758a06b..860e6445 100644 --- a/pygui/control_tab.py +++ b/pygui/control_tab.py @@ -22,9 +22,7 @@ def __init__(self, parent): # services self.logic_service = LogicService(self.parent) - # ----------------------------- - # Style helpers (centralized) - # ----------------------------- + # Style helpers def _style_enabled_green(self, btn: QPushButton): btn.setEnabled(True) btn.setStyleSheet(""" @@ -74,9 +72,8 @@ def _apply_shutdown_style(self): self.startup_shutdown_button.setText("Shutdown") self._style_black(self.startup_shutdown_button) - # ----------------------------- + # UI construction - # ----------------------------- def create_control_tab(self): control_layout = QVBoxLayout() @@ -286,9 +283,7 @@ def create_row5(self): row5_widget.setLayout(row5_layout) return row5_widget - # ----------------------------- - # Utility wiring - # ----------------------------- + # Utils def add_separator_line(self, layout): """Thin divider line between rows.""" separator = QFrame() @@ -307,9 +302,8 @@ def connect_input_fields(self): self.bin_spect_box.textChanged.connect(self.on_input_changed) self.bin_spat_box.textChanged.connect(self.on_input_changed) - # ----------------------------- + # Button slots / actions - # ----------------------------- def on_repeat_button_click(self): print("Repeating now...") self.parent.send_command("repeat\n") @@ -438,11 +432,10 @@ def on_abort_button_click(self): self._style_disabled_gray(self.offset_to_target_button) self._style_disabled_gray(self.continue_button) - # ----------------------------- - # DB update helpers (unchanged logic) - # ----------------------------- + def on_confirm_changes(self): - """Confirm input changes and push updates; also enables Go button.""" + """Confirm input changes, update DB, update GUI row, enable Go button.""" + exposure_time = self.exposure_time_box.text() slit_width = self.slit_width_box.text() slit_angle = self.slit_angle_box.text() @@ -450,9 +443,13 @@ def on_confirm_changes(self): bin_spect = self.bin_spect_box.text() bin_spat = self.bin_spat_box.text() + + # DB Updates if exposure_time and slit_width and slit_angle and num_of_exposures and bin_spect and bin_spat: - print(f"Confirmed Exposure Time: {exposure_time}, Slit Width: {slit_width}, " - f"Slit Angle: {slit_angle}, Number of Exposures: {num_of_exposures}") + print( + f"Confirmed Exposure Time: {exposure_time}, Slit Width: {slit_width}, " + f"Slit Angle: {slit_angle}, Number of Exposures: {num_of_exposures}" + ) self.on_exposure_time_changed() self.on_slit_width_changed() self.on_slit_angle_changed() @@ -462,7 +459,10 @@ def on_confirm_changes(self): self._style_disabled_gray(self.confirm_button) elif exposure_time and slit_width: - print(f"Confirmed Exposure Time: {exposure_time}, Slit Width: {slit_width}, Slit Angle: {slit_angle}") + print( + f"Confirmed Exposure Time: {exposure_time}, " + f"Slit Width: {slit_width}, Slit Angle: {slit_angle}" + ) self.on_exposure_time_changed() self.on_slit_width_changed() QSound.play("sound/exposure_slit_width_set.wav") @@ -488,10 +488,39 @@ def on_confirm_changes(self): else: print("Please enter valid values for all fields.") - if getattr(self.parent, "current_target_list_name", None): - print(f"Current target list: {self.parent.current_target_list_name}") - self.logic_service.update_target_table_with_list(self.parent.current_target_list_name) + # Update the selected row in the table + table = self.parent.layout_service.target_list_display + selected = table.selectionModel().selectedRows() + + if selected: + row = selected[0].row() + + headers = [ + table.horizontalHeaderItem(i).text() + for i in range(table.columnCount()) + ] + + if "EXPTIME" in headers and exposure_time: + col = headers.index("EXPTIME") + table.item(row, col).setText("SET " + exposure_time) + + if "SLITWIDTH" in headers and slit_width: + col = headers.index("SLITWIDTH") + table.item(row, col).setText("SET " + slit_width) + + if "NEXP" in headers and num_of_exposures: + col = headers.index("NEXP") + table.item(row, col).setText(num_of_exposures) + + if "BINSPECT" in headers and bin_spect: + col = headers.index("BINSPECT") + table.item(row, col).setText(bin_spect) + + if "BINSPAT" in headers and bin_spat: + col = headers.index("BINSPAT") + table.item(row, col).setText(bin_spat) + # Enable Go button self._style_enabled_green(self.go_button) def on_exposure_time_changed(self): diff --git a/pygui/etc_popup.py b/pygui/etc_popup.py index a70ea9b0..9d82406d 100644 --- a/pygui/etc_popup.py +++ b/pygui/etc_popup.py @@ -1,340 +1,634 @@ -from PyQt5.QtWidgets import QDialog, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit, QComboBox, QCheckBox, QPushButton, QSpacerItem, QSizePolicy, QFrame +from PyQt5.QtWidgets import ( + QDialog, QVBoxLayout, QHBoxLayout, QGridLayout, + QLabel, QLineEdit, QComboBox, QCheckBox, + QPushButton, QSizePolicy, QFrame +) from PyQt5.QtCore import Qt -import subprocess import re +import subprocess class EtcPopup(QDialog): + def __init__(self, parent=None): super().__init__(parent) - + + self.FIELD_HEIGHT = 34 + self.FIELD_WIDTH = 220 + self.LABEL_WIDTH = 150 + self.INPUT_COLUMN_OFFSET = 190 + self.setWindowTitle("ETC") - self.setFixedSize(600, 600) # Increased width for better alignment + self.resize(900, 700) - # Main layout for the dialog - self.main_layout = QVBoxLayout() - self.main_layout.setSpacing(12) - self.main_layout.setContentsMargins(10, 10, 10, 10) + self.main_layout = QVBoxLayout(self) + self.main_layout.setContentsMargins(20, 20, 20, 20) + self.main_layout.setSpacing(14) + + self.channel_ranges = { + "U": ("3250", "4330"), + "G": ("4330", "5850"), + "R": ("5850", "7600"), + "I": ("7700", "9340"), + } - # Initialize the form components self.init_widgets() self.init_layout() - self.setLayout(self.main_layout) def init_widgets(self): - """Initialize all the widgets needed for the form.""" - # Create input fields and widgets - self.magnitude_input = QLineEdit() - self.filter_dropdown = QComboBox() - self.filter_dropdown.addItems(["U", "G", "R", "I"]) - self.system_field = QLineEdit("AB") - self.system_field.setReadOnly(True) - - self.sky_mag_input = QLineEdit() - self.snr_input = QLineEdit() - - self.slit_width_input = QLineEdit() - self.slit_dropdown = QComboBox() - self.slit_dropdown.addItems(["SET", "LOSS", "SNR", "RES", "AUTO"]) - - self.range_input_start = QLineEdit() - self.range_input_end = QLineEdit() + + def line(): + w = QLineEdit() + w.setMinimumHeight(self.FIELD_HEIGHT) + w.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) + return w + def combo(items): + c = QComboBox() + c.addItems(items) + + c.setMinimumHeight(self.FIELD_HEIGHT) + c.setFixedWidth(self.FIELD_WIDTH) + + c.setMaxVisibleItems(4) # exactly the number of items + c.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength) + + return c + + self.exptime_input = line() + self.snr_input = line() + + self.snr_mode = QComboBox() + self.snr_mode.addItems([ + "Fixed EXPTIME", + "Solve for EXPTIME" + ]) + self.snr_mode.setMinimumHeight(self.FIELD_HEIGHT) + self.slit_width_input = line() + self.resolution_input = line() + self.res_mode = QComboBox() + self.res_mode.addItems([ + "Fixed slit width", + "RES", + "AUTO" + ]) + self.res_mode.setMinimumHeight(self.FIELD_HEIGHT) + + self.channel_dropdown = combo(["R", "I", "U", "G"]) + self.channel_dropdown.currentTextChanged.connect(self.update_channel_range) + self.spatial_dropdown = combo(["1", "2", "3", "4", "5", "6"]) + self.spectral_dropdown = combo(["1", "2", "3", "4", "5", "6"]) + self.extract_dropdown = combo(["PSF", "2px", "4px", "6px", "8px", "10px"]) + + self.range_start = line() + self.range_end = line() + self.no_slicer_checkbox = QCheckBox("No Slicer") + self.no_slicer_checkbox.setChecked(True) + self.no_slicer_checkbox.setMinimumHeight(self.FIELD_HEIGHT) + + self.seeing_input = line() + self.seeing_wavelength = line() + self.sky_mag_input = line() + self.airmass_input = line() - self.seeing_input = QLineEdit() - self.airmass_input = QLineEdit() + self.magnitude_input = line() + self.abvega_dropdown = combo(["AB", "VEGA"]) + self.filter_dropdown = combo(["match", "U", "V", "R", "I"]) - self.exptime_input = QLineEdit() - self.resolution_input = QLineEdit() + self.extended_checkbox = QCheckBox("Extended Source") + self.extended_checkbox.setMinimumHeight(self.FIELD_HEIGHT) + + self.expert_field = line() + self.expert_field.setMaximumWidth(400) + self.expert_field.setPlaceholderText("Advanced parameters (for power users)") - # Buttons self.run_button = QPushButton("Run ETC") - self.save_button = QPushButton("Save") - self.save_button.setEnabled(False) # Initially disable the Save button + self.save_button = QPushButton("Apply to Target") - def init_layout(self): - """Add widgets to the layout.""" - # Add input rows for each section - self.main_layout.addLayout(self.create_input_row("Magnitude:", self.magnitude_input, self.filter_dropdown, self.system_field)) - - # Call create_sky_mag_snr_layout for Sky Mag and SNR fields - self.main_layout.addLayout(self.create_sky_mag_snr_layout()) - - self.main_layout.addLayout(self.create_input_row("Slit Width:", self.slit_width_input, self.slit_dropdown)) - self.main_layout.addLayout(self.create_range_layout()) - - # Modified the "Seeing" and "Airmass" row - self.main_layout.addLayout(self.create_seeing_airmass_layout()) - - # Modified the "Exp Time" and "Resolution" row - self.main_layout.addLayout(self.create_exptime_resolution_layout()) - - # Add a divider line - divider_line = QFrame() - divider_line.setFrameShape(QFrame.HLine) - divider_line.setFrameShadow(QFrame.Sunken) - self.main_layout.addWidget(divider_line) - - # Add buttons - self.add_buttons() - - # Add a spacer to ensure widgets aren't squished - spacer = QSpacerItem(20, 30, QSizePolicy.Minimum, QSizePolicy.Expanding) - self.main_layout.addItem(spacer) - - def create_input_row(self, label_text, *widgets): - """Create a horizontal layout with a label and widgets.""" - row_layout = QHBoxLayout() - label = self.create_aligned_label(label_text) - row_layout.addWidget(label) - for widget in widgets: - row_layout.addWidget(widget) - widget.setFixedHeight(35) - widget.setFixedWidth(110) - widget.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - return row_layout - - def create_sky_mag_snr_layout(self): - """Create a layout for Sky Mag and SNR with labels next to the input fields.""" - layout = QHBoxLayout() - - # Add Sky Mag label and input - sky_mag_label = self.create_aligned_label("Sky Mag:") - layout.addWidget(sky_mag_label) - layout.addWidget(self.sky_mag_input) - - # Add SNR label and input next to it - snr_label = self.create_aligned_label("SNR:") - layout.addWidget(snr_label) - layout.addWidget(self.snr_input) - - self.sky_mag_input.setFixedHeight(35) - self.sky_mag_input.setFixedWidth(110) - self.snr_input.setFixedHeight(35) - self.snr_input.setFixedWidth(110) - - return layout - - def create_seeing_airmass_layout(self): - """Create a layout for 'Seeing' and 'Airmass' next to each other.""" - layout = QHBoxLayout() - - # Add Seeing label and input - seeing_label = self.create_aligned_label("Seeing:") - layout.addWidget(seeing_label) - layout.addWidget(self.seeing_input) + self.run_button.setFixedSize(160, 50) + self.save_button.setFixedSize(160, 50) + self.run_button.clicked.connect(self.run_etc) + self.save_button.clicked.connect(self.save_etc) - # Add Airmass label and input next to it - airmass_label = self.create_aligned_label("Airmass:") - layout.addWidget(airmass_label) - layout.addWidget(self.airmass_input) + self.snr_mode.currentIndexChanged.connect(self.update_exptime_mode) + self.res_mode.currentIndexChanged.connect(self.update_resolution_mode) + self.extract_dropdown.currentTextChanged.connect(self.update_extract_mode) + + self.error_label = QLabel("") + self.error_label.setStyleSheet(""" + QLabel { + color: #cc0000; + font-weight: bold; + } + """) + self.error_label.setWordWrap(True) + + self.target_label = QLabel("No target selected") + self.target_label.setStyleSheet(""" + QLabel { + font-weight: bold; + font-size: 14px; + color: #dddddd; + } + """) + self.target_label.setAlignment(Qt.AlignCenter) + # initialize state + self.update_exptime_mode() + self.update_resolution_mode() - self.seeing_input.setFixedHeight(35) - self.seeing_input.setFixedWidth(110) - self.airmass_input.setFixedHeight(35) - self.airmass_input.setFixedWidth(110) + # Default ETC values + self.channel_dropdown.setCurrentText("R") + self.filter_dropdown.setCurrentText("match") + self.extract_dropdown.setCurrentText("8px") + self.spatial_dropdown.setCurrentText("2") - return layout + self.seeing_input.setText("1.5") + self.seeing_wavelength.setText("6400") + self.seeing_wavelength.setEnabled(False) + self.airmass_input.setText("1") + self.sky_mag_input.setText("21.4") + self.magnitude_input.setText("18") - def create_exptime_resolution_layout(self): - """Create a layout for 'Exp Time' and 'Resolution' next to each other.""" - layout = QHBoxLayout() - - # Add Exp Time label and input - exptime_label = self.create_aligned_label("Exp Time:") - layout.addWidget(exptime_label) - layout.addWidget(self.exptime_input) - - # Add Resolution label and input next to it - resolution_label = self.create_aligned_label("Resolution:") - layout.addWidget(resolution_label) - layout.addWidget(self.resolution_input) - - self.exptime_input.setFixedHeight(35) - self.exptime_input.setFixedWidth(110) - self.resolution_input.setFixedHeight(35) - self.resolution_input.setFixedWidth(110) - - return layout - - def create_range_layout(self): - """Create the range row layout.""" - range_layout = QHBoxLayout() - range_layout.setSpacing(10) - range_layout.addWidget(self.create_aligned_label("Range:")) - range_layout.addWidget(self.range_input_start) - range_layout.addWidget(QLabel("-")) - range_layout.addWidget(self.range_input_end) - range_layout.addWidget(self.no_slicer_checkbox) - return range_layout - - def create_aligned_label(self, text): - """Create a label with right alignment.""" - label = QLabel(text) - label.setFixedWidth(110) - label.setAlignment(Qt.AlignRight | Qt.AlignVCenter) - label.setStyleSheet("font-size: 14pt;") - return label - - def add_buttons(self): - """Add buttons to the layout.""" - button_row_layout = QHBoxLayout() - button_row_layout.setSpacing(10) - - self.run_button.setFixedSize(110, 45) - self.run_button.clicked.connect(self.run_etc) + self.update_channel_range(self.channel_dropdown.currentText()) - self.save_button.setFixedSize(100, 45) - self.save_button.clicked.connect(self.save_etc) + def label(self, text): + l = QLabel(text) + l.setFixedWidth(self.LABEL_WIDTH) + return l + + def hline(self): + line = QFrame() + line.setFrameShape(QFrame.HLine) + line.setStyleSheet("color:#555;margin-top:10px;margin-bottom:10px;") + return line + + def etc_row(self, l_label=None, l_widget=None, r_label=None, r_widget=None): + + row = QHBoxLayout() + row.setSpacing(10) + + def label(text): + lab = QLabel(text) + lab.setFixedWidth(self.INPUT_COLUMN_OFFSET) + return lab + + if l_label: + row.addWidget(label(l_label)) + + if l_widget: + row.addWidget(l_widget) + + if r_label: + row.addSpacing(60) + row.addWidget(label(r_label)) + + if r_widget: + row.addWidget(r_widget) + + row.addStretch() + + return row + + def init_layout(self): + + L = self.main_layout + L.addWidget(self.target_label) + L.addWidget(self.hline()) + + # EXPOSURE + exp = QGridLayout() + exp.setHorizontalSpacing(24) + exp.setVerticalSpacing(14) + + exp.setColumnMinimumWidth(0, 180) + exp.setColumnMinimumWidth(2, 140) + + exp.setColumnStretch(1, 1) + exp.setColumnStretch(3, 1) + + # Row 1 + exp.addWidget(self.label("Exp. Time (s)"), 0, 0) + exp.addWidget(self.exptime_input, 0, 1) + + exp.addWidget(self.label("SNR"), 0, 2) + exp.addWidget(self.snr_input, 0, 3) + exp.addWidget(self.snr_mode, 0, 4) + + # Row 2 + exp.addWidget(self.label("Slit width (arcsec)"), 1, 0) + exp.addWidget(self.slit_width_input, 1, 1) + + exp.addWidget(self.label("Resolution"), 1, 2) + exp.addWidget(self.resolution_input, 1, 3) + exp.addWidget(self.res_mode, 1, 4) + + L.addLayout(exp) + L.addWidget(self.hline()) + + # CHANNEL / CCD + chan = QGridLayout() + chan.setHorizontalSpacing(40) + chan.setVerticalSpacing(16) + + chan.addWidget(QLabel("Channel"), 0, 0) + chan.addWidget(self.channel_dropdown, 0, 1) + + snr = QHBoxLayout() + snr.addWidget(self.range_start) + snr.addWidget(self.range_end) + + chan.addWidget(QLabel("SNR Range (Å)"), 1, 0) + chan.addLayout(snr, 1, 1) + + chan.addWidget(self.no_slicer_checkbox, 2, 0) + + chan.addWidget(QLabel("Bin Spatial"), 0, 2) + chan.addWidget(self.spatial_dropdown, 0, 3) + + chan.addWidget(QLabel("Bin Spectral"), 1, 2) + chan.addWidget(self.spectral_dropdown, 1, 3) + + chan.addWidget(QLabel("Extract Spatial"), 2, 2) + chan.addWidget(self.extract_dropdown, 2, 3) + + L.addLayout(chan) + L.addWidget(self.hline()) + + # CONDITIONS + cond = QGridLayout() + cond.setHorizontalSpacing(40) + cond.setVerticalSpacing(16) + + cond.addWidget(QLabel("Seeing (arcsec)"), 0, 0) + cond.addWidget(self.seeing_input, 0, 1) + + cond.addWidget(QLabel("Seeing Pivot (Å)"), 0, 2) + cond.addWidget(self.seeing_wavelength, 0, 3) + + cond.addWidget(QLabel("Sky (mag/arcsec²)"), 1, 0) + cond.addWidget(self.sky_mag_input, 1, 1) + + cond.addWidget(QLabel("Airmass"), 1, 2) + cond.addWidget(self.airmass_input, 1, 3) + + L.addLayout(cond) + L.addWidget(self.hline()) + + # TARGET MODEL + target = QGridLayout() + target.setHorizontalSpacing(40) + target.setVerticalSpacing(16) + + target.addWidget(QLabel("Magnitude"), 0, 0) + target.addWidget(self.magnitude_input, 0, 1) + + target.addWidget(QLabel("AB/Vega"), 0, 2) + target.addWidget(self.abvega_dropdown, 0, 3) + + target.addWidget(QLabel("Filter"), 0, 4) + target.addWidget(self.filter_dropdown, 0, 5) + + target.addWidget(self.extended_checkbox, 1, 0) - button_row_layout.addWidget(self.run_button) - button_row_layout.addWidget(self.save_button) + target.addWidget(QLabel("Expert"), 1, 2) + target.addWidget(self.expert_field, 1, 3, 1, 3) - # Add a spacer after the buttons to create margin below - spacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - button_row_layout.addItem(spacer) + L.addLayout(target) + L.addWidget(self.hline()) - self.main_layout.addLayout(button_row_layout) + L.addWidget(self.error_label) + # BUTTONS + btn = QHBoxLayout() + btn.addStretch() + btn.addWidget(self.run_button) + btn.addSpacing(60) + btn.addWidget(self.save_button) + btn.addStretch() + + L.addLayout(btn) + + def update_exptime_mode(self): + + mode = self.snr_mode.currentText() + + if mode == "Fixed EXPTIME": + self.set_field_state(self.exptime_input, True) + self.set_field_state(self.snr_input, False) + + else: + self.set_field_state(self.exptime_input, False) + self.set_field_state(self.snr_input, True) + + def update_resolution_mode(self): + + mode = self.res_mode.currentText() + + if mode == "Fixed slit width": + self.set_field_state(self.slit_width_input, True) + self.set_field_state(self.resolution_input, False) + + elif mode == "RES": + self.set_field_state(self.slit_width_input, False) + self.set_field_state(self.resolution_input, True) + + else: # AUTO + self.set_field_state(self.slit_width_input, False) + self.set_field_state(self.resolution_input, False) + + def set_field_state(self, field, enabled): + + field.setEnabled(enabled) + + if enabled: + field.setStyleSheet("") + else: + field.clear() + field.setStyleSheet(""" + QLineEdit { + border: 1px solid #cccccc; + } + """) + + def update_channel_range(self, channel): + + if channel in self.channel_ranges: + + start, end = self.channel_ranges[channel] + + self.range_start.setText(start) + self.range_end.setText(end) + + def update_extract_mode(self, mode): + if mode == "PSF": + self.no_slicer_checkbox.setChecked(True) + def validate_inputs(self): - """Validates user inputs in the ETC tab and highlights invalid fields.""" - - # Helper function to check if the input is a valid float and not empty + """Validate numeric inputs and highlight invalid fields.""" + def is_valid_float(text): - if text.strip() == '': # Check if the text is empty + if text.strip() == "": return False try: - float(text) # Try to convert to float + float(text) return True except ValueError: - return False # Return False if the conversion fails - - # Reset all fields to default state (clear previous error highlighting) - self.magnitude_input.setStyleSheet("") - self.sky_mag_input.setStyleSheet("") - self.snr_input.setStyleSheet("") - self.slit_width_input.setStyleSheet("") - self.range_input_start.setStyleSheet("") - self.range_input_end.setStyleSheet("") - + return False + + fields = [ + self.magnitude_input, + self.sky_mag_input, + self.snr_input, + self.slit_width_input, + self.range_start, + self.range_end, + self.seeing_input, + self.airmass_input, + ] + + # clear previous errors + for f in fields: + f.setStyleSheet("") + try: - # Check if all numeric inputs are valid + if not is_valid_float(self.magnitude_input.text()): - self.magnitude_input.setStyleSheet("border: 1px solid red;") # Highlight invalid field - raise ValueError("Magnitude must be a valid number.") - magnitude = float(self.magnitude_input.text()) + self.magnitude_input.setStyleSheet("border:1px solid red;") + raise ValueError("Magnitude must be a number") if not is_valid_float(self.sky_mag_input.text()): - self.sky_mag_input.setStyleSheet("border: 1px solid red;") # Highlight invalid field - raise ValueError("Sky Mag must be a valid number.") - sky_mag = float(self.sky_mag_input.text()) - - if not is_valid_float(self.snr_input.text()): - self.snr_input.setStyleSheet("border: 1px solid red;") # Highlight invalid field - raise ValueError("SNR must be a valid number.") - snr = float(self.snr_input.text()) - - if not is_valid_float(self.slit_width_input.text()): - self.slit_width_input.setStyleSheet("border: 1px solid red;") # Highlight invalid field - raise ValueError("Slit Width must be a valid number.") - slit_width = float(self.slit_width_input.text()) - - if not is_valid_float(self.range_input_start.text()): - self.range_input_start.setStyleSheet("border: 1px solid red;") # Highlight invalid field - raise ValueError("Range Start must be a valid number.") - range_start = float(self.range_input_start.text()) - - if not is_valid_float(self.range_input_end.text()): - self.range_input_end.setStyleSheet("border: 1px solid red;") # Highlight invalid field - raise ValueError("Range End must be a valid number.") - range_end = float(self.range_input_end.text()) - - # Ensure range_start is less than range_end - if range_start >= range_end: - self.range_input_start.setStyleSheet("border: 1px solid red;") # Highlight invalid field - self.range_input_end.setStyleSheet("border: 1px solid red;") # Highlight invalid field - raise ValueError("Range start must be less than range end.") - - # Check for valid values (you can adjust this for your specific needs) - if magnitude <= 0 or sky_mag <= 0 or snr <= 0 or slit_width <= 0: - raise ValueError("Magnitude, Sky Mag, SNR, and Slit Width must be positive values.") - + self.sky_mag_input.setStyleSheet("border:1px solid red;") + raise ValueError("Sky Mag must be a number") + + if self.snr_input.isEnabled(): + if not is_valid_float(self.snr_input.text()): + self.snr_input.setStyleSheet("border:1px solid red;") + raise ValueError("SNR must be a number") + + if self.slit_width_input.isEnabled(): + if not is_valid_float(self.slit_width_input.text()): + self.slit_width_input.setStyleSheet("border:1px solid red;") + raise ValueError("Slit width must be a number") + + if not is_valid_float(self.range_start.text()): + self.range_start.setStyleSheet("border:1px solid red;") + raise ValueError("Range start must be a number") + + if not is_valid_float(self.range_end.text()): + self.range_end.setStyleSheet("border:1px solid red;") + raise ValueError("Range end must be a number") + + if self.resolution_input.isEnabled(): + if not is_valid_float(self.resolution_input.text()): + self.resolution_input.setStyleSheet("border:1px solid red;") + raise ValueError("Resolution must be a number") + + start = float(self.range_start.text()) + end = float(self.range_end.text()) + + if start >= end: + self.range_start.setStyleSheet("border:1px solid red;") + self.range_end.setStyleSheet("border:1px solid red;") + raise ValueError("Range start must be less than range end") + self.save_button.setEnabled(True) - return True # All inputs are valid + return True except ValueError as e: - # Show error message - error_msg = f"Invalid input: {str(e)}" - print(error_msg) - return False # Input is invalid - + print(f"Invalid input: {e}") + return False def run_etc(self): - """Handles the logic for the 'Run ETC' button.""" - - # Validate inputs before running the command - if not self.validate_inputs(): - return # If inputs are invalid, do not proceed - - # Collecting all necessary data from input fields - filter_value = self.filter_dropdown.currentText() # e.g., "G" - magnitude_value = self.magnitude_input.text() # e.g., "18.0" - sky_mag_value = self.sky_mag_input.text() # e.g., "21.4" - snr_value = self.snr_input.text() # e.g., "10" - slit_width_value = self.slit_width_input.text() # e.g., "0.5" - slit_option = self.slit_dropdown.currentText() # e.g., "SET X" - seeing_value = self.seeing_input.text() - airmass_value = self.airmass_input.text() - mag_system_value = self.system_field.text() # e.g., "AB" - mag_filter_value = "match" # e.g., "match" - - # Handling the range inputs - range_start_value = self.range_input_start.text() - range_end_value = self.range_input_end.text() - # Construct the command string - command = f"python3 ETC/ETC_main.py {filter_value} {range_start_value} {range_end_value} SNR {snr_value} " \ - f"-slit {slit_option} {slit_width_value} -seeing {seeing_value} 500 -airmass {airmass_value} " \ - f"-skymag {sky_mag_value} -mag {magnitude_value} -magsystem {mag_system_value} -magfilter {mag_filter_value}" + if not self.validate_inputs(): + return + self.error_label.setText("") + + channel = self.channel_dropdown.currentText() + + wrange_start = str(float(self.range_start.text()) / 10) + wrange_end = str(float(self.range_end.text()) / 10) + + mag = self.magnitude_input.text() + magsystem = self.abvega_dropdown.currentText() + magfilter = self.filter_dropdown.currentText() + + sky_mag = self.sky_mag_input.text() + seeing = self.seeing_input.text() + airmass = self.airmass_input.text() + + # EXPTIME / SNR solve mode + snr_mode = self.snr_mode.currentText() + + if snr_mode == "Fixed EXPTIME": + solve_param = "EXPTIME" + solve_value = self.exptime_input.text() + else: + solve_param = "SNR" + solve_value = self.snr_input.text() + + # SLIT / RESOLUTION mode + res_mode = self.res_mode.currentText() + + if res_mode == "Fixed slit width": + slit_mode = ["-slit", "SET", self.slit_width_input.text()] + + elif res_mode == "RES": + slit_mode = ["-slit", "RES", self.resolution_input.text()] + + else: + slit_mode = ["-slit", "AUTO"] + + + # Build command + cmd = [ + "python3", + "ETC/ETC_main.py", + channel, + wrange_start, + wrange_end, + solve_param, + solve_value, + *slit_mode, + "-seeing", seeing, "640", + "-airmass", airmass, + "-skymag", sky_mag, + "-mag", mag, + "-magsystem", magsystem, + "-magfilter", magfilter + ] + + # slicer option + if self.no_slicer_checkbox.isChecked(): + cmd.append("-noslicer") + + # binning options + cmd.extend(["-binspect", self.spectral_dropdown.currentText()]) + cmd.extend(["-binspat", self.spatial_dropdown.currentText()]) + # extract aperture -> fastSNR option + extract_mode = self.extract_dropdown.currentText() + + if extract_mode != "PSF": + fastsnr_value = int(extract_mode.replace("px", "")) // 2 + cmd.extend(["-fastSNR", str(fastsnr_value)]) + + # expert option + expert = self.expert_field.text().strip() + if expert: + cmd.extend(expert.split()) + + print("Running ETC command:") + print(" ".join(cmd)) - # Print the command for debugging - print(f"Running command: {command}") - - # Run the command and capture the output try: - result = subprocess.run(command, shell=True, capture_output=True, text=True) - output = result.stdout.strip() # Get the output from the command - print(f"Command output: {output}") - # Extract EXPTIME and RESOLUTION from the output using regex - exptime_match = re.search(r"EXPTIME=([0-9.]+) s", output) - resolution_match = re.search(r"RESOLUTION=([0-9.]+)", output) + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=True + ) + + output = result.stdout + print(output) + + exptime_match = re.search(r"EXPTIME=([0-9.]+)", output) + res_match = re.search(r"RESOLUTION=([0-9.]+)", output) + snr_match = re.search(r"SNR=([0-9.]+)", output) + slitwidth_match = re.search(r"SLITWIDTH=([0-9.]+)", output) if exptime_match: exptime = float(exptime_match.group(1)) - exptime_rounded = round(exptime) # Round EXPTIME to the nearest integer - self.exptime_input.setText(str(exptime_rounded)) # Update GUI field with rounded EXPTIME + self.exptime_input.setText(str(exptime)) - if resolution_match: - resolution = float(resolution_match.group(1)) - resolution_rounded = round(resolution) # Round RESOLUTION to the nearest integer - self.resolution_input.setText(str(resolution_rounded)) # Update GUI field with rounded RESOLUTION + if res_match: + resolution = float(res_match.group(1)) + self.resolution_input.setText(str(resolution)) + + if snr_match: + snr = float(snr_match.group(1)) + self.snr_input.setText(str(snr)) + + if slitwidth_match: + slitwidth = float(slitwidth_match.group(1)) + self.slit_width_input.setText(str(slitwidth)) except subprocess.CalledProcessError as e: - # Handle errors if the command fails - print(f"Error running ETC: {e}") - - # Display the result in the results display (GUI) - result_text = f"Running ETC with the following parameters:\n{command}\n\n" \ - f"EXPTIME: {self.exptime_input.text()}\n" \ - f"RESOLUTION: {self.resolution_input.text()}" - print(result_text) + + stderr = e.stderr or "" + + error_line = "" + + for line in stderr.splitlines(): + if "ETC_main.py: error:" in line: + error_line = line + break + + if error_line: + self.error_label.setText(error_line) + else: + self.error_label.setText("ETC failed. See terminal for details.") + + print("ETC failed") + print(e.stdout) + print(e.stderr) + self.save_button.setEnabled(True) def save_etc(self): + + # Prevent execution if no target selected + if not getattr(self.parent, "current_observation_id", None): + print("No target selected, ETC results cannot be applied.") + return + exptime = self.exptime_input.text() resolution = self.resolution_input.text() - if (self.parent.current_observation_id): - self.logic_service.send_update_to_db(self.parent.current_observation_id, "OTMexpt", exptime) - self.logic_service.send_update_to_db(self.parent.current_observation_id, "exptime", exptime) - self.logic_service.send_update_to_db(self.parent.current_observation_id, "OTMres", resolution) - self.save_button.setEnabled(False) + slit_width = self.slit_width_input.text() + + # Exposure time + self.logic_service.send_update_to_db( + self.parent.current_observation_id, "OTMexpt", exptime + ) + + self.logic_service.send_update_to_db( + self.parent.current_observation_id, "exptime", "SET " + exptime + ) + + # Resolution + self.logic_service.send_update_to_db( + self.parent.current_observation_id, "OTMres", resolution + ) + + # Slit width + if slit_width: + self.logic_service.send_update_to_db( + self.parent.current_observation_id, "OTMslitwidth", slit_width + ) + + self.logic_service.send_update_to_db( + self.parent.current_observation_id, "slitwidth", "SET " + slit_width + ) + + print("ETC values applied to target.") + + def load_target(self, target_data): + """ + Populate ETC fields from selected target. + target_data is a dict from the target table. + """ + + mag = target_data.get("MAG") + filt = target_data.get("FILTER") + + if mag: + self.magnitude_input.setText(str(mag)) + + if filt: + idx = self.filter_dropdown.findText(filt) + if idx >= 0: + self.filter_dropdown.setCurrentIndex(idx) + + def set_target_info(self, name, ra, dec): + + text = f"Target: {name} RA: {ra} Dec: {dec}" + self.target_label.setText(text) \ No newline at end of file diff --git a/pygui/layout_service.py b/pygui/layout_service.py index 84db5df2..e02087c8 100644 --- a/pygui/layout_service.py +++ b/pygui/layout_service.py @@ -1004,6 +1004,12 @@ def update_target_info(self): # Pass the dictionary of target data to LogicService print("Target Data:", target_data) # Print the full target data for the selected row # self.parent.logic_service.update_target_list_table(target_data) + if hasattr(self.parent, "etc_popup") and self.parent.etc_popup is not None: + self.parent.etc_popup.set_target_info( + target_data.get("NAME", ""), + target_data.get("RA", ""), + target_data.get("DECL", "") + ) # Call to set the column widths (adjust them as needed) self.set_column_widths() diff --git a/pygui/ngps_gui.py b/pygui/ngps_gui.py index 7bdcc47a..4ddb6ec1 100644 --- a/pygui/ngps_gui.py +++ b/pygui/ngps_gui.py @@ -299,9 +299,25 @@ def open_calibration_gui(self): self.calibration_gui.activateWindow() def open_etc_popup(self): - """Opens the EtcPopup when the button is clicked.""" - self.etc_popup = EtcPopup(self) # Pass the parent as the current MainWindow - self.etc_popup.exec_() + + if not hasattr(self, "etc_popup") or self.etc_popup is None: + self.etc_popup = EtcPopup(self) + + table = self.layout_service.target_list_display + selected = table.selectionModel().selectedRows() + + if selected: + row = selected[0].row() + + name = table.item(row, 0).text() + ra = table.item(row, 1).text() + dec = table.item(row, 2).text() + + self.etc_popup.set_target_info(name, ra, dec) + + self.etc_popup.show() + self.etc_popup.raise_() + self.etc_popup.activateWindow() def show_popup(self, message): """Show a popup message on the screen.""" @@ -460,6 +476,16 @@ def _init_daemon_polling(self): self.refresh_daemon_states_from_ps() self._daemon_timer.start() + def update_etc_target(self, target_data): + + if hasattr(self, "etc_popup") and self.etc_popup is not None: + + name = target_data.get("NAME", "") + ra = target_data.get("RA", "") + dec = target_data.get("DECL", "") + + self.etc_popup.set_target_info(name, ra, dec) + if __name__ == '__main__': app = QApplication(sys.argv)