Fix fstrings
This commit is contained in:
		
							
								
								
									
										15
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								main.py
									
									
									
									
									
								
							@@ -117,7 +117,7 @@ def load_data(data_path: str, data={}) -> dict:
 | 
				
			|||||||
    # Raw Data is always added - processing comes after
 | 
					    # Raw Data is always added - processing comes after
 | 
				
			||||||
    data[x2_shot] = {
 | 
					    data[x2_shot] = {
 | 
				
			||||||
        "info": dataInfo,
 | 
					        "info": dataInfo,
 | 
				
			||||||
        "shot_time": np.datetime64(f"{dataInfo["date"]}T{dataInfo["time"]}"),
 | 
					        "shot_time": np.datetime64(f"{dataInfo['date']}T{dataInfo['time']}"),
 | 
				
			||||||
        "raw-data":{
 | 
					        "raw-data":{
 | 
				
			||||||
            "probe_headers": scope_header,
 | 
					            "probe_headers": scope_header,
 | 
				
			||||||
            "probes": scope_data,
 | 
					            "probes": scope_data,
 | 
				
			||||||
@@ -304,8 +304,8 @@ def load_data(data_path: str, data={}) -> dict:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        uncert = deltaVs(probe_velocity, p2p_dist, p2p_time, (UNCERTS["probe-dist"][refProbe], UNCERTS["probe-dist"][dataInfo["pcb-refs"][i-1]]), (p1_time_uncert, p2_time_uncert, UNCERTS["time"]["x2-daq"]))
 | 
					        uncert = deltaVs(probe_velocity, p2p_dist, p2p_time, (UNCERTS["probe-dist"][refProbe], UNCERTS["probe-dist"][dataInfo["pcb-refs"][i-1]]), (p1_time_uncert, p2_time_uncert, UNCERTS["time"]["x2-daq"]))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        print(f"{dataInfo["pcb-refs"][i-1]}-{refProbe} Measured a shock speed of {probe_velocity:.2f} +/- {uncert:.2f} m/s ({probe_velocity/1000:.2f} +/- {uncert/1000:.2f} km/s [{uncert/probe_velocity * 100 :.2f}%])")
 | 
					        print(f"{dataInfo['pcb-refs'][i-1]}-{refProbe} Measured a shock speed of {probe_velocity:.2f} +/- {uncert:.2f} m/s ({probe_velocity/1000:.2f} +/- {uncert/1000:.2f} km/s [{uncert/probe_velocity * 100 :.2f}%])")
 | 
				
			||||||
        data[x2_shot]["shock-speed"][f"{dataInfo["pcb-refs"][i-1]}-{refProbe}"] = probe_velocity, uncert, True # Speed, Ref
 | 
					        data[x2_shot]["shock-speed"][f"{dataInfo['pcb-refs'][i-1]}-{refProbe}"] = probe_velocity, uncert, True # Speed, Ref
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    print()
 | 
					    print()
 | 
				
			||||||
    for probe in dataInfo["probe-info"]["locations"]:
 | 
					    for probe in dataInfo["probe-info"]["locations"]:
 | 
				
			||||||
@@ -325,7 +325,7 @@ def load_data(data_path: str, data={}) -> dict:
 | 
				
			|||||||
            print(f"{probe} Measured a shock speed of {probe_velocity:.2f} +/- {uncert:.2f} m/s ({probe_velocity/1000:.2f} +/- {uncert/1000:.2f} km/s)")
 | 
					            print(f"{probe} Measured a shock speed of {probe_velocity:.2f} +/- {uncert:.2f} m/s ({probe_velocity/1000:.2f} +/- {uncert/1000:.2f} km/s)")
 | 
				
			||||||
            data[x2_shot]["shock-speed"][probe] = probe_velocity, uncert, False # Speed, Ref # m/s
 | 
					            data[x2_shot]["shock-speed"][probe] = probe_velocity, uncert, False # Speed, Ref # m/s
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            print(f"Unable to calculate probe velocity, only have one gauge: {f"{probe}-g2" if f"{probe}-g2" in data[x2_shot]["shock-point"] else f"{probe}-g1"}")
 | 
					            print(f"Unable to calculate probe velocity, only have one gauge: {f'{probe}-g2' if f'{probe}-g2' in data[x2_shot]['shock-point'] else f'{probe}-g1'}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if len(dataInfo["probe-info"]["locations"]) > 1:
 | 
					    if len(dataInfo["probe-info"]["locations"]) > 1:
 | 
				
			||||||
        for i in range(len(dataInfo["probe-info"]["locations"]) - 1):
 | 
					        for i in range(len(dataInfo["probe-info"]["locations"]) - 1):
 | 
				
			||||||
@@ -408,7 +408,7 @@ def genGraph(gData: dict, showPlot: bool = True, doLimits: bool = True, forcePlo
 | 
				
			|||||||
            graphData["plots"].append({
 | 
					            graphData["plots"].append({
 | 
				
			||||||
                "type": "axvLine",
 | 
					                "type": "axvLine",
 | 
				
			||||||
                "x": gData["shock-point"][label][1],
 | 
					                "x": gData["shock-point"][label][1],
 | 
				
			||||||
                "label": f"{label} - Shock Point {gData["shock-point"][label][1]:.2f}$\\mu$s",
 | 
					                "label": f"{label} - Shock Point {gData['shock-point'][label][1]:.2f}$\\mu$s",
 | 
				
			||||||
                "colour": "gray",
 | 
					                "colour": "gray",
 | 
				
			||||||
                "args":{"zorder":2, "linestyle":"--", "alpha":0.5}
 | 
					                "args":{"zorder":2, "linestyle":"--", "alpha":0.5}
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
@@ -427,7 +427,7 @@ def genGraph(gData: dict, showPlot: bool = True, doLimits: bool = True, forcePlo
 | 
				
			|||||||
            graphData["plots"].append({
 | 
					            graphData["plots"].append({
 | 
				
			||||||
                "type": "axvLine",
 | 
					                "type": "axvLine",
 | 
				
			||||||
                "x": gData["shock-point"][f"{probe}-g1"][1],#[i],
 | 
					                "x": gData["shock-point"][f"{probe}-g1"][1],#[i],
 | 
				
			||||||
                "label": f"{probe}-Gauge 1 - Shock Point {gData["shock-point"][f"{probe}-g1"][1]:.2f}$\\mu$s",
 | 
					                "label": f"{probe}-Gauge 1 - Shock Point {gData['shock-point'][f'{probe}-g1'][1]:.2f}$\\mu$s",
 | 
				
			||||||
                "colour": UQC["purple"].lighten(0.5),
 | 
					                "colour": UQC["purple"].lighten(0.5),
 | 
				
			||||||
                "args":{"zorder":2, "linestyle":"--", "alpha":0.5}
 | 
					                "args":{"zorder":2, "linestyle":"--", "alpha":0.5}
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
@@ -437,7 +437,7 @@ def genGraph(gData: dict, showPlot: bool = True, doLimits: bool = True, forcePlo
 | 
				
			|||||||
            graphData["plots"].append({
 | 
					            graphData["plots"].append({
 | 
				
			||||||
                "type": "axvLine",
 | 
					                "type": "axvLine",
 | 
				
			||||||
                "x": gData["shock-point"][f"{probe}-g2"][1],#[i],
 | 
					                "x": gData["shock-point"][f"{probe}-g2"][1],#[i],
 | 
				
			||||||
                "label": f"{probe}-Gauge 2 - Shock Point {gData["shock-point"][f"{probe}-g2"][1]:.2f}$\\mu$s",
 | 
					                "label": f"{probe}-Gauge 2 - Shock Point {gData['shock-point'][f'{probe}-g2'][1]:.2f}$\\mu$s",
 | 
				
			||||||
                "colour": UQC["purple"].lighten(0.5),
 | 
					                "colour": UQC["purple"].lighten(0.5),
 | 
				
			||||||
                "args":{"zorder":2, "linestyle":"--", "alpha":0.5}
 | 
					                "args":{"zorder":2, "linestyle":"--", "alpha":0.5}
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
@@ -486,4 +486,3 @@ for shot in loaded_data:
 | 
				
			|||||||
pltKeyClose()
 | 
					pltKeyClose()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
print("Done")
 | 
					print("Done")
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user