# -*- coding: utf-8 -*- import numpy as np import scipy as scp import time from matplotlib import pyplot as plt print(" W e l c o m e t o ") print(" _ _ _ ___ ") print(" | |_| |_ ___ _ _ _ __ __ _| | _ \_ _ ") print(" | _| ' \/ -_) '_| ' \/ _` | | _/ || |") print(" \__|_||_\___|_| |_|_|_\__,_|_|_| \_, |") print(" |__/ ") print("Thermal camera parameters calculation tool") print("------------------------------------------") print("Please input parameters (leave empty for default value)") h = float(input("h (default = 6.63e-34): ") or 6.63e-34) c = float(input("c (m/s) (default = 2.99792458e8): ") or 2.99792458e8) k = float(input("h (default = 1.38e-23): ") or 1.38e-23) emiss = float(input("epsilon (default = 0.6): ") or 0.6) spixel = float(input("pixel surface (m^2)( default = 0.9e-9): ") or 0.9e-9) resolution = int(input("graph resolution (number of datapoints) (default = 100): ") or 100) rangeT = int(round(np.sqrt(resolution),0)) rangeTi = int(round(np.sqrt(resolution),0)) cqMax = float(input("camera max cq (default = 1.8e5): ") or 1.8e5) cqMin = float(input("pixel surface (default = 10% of cqMax): ") or cqMax*0.1) Tmin = float(input("min temp° (°C) (default = 500): ") or 500) Tmax = float(input("max temp° (°C) (default = 1500): ") or 1500) Timin = float(input("min exposure time (µs) (default = 5): ") or 5) Timax = float(input("max exposure time (µs) (default = 50): ") or 50) transfert = np.array([ [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, 1.36452E-15], [841, 0.012257803], [842, 0.024539314], [843, 0.036844534], [844, 0.049173463], [845, 0.0615261], [846, 0.073902446], [847, 0.0863025], [848, 0.098726263], [849, 0.111173734], [850, 0.123644914], [851, 0.125563652], [852, 0.127485839], [853, 0.129411475], [854, 0.131340559], [855, 0.133273091], [856, 0.135209072], [857, 0.137148502], [858, 0.13909138], [859, 0.141037707], [860, 0.142987482], [861, 0.144940706], [862, 0.146897378], [863, 0.148857498], [864, 0.150821068], [865, 0.152788085], [866, 0.154758552], [867, 0.156732466], [868, 0.15870983], [869, 0.160690641], [870, 0.162674902], [871, 0.164662611], [872, 0.166653768], [873, 0.168648374], [874, 0.170646428], [875, 0.172647931], [876, 0.174652883], [877, 0.176661282], [878, 0.178673131], [879, 0.180688428], [880, 0.182707173], [881, 0.184697447], [882, 0.186687719], [883, 0.188680743], [884, 0.19067652], [885, 0.19267505], [886, 0.194676332], [887, 0.196680368], [888, 0.198687155], [889, 0.200696696], [890, 0.202708989], [891, 0.204724036], [892, 0.206741834], [893, 0.208762386], [894, 0.21078569], [895, 0.212811747], [896, 0.214840557], [897, 0.216872119], [898, 0.218906434], [899, 0.220943502], [900, 0.222983322], [901, 0.227061621], [902, 0.231145654], [903, 0.235235421], [904, 0.239330924], [905, 0.243432161], [906, 0.247539134], [907, 0.251651841], [908, 0.255770283], [909, 0.259894459], [910, 0.264024371], [911, 0.268160017], [912, 0.272301398], [913, 0.276448515], [914, 0.280601365], [915, 0.284759951], [916, 0.288924272], [917, 0.293094327], [918, 0.297270117], [919, 0.301451642], [920, 0.305638902], [921, 0.309831897], [922, 0.314030626], [923, 0.318235091], [924, 0.32244529], [925, 0.326661224], [926, 0.330882892], [927, 0.335110296], [928, 0.339343435], [929, 0.343582308], [930, 0.347826916], [931, 0.352077259], [932, 0.356333337], [933, 0.360595149], [934, 0.364862697], [935, 0.369135979], [936, 0.373414996], [937, 0.377658607], [938, 0.381845791], [939, 0.386036544], [940, 0.390230867], [941, 0.394428758], [942, 0.398630219], [943, 0.402835249], [944, 0.407043849], [945, 0.411256017], [946, 0.415471755], [947, 0.419691062], [948, 0.423913939], [949, 0.428140384], [950, 0.432370399], [951, 0.435391195], [952, 0.438414488], [953, 0.441440281], [954, 0.444468571], [955, 0.447499361], [956, 0.450532648], [957, 0.453568434], [958, 0.456606719], [959, 0.459647502], [960, 0.462690783], [961, 0.465736563], [962, 0.468784842], [963, 0.471835619], [964, 0.474888894], [965, 0.477944668], [966, 0.481002941], [967, 0.484063711], [968, 0.487126981], [969, 0.490192748], [970, 0.493261015], [971, 0.496331779], [972, 0.499405043], [973, 0.502480804], [974, 0.505559064], [975, 0.508639823], [976, 0.51172308], [977, 0.514808836], [978, 0.51789709], [979, 0.520987842], [980, 0.524081093], [981, 0.527176843], [982, 0.530275091], [983, 0.533375837], [984, 0.536479082], [985, 0.539584825], [986, 0.542693067], [987, 0.545803807], [988, 0.548917046], [989, 0.552032783], [990, 0.555151019], [991, 0.558271753], [992, 0.561394986], [993, 0.564520717], [994, 0.567648946], [995, 0.570779675], [996, 0.573912901], [997, 0.577048626], [998, 0.58018685], [999, 0.583327571], [1000, 0.586470792], [1001, 0.586985348], [1002, 0.58750013], [1003, 0.587964196], [1004, 0.588403294], [1005, 0.58884255], [1006, 0.589281964], [1007, 0.589721536], [1008, 0.590161266], [1009, 0.590601154], [1010, 0.5910412], [1011, 0.591481404], [1012, 0.591921765], [1013, 0.592362285], [1014, 0.592802963], [1015, 0.593243798], [1016, 0.593684792], [1017, 0.594125944], [1018, 0.594567253], [1019, 0.59500872], [1020, 0.595450346], [1021, 0.595892129], [1022, 0.59633407], [1023, 0.59677617], [1024, 0.597218427], [1025, 0.597660842], [1026, 0.598103415], [1027, 0.598546146], [1028, 0.598989035], [1029, 0.599432082], [1030, 0.599875287], [1031, 0.60031865], [1032, 0.60076217], [1033, 0.601205849], [1034, 0.601649686], [1035, 0.60209368], [1036, 0.602537833], [1037, 0.602982144], [1038, 0.603426612], [1039, 0.603871239], [1040, 0.604316023], [1041, 0.604760965], [1042, 0.605206066], [1043, 0.605651324], [1044, 0.60609674], [1045, 0.606542314], [1046, 0.606988046], [1047, 0.607433936], [1048, 0.607879984], [1049, 0.60832619], [1050, 0.608772554], [1051, 0.609276116], [1052, 0.60977987], [1053, 0.610283816], [1054, 0.610787953], [1055, 0.611292283], [1056, 0.611793942], [1057, 0.612171792], [1058, 0.6125497], [1059, 0.612927667], [1060, 0.613305691], [1061, 0.613683774], [1062, 0.614061915], [1063, 0.614440114], [1064, 0.614818372], [1065, 0.615196687], [1066, 0.615575061], [1067, 0.615953493], [1068, 0.616331983], [1069, 0.616710531], [1070, 0.617089138], [1071, 0.617467802], [1072, 0.617846525], [1073, 0.618225306], [1074, 0.618604146], [1075, 0.618983043], [1076, 0.619361999], [1077, 0.619741013], [1078, 0.620120085], [1079, 0.620499215], [1080, 0.620878403], [1081, 0.62125765], [1082, 0.621636955], [1083, 0.622016318], [1084, 0.622395739], [1085, 0.622775218], [1086, 0.623154756], [1087, 0.623534351], [1088, 0.623914005], [1089, 0.624293717], [1090, 0.624673488], [1091, 0.625053316], [1092, 0.625433203], [1093, 0.625813148], [1094, 0.626193151], [1095, 0.626573212], [1096, 0.626953332], [1097, 0.627333509], [1098, 0.627713745], [1099, 0.628094039], [1100, 0.628474391], [1101, 0.62929014], [1102, 0.630106024], [1103, 0.630922045], [1104, 0.631738202], [1105, 0.632554496], [1106, 0.633370926], [1107, 0.634187493], [1108, 0.635004196], [1109, 0.635821035], [1110, 0.63663801], [1111, 0.637455122], [1112, 0.638272371], [1113, 0.639089756], [1114, 0.639907277], [1115, 0.640724934], [1116, 0.641542728], [1117, 0.642360659], [1118, 0.643178725], [1119, 0.643996929], [1120, 0.644815268], [1121, 0.645633744], [1122, 0.646452356], [1123, 0.647271105], [1124, 0.648049428], [1125, 0.648809148], [1126, 0.649568866], [1127, 0.650328581], [1128, 0.651088293], [1129, 0.651848003], [1130, 0.65260771], [1131, 0.653367415], [1132, 0.654127117], [1133, 0.654886817], [1134, 0.655646513], [1135, 0.656406208], [1136, 0.657165899], [1137, 0.657925589], [1138, 0.658685275], [1139, 0.659444959], [1140, 0.660204641], [1141, 0.660964319], [1142, 0.661723996], [1143, 0.662483669], [1144, 0.663243341], [1145, 0.664003009], [1146, 0.664762675], [1147, 0.665522338], [1148, 0.666281999], [1149, 0.667041657], [1150, 0.667801313], [1151, 0.668476434], [1152, 0.669151553], [1153, 0.66982667], [1154, 0.670501785], [1155, 0.671176897], [1156, 0.671852007], [1157, 0.672527114], [1158, 0.67320222], [1159, 0.673877323], [1160, 0.674552424], [1161, 0.675143027], [1162, 0.675719294], [1163, 0.676295361], [1164, 0.676871228], [1165, 0.677446895], [1166, 0.678022362], [1167, 0.678597629], [1168, 0.679172696], [1169, 0.679747564], [1170, 0.680322231], [1171, 0.680896699], [1172, 0.681470967], [1173, 0.682045034], [1174, 0.682618902], [1175, 0.683192571], [1176, 0.683766039], [1177, 0.684339307], [1178, 0.684912376], [1179, 0.685485244], [1180, 0.686057913], [1181, 0.686630382], [1182, 0.687202651], [1183, 0.68777472], [1184, 0.688346589], [1185, 0.688918259], [1186, 0.689489728], [1187, 0.690060998], [1188, 0.690632067], [1189, 0.691202937], [1190, 0.691773607], [1191, 0.692344077], [1192, 0.692914347], [1193, 0.693484417], [1194, 0.694054288], [1195, 0.694623958], [1196, 0.695193429], [1197, 0.6957627], [1198, 0.696331771], [1199, 0.696900642], [1200, 0.697469313], [1201, 0.698289844], [1202, 0.6991101], [1203, 0.699930081], [1204, 0.700749788], [1205, 0.70156922], [1206, 0.702388377], [1207, 0.703207259], [1208, 0.704025866], [1209, 0.704844198], [1210, 0.705662256], [1211, 0.706480039], [1212, 0.707297547], [1213, 0.70811478], [1214, 0.708931738], [1215, 0.709748421], [1216, 0.71056483], [1217, 0.711380963], [1218, 0.712196822], [1219, 0.713012406], [1220, 0.713827715], [1221, 0.71464275], [1222, 0.715457509], [1223, 0.716271994], [1224, 0.717086204], [1225, 0.717900139], [1226, 0.718713799], [1227, 0.719527184], [1228, 0.720340295], [1229, 0.721153131], [1230, 0.721965691], [1231, 0.722777977], [1232, 0.723589988], [1233, 0.724401725], [1234, 0.725213186], [1235, 0.726024373], [1236, 0.726835285], [1237, 0.727645922], [1238, 0.728456284], [1239, 0.729266371], [1240, 0.730076184], [1241, 0.730885721], [1242, 0.731694984], [1243, 0.732497169], [1244, 0.733264876], [1245, 0.734032205], [1246, 0.734799157], [1247, 0.735565732], [1248, 0.736331928], [1249, 0.737097748], [1250, 0.73786319], [1251, 0.738544897], [1252, 0.739226261], [1253, 0.739907281], [1254, 0.740587959], [1255, 0.741268293], [1256, 0.741948284], [1257, 0.742627932], [1258, 0.743307237], [1259, 0.743986199], [1260, 0.744664817], [1261, 0.745343092], [1262, 0.746021024], [1263, 0.746698613], [1264, 0.747375859], [1265, 0.748052761], [1266, 0.74872932], [1267, 0.749405536], [1268, 0.750081409], [1269, 0.750756938], [1270, 0.751432125], [1271, 0.752106968], [1272, 0.752781468], [1273, 0.753455625], [1274, 0.754129438], [1275, 0.754802909], [1276, 0.755476036], [1277, 0.75614882], [1278, 0.756821261], [1279, 0.757493358], [1280, 0.758165113], [1281, 0.758836524], [1282, 0.759507592], [1283, 0.760178317], [1284, 0.760848698], [1285, 0.761518737], [1286, 0.762188432], [1287, 0.762857784], [1288, 0.763526793], [1289, 0.764195458], [1290, 0.764863781], [1291, 0.76553176], [1292, 0.766199396], [1293, 0.766866689], [1294, 0.767533638], [1295, 0.768200245], [1296, 0.768866508], [1297, 0.769532428], [1298, 0.770198005], [1299, 0.770863239], [1300, 0.771528129], [1301, 0.77178018], [1302, 0.77203206], [1303, 0.772283768], [1304, 0.772535304], [1305, 0.772786669], [1306, 0.773037862], [1307, 0.773288884], [1308, 0.773539734], [1309, 0.773790412], [1310, 0.774040919], [1311, 0.774230086], [1312, 0.774410835], [1313, 0.774591339], [1314, 0.774771598], [1315, 0.774951611], [1316, 0.775131379], [1317, 0.775310902], [1318, 0.775490179], [1319, 0.775669211], [1320, 0.775847998], [1321, 0.776026539], [1322, 0.776204835], [1323, 0.776382886], [1324, 0.776560692], [1325, 0.776738252], [1326, 0.776915566], [1327, 0.777092636], [1328, 0.77726946], [1329, 0.777446039], [1330, 0.777622372], [1331, 0.77779846], [1332, 0.777974303], [1333, 0.7781499], [1334, 0.778325252], [1335, 0.778500359], [1336, 0.778675221], [1337, 0.778849837], [1338, 0.779024207], [1339, 0.779198333], [1340, 0.779372213], [1341, 0.779545848], [1342, 0.779719237], [1343, 0.779892381], [1344, 0.78006528], [1345, 0.780237934], [1346, 0.780410342], [1347, 0.780582504], [1348, 0.780754422], [1349, 0.780926094], [1350, 0.781097521], [1351, 0.781187363], [1352, 0.781277008], [1353, 0.781366457], [1354, 0.78145571], [1355, 0.781544767], [1356, 0.781633627], [1357, 0.781722291], [1358, 0.781810759], [1359, 0.78189903], [1360, 0.781987106], [1361, 0.782074985], [1362, 0.782162668], [1363, 0.782250154], [1364, 0.782337444], [1365, 0.782424538], [1366, 0.782511436], [1367, 0.782598137], [1368, 0.782684643], [1369, 0.782770951], [1370, 0.782857064], [1371, 0.78294298], [1372, 0.783028701], [1373, 0.783114224], [1374, 0.783199552], [1375, 0.783284683], [1376, 0.783369618], [1377, 0.783454357], [1378, 0.7835389], [1379, 0.783623246], [1380, 0.783707396], [1381, 0.78379135], [1382, 0.78387264], [1383, 0.783953234], [1384, 0.784033629], [1385, 0.784113826], [1386, 0.784193824], [1387, 0.784273624], [1388, 0.784353224], [1389, 0.784432626], [1390, 0.784511829], [1391, 0.784590834], [1392, 0.78466964], [1393, 0.784748247], [1394, 0.784826655], [1395, 0.784904865], [1396, 0.784982876], [1397, 0.785060688], [1398, 0.785138302], [1399, 0.785215717], [1400, 0.785292933], [1401, 0.785129629], [1402, 0.784966276], [1403, 0.784802873], [1404, 0.78463942], [1405, 0.784475917], [1406, 0.784312365], [1407, 0.784148763], [1408, 0.783985112], [1409, 0.783821411], [1410, 0.78365766], [1411, 0.783493859], [1412, 0.783330009], [1413, 0.783166109], [1414, 0.783002159], [1415, 0.78283816], [1416, 0.782674111], [1417, 0.782510013], [1418, 0.782345864], [1419, 0.782181666], [1420, 0.782017419], [1421, 0.781853122], [1422, 0.781688775], [1423, 0.781524378], [1424, 0.781359932], [1425, 0.781195436], [1426, 0.78103089], [1427, 0.780866295], [1428, 0.78070165], [1429, 0.780536955], [1430, 0.78037221], [1431, 0.780207416], [1432, 0.780042573], [1433, 0.779877679], [1434, 0.779712736], [1435, 0.779547743], [1436, 0.779382701], [1437, 0.779217609], [1438, 0.779052467], [1439, 0.778887276], [1440, 0.778722034], [1441, 0.778556744], [1442, 0.778391403], [1443, 0.778226013], [1444, 0.778060573], [1445, 0.777895084], [1446, 0.777729544], [1447, 0.777563732], [1448, 0.777393132], [1449, 0.777222481], [1450, 0.77705178], [1451, 0.777038754], [1452, 0.777025576], [1453, 0.777012247], [1454, 0.776998765], [1455, 0.776985131], [1456, 0.776971345], [1457, 0.776957407], [1458, 0.776943317], [1459, 0.776929075], [1460, 0.77691468], [1461, 0.776900134], [1462, 0.776885436], [1463, 0.776870585], [1464, 0.776855583], [1465, 0.776840429], [1466, 0.776825122], [1467, 0.776809664], [1468, 0.776794053], [1469, 0.77677829], [1470, 0.776762376], [1471, 0.776746309], [1472, 0.77673009], [1473, 0.776713719], [1474, 0.776697196], [1475, 0.776680522], [1476, 0.776663695], [1477, 0.776646716], [1478, 0.776629584], [1479, 0.776612301], [1480, 0.776594866], [1481, 0.776577279], [1482, 0.77655954], [1483, 0.776541648], [1484, 0.776523605], [1485, 0.776505409], [1486, 0.776487062], [1487, 0.776468562], [1488, 0.776449911], [1489, 0.776431107], [1490, 0.776412152], [1491, 0.776393044], [1492, 0.776373784], [1493, 0.776354372], [1494, 0.776334808], [1495, 0.776315092], [1496, 0.776295224], [1497, 0.776275204], [1498, 0.776255032], [1499, 0.776234708], [1500, 0.776214232], [1501, 0.776193604], [1502, 0.776172823], [1503, 0.776151891], [1504, 0.776130807], [1505, 0.77610957], [1506, 0.776088182], [1507, 0.776066641], [1508, 0.776044949], [1509, 0.776023104], [1510, 0.776001107], [1511, 0.775978959], [1512, 0.775950313], [1513, 0.775916786], [1514, 0.775883099], [1515, 0.775849254], [1516, 0.775815251], [1517, 0.775781089], [1518, 0.775746768], [1519, 0.775712288], [1520, 0.77567765], [1521, 0.775642853], [1522, 0.775607898], [1523, 0.775572784], [1524, 0.775537511], [1525, 0.775502079], [1526, 0.775466489], [1527, 0.77543074], [1528, 0.775394833], [1529, 0.775358766], [1530, 0.775322542], [1531, 0.775286158], [1532, 0.775249616], [1533, 0.775212915], [1534, 0.775176055], [1535, 0.775139037], [1536, 0.77510186], [1537, 0.775064525], [1538, 0.775027031], [1539, 0.774989378], [1540, 0.774951566], [1541, 0.774913596], [1542, 0.774875467], [1543, 0.77483718], [1544, 0.774798733], [1545, 0.774760128], [1546, 0.774721365], [1547, 0.774682443], [1548, 0.774643362], [1549, 0.774604122], [1550, 0.774564724], [1551, 0.774443542], [1552, 0.774322258], [1553, 0.774200871], [1554, 0.774079383], [1555, 0.773957792], [1556, 0.7738361], [1557, 0.773714305], [1558, 0.773592408], [1559, 0.773470409], [1560, 0.773348308], [1561, 0.773226106], [1562, 0.7731038], [1563, 0.772981393], [1564, 0.772858884], [1565, 0.772736273], [1566, 0.772613559], [1567, 0.772490744], [1568, 0.772367827], [1569, 0.772244807], [1570, 0.772121685], [1571, 0.771998462], [1572, 0.771875136], [1573, 0.771751708], [1574, 0.771628178], [1575, 0.771504546], [1576, 0.771380812], [1577, 0.771256976], [1578, 0.771133037], [1579, 0.771008997], [1580, 0.770884854], [1581, 0.77076061], [1582, 0.770636263], [1583, 0.770511815], [1584, 0.770387264], [1585, 0.770262611], [1586, 0.770122206], [1587, 0.769962668], [1588, 0.769803015], [1589, 0.769643247], [1590, 0.769483363], [1591, 0.769323364], [1592, 0.769163251], [1593, 0.769003022], [1594, 0.768842677], [1595, 0.768682218], [1596, 0.768521644], [1597, 0.768360954], [1598, 0.768200149], [1599, 0.768039229], [1600, 0.767878194], [1601, 0.767278067], [1602, 0.766678174], [1603, 0.766078516], [1604, 0.765479093], [1605, 0.764879904], [1606, 0.764280949], [1607, 0.763682229], [1608, 0.763083744], [1609, 0.762485493], [1610, 0.761887477], [1611, 0.761289695], [1612, 0.760692147], [1613, 0.760094835], [1614, 0.759497756], [1615, 0.758900912], [1616, 0.758304303], [1617, 0.757707928], [1618, 0.757111788], [1619, 0.756515883], [1620, 0.755920211], [1621, 0.755324775], [1622, 0.754729573], [1623, 0.754134605], [1624, 0.753539872], [1625, 0.752945373], [1626, 0.752351109], [1627, 0.75175708], [1628, 0.751163285], [1629, 0.750569724], [1630, 0.749976398], [1631, 0.749383307], [1632, 0.74879045], [1633, 0.748197828], [1634, 0.74760544], [1635, 0.747013287], [1636, 0.746421368], [1637, 0.745829683], [1638, 0.745238234], [1639, 0.744647018], [1640, 0.744056038], [1641, 0.743465291], [1642, 0.74287478], [1643, 0.742284502], [1644, 0.74169446], [1645, 0.741104652], [1646, 0.740515078], [1647, 0.739925739], [1648, 0.739336634], [1649, 0.738747764], [1650, 0.738159129], [1651, 0.732499689], [1652, 0.726844606], [1653, 0.721193878], [1654, 0.715547507], [1655, 0.709901026], [1656, 0.70423404], [1657, 0.698571856], [1658, 0.692914474], [1659, 0.687261894], [1660, 0.681614117], [1661, 0.675971142], [1662, 0.670332969], [1663, 0.664699598], [1664, 0.65907103], [1665, 0.653447264], [1666, 0.6478283], [1667, 0.642214138], [1668, 0.636604779], [1669, 0.631000221], [1670, 0.625400466], [1671, 0.619805513], [1672, 0.614215363], [1673, 0.608630014], [1674, 0.603049468], [1675, 0.597473724], [1676, 0.591902783], [1677, 0.586336643], [1678, 0.580775306], [1679, 0.575218771], [1680, 0.569667038], [1681, 0.564120108], [1682, 0.558577979], [1683, 0.553040653], [1684, 0.54750813], [1685, 0.541980408], [1686, 0.536457488], [1687, 0.530939371], [1688, 0.525426056], [1689, 0.519917544], [1690, 0.514413833], [1691, 0.508914925], [1692, 0.503420819], [1693, 0.497931515], [1694, 0.492447014], [1695, 0.486967314], [1696, 0.481492417], [1697, 0.476022322], [1698, 0.47055703], [1699, 0.465096539], [1700, 0.459640851], [1701, 0.452897817], [1702, 0.44616077], [1703, 0.439429708], [1704, 0.432704634], [1705, 0.425985545], [1706, 0.419272443], [1707, 0.412565327], [1708, 0.405864198], [1709, 0.399160853], [1710, 0.392461266], [1711, 0.385768016], [1712, 0.379081102], [1713, 0.372400525], [1714, 0.365726284], [1715, 0.35905838], [1716, 0.352396812], [1717, 0.345741581], [1718, 0.339092687], [1719, 0.332450129], [1720, 0.325813907], [1721, 0.319184022], [1722, 0.312560474], [1723, 0.305943262], [1724, 0.299332387], [1725, 0.292727848], [1726, 0.286129646], [1727, 0.27953778], [1728, 0.272952251], [1729, 0.266373058], [1730, 0.259800202], [1731, 0.253233683], [1732, 0.2466735], [1733, 0.240119654], [1734, 0.233572144], [1735, 0.22703097], [1736, 0.220496134], [1737, 0.213967633], [1738, 0.20744547], [1739, 0.200929643], [1740, 0.194420152], [1741, 0.187916998], [1742, 0.181420181], [1743, 0.1749297], [1744, 0.168445555], [1745, 0.161967747], [1746, 0.155496276], [1747, 0.149031141], [1748, 0.142572343], [1749, 0.136119881], [1750, 0.129673756], [1751, 0.127227337], [1752, 0.124783285], [1753, 0.1223416], [1754, 0.119902283], [1755, 0.117465334], [1756, 0.115030751], [1757, 0.112598537], [1758, 0.11016869], [1759, 0.10774121], [1760, 0.105316098], [1761, 0.102893354], [1762, 0.100472977], [1763, 0.098054967], [1764, 0.095639325], [1765, 0.093226051], [1766, 0.090815144], [1767, 0.088406604], [1768, 0.086003429], [1769, 0.083602927], [1770, 0.081204602], [1771, 0.078808454], [1772, 0.076414481], [1773, 0.074022685], [1774, 0.071633065], [1775, 0.069245622], [1776, 0.066860355], [1777, 0.064477264], [1778, 0.062096349], [1779, 0.059717611], [1780, 0.057341049], [1781, 0.054966663], [1782, 0.052594453], [1783, 0.05022442], [1784, 0.047856563], [1785, 0.045490883], [1786, 0.043127378], [1787, 0.04076605], [1788, 0.038406898], [1789, 0.036049923], [1790, 0.033695124], [1791, 0.031342501], [1792, 0.028992054], [1793, 0.026643784], [1794, 0.02429769], [1795, 0.021953772], [1796, 0.019612031], [1797, 0.017272465], [1798, 0.014935076], [1799, 0.012599864], [1800, 0.010266827], [1801, 0.009235824], [1802, 0.008205781], [1803, 0.007176698], [1804, 0.006148575], [1805, 0.005121412], [1806, 0.004095209], [1807, 0.003069967], [1808, 0.002045684], [1809, 0.001022362], [1810, 0], [1811, 0], [1812, 0], [1813, 0], [1814, 0], [1815, 0], [1816, 0], [1817, 0], [1818, 0], [1819, 0], [1820, 0], [1821, 0], [1822, 0], [1823, 0], [1824, 0], [1825, 0], [1826, 0], [1827, 0], [1828, 0], [1829, 0], [1830, 0], [1831, 0], [1832, 0], [1833, 0], [1834, 0], [1835, 0], [1836, 0], [1837, 0], [1838, 0], [1839, 0], [1840, 0], [1841, 0], [1842, 0], [1843, 0], [1844, 0], [1845, 0], [1846, 0], [1847, 0], [1848, 0], [1849, 0], [1850, 0], [1851, 0], [1852, 0], [1853, 0], [1854, 0], [1855, 0], [1856, 0], [1857, 0], [1858, 0], [1859, 0], [1860, 0], [1861, 0], [1862, 0], [1863, 0], [1864, 0], [1865, 0], [1866, 0], [1867, 0], [1868, 0], [1869, 0], [1870, 0], [1871, 0], [1872, 0], [1873, 0], [1874, 0], [1875, 0], [1876, 0], [1877, 0], [1878, 0], [1879, 0], [1880, 0], [1881, 0], [1882, 0], [1883, 0], [1884, 0], [1885, 0], [1886, 0], [1887, 0], [1888, 0], [1889, 0], [1890, 0], [1891, 0], [1892, 0], [1893, 0], [1894, 0], [1895, 0], [1896, 0], [1897, 0], [1898, 0], [1899, 0], [1900, 0], [1901, 0], [1902, 0], [1903, 0], [1904, 0], [1905, 0], [1906, 0], [1907, 0], [1908, 0], [1909, 0], [1910, 0], [1911, 0], [1912, 0], [1913, 0], [1914, 0], [1915, 0], [1916, 0], [1917, 0], [1918, 0], [1919, 0], [1920, 0], [1921, 0], [1922, 0], [1923, 0], [1924, 0], [1925, 0], [1926, 0], [1927, 0], [1928, 0], [1929, 0], [1930, 0], [1931, 0], [1932, 0], [1933, 0], [1934, 0], [1935, 0], [1936, 0], [1937, 0], [1938, 0], [1939, 0], [1940, 0], [1941, 0], [1942, 0], [1943, 0], [1944, 0], [1945, 0], [1946, 0], [1947, 0], [1948, 0], [1949, 0], [1950, 0], [1951, 0], [1952, 0], [1953, 0], [1954, 0], [1955, 0], [1956, 0], [1957, 0], [1958, 0], [1959, 0], [1960, 0], [1961, 0], [1962, 0], [1963, 0], [1964, 0], [1965, 0], [1966, 0], [1967, 0], [1968, 0], [1969, 0], [1970, 0], [1971, 0], [1972, 0], [1973, 0], [1974, 0], [1975, 0], [1976, 0], [1977, 0], [1978, 0], [1979, 0], [1980, 0], [1981, 0], [1982, 0], [1983, 0], [1984, 0], [1985, 0], [1986, 0], [1987, 0], [1988, 0], [1989, 0], [1990, 0], [1991, 0], [1992, 0], [1993, 0], [1994, 0], [1995, 0], [1996, 0], [1997, 0], [1998, 0], [1999, 0], [2000, 0] ]) def TNfx(lambd): TN = np.interp(lambd, transfert[:,0], transfert[:,1]) return TN def planck(lambd, T): L = (2*h*c**2*(lambd*1e-9)**(-5))/(np.exp((h*c/(lambd*1e-9*k*T)))-1) return L def cq(T, Ti, N): #T en kelvin #partie de gauche a = Ti*1e-6*2*np.pi*spixel*(1-(2/(np.sqrt( 4+(1/(N**2) ))))) #print(a) #partie de droite à intégrer bfx = lambda lambd: TNfx(lambd)*emiss*lambd*1e-9/(h*c)*planck(lambd, T) b, _ = scp.integrate.quad(bfx,830,1810, limit=10000) #print(b) cq = a*b*1e-9 return cq ## Resolution startTime = time.time() #start time to measure execution time # Initialize with zeros donnees = np.zeros((rangeT, rangeTi)) prevProgress = 0 # calculate axis xAxis = np.linspace(Tmin, Tmax, rangeT) yAxis = np.linspace(Timin, Timax, rangeTi) x=0 y=0 # Populate the array for T in xAxis: for Ti in yAxis: donnees[x][y]= cq(T, Ti, 16) #progress progress = int(round(((x)*rangeTi+y)/(rangeTi*rangeT)*100,0)) if(progress != prevProgress): calcDuration = time.time() - startTime remainingTime = (100-progress)*(calcDuration/(progress+1)) print("Time : ", int(calcDuration), "s | Remaining : ", int(remainingTime), "s | Progress : ", progress, "% ", end='') for z in range(int(progress/3)): print("#", end='') for zz in range(33-int(progress/3)): print("-", end='') print("") prevProgress = progress y = y+1 x = x+1 y = 0 # Plot ## Specify contour levels contour_levels = [cqMin, (cqMax-cqMin)/2 , cqMax] line_styles = ['-', '--', '-'] #contour_levels = np.logspace(np.min(donnees), np.max(donnees), 20) fig, main_ax = plt.subplots(dpi=500) contour_plot = main_ax.contour(xAxis.tolist(), yAxis.tolist(), donnees, linestyles=line_styles, levels=contour_levels, colors='black') main_ax.set_xlim(Tmin, Tmax) main_ax.set_ylim(Timin, Timax) main_ax.set_xlabel('T° (K)') main_ax.set_ylabel('Ti (µs)') main_ax.set_title('cq(T, Ti)') main_ax.set_xscale('linear') main_ax.set_yscale('linear') # Add labels to contour lines contourFormat=["Min : %1.2e", "Middle : %1.2e", "Max : %1.2e"] main_ax.clabel(contour_plot, inline=True, fontsize=8, colors='k', fmt=contourFormat) main_ax.grid(True, linestyle='--', alpha=0.7) plt.show() # ============================================================================= # # Colormap # # fig, main_ax = plt.subplots(dpi=500) # heatmap = main_ax.imshow(donnees, extent=[Tmin, Tmax, yAxis.min(), yAxis.max()], # aspect='auto', origin='lower', cmap='viridis', interpolation='nearest') # main_ax.set_xlim(Tmin, Tmax) # main_ax.set_ylim(yAxis.min(), yAxis.max()) # main_ax.set_xlabel('Temp') # main_ax.set_ylabel('Ti') # main_ax.set_title('cq(T, Ti)') # # # Add colorbar # cbar = plt.colorbar(heatmap, ax=main_ax, label='Function Value') # # # Show the plot # plt.show() # =============================================================================