10
10
11
11
__all__ = ["get_grid_transmission" , "_calculate_grid_transmission" ]
12
12
13
+ from stixpy .coordinates .frames import STIXImaging
13
14
14
- def get_grid_transmission (xy_flare ):
15
+
16
+ def get_grid_transmission (flare_location : STIXImaging ):
15
17
r"""
16
18
Return the grid transmission for the 32 sub-collimators corrected for internal shadowing.
17
19
@@ -20,11 +22,8 @@ def get_grid_transmission(xy_flare):
20
22
21
23
Parameters
22
24
----------
23
- xy_flare
24
-
25
- Returns
26
- -------
27
-
25
+ flare_location :
26
+ Location of the flare
28
27
"""
29
28
column_names = ["sc" , "p" , "o" , "phase" , "slit" , "grad" , "rms" , "thick" , "bwidth" , "bpitch" ]
30
29
@@ -33,10 +32,8 @@ def get_grid_transmission(xy_flare):
33
32
front = Table .read (grid_info / "grid_param_front.txt" , format = "ascii" , names = column_names )
34
33
rear = Table .read (grid_info / "grid_param_rear.txt" , format = "ascii" , names = column_names )
35
34
36
- xy_flare_stix = np .array ([xy_flare [0 ].value , xy_flare [1 ].value ]) * u .arcsec
37
-
38
- transmission_front = _calculate_grid_transmission (front , xy_flare_stix )
39
- transmission_rear = _calculate_grid_transmission (rear , xy_flare_stix )
35
+ transmission_front = _calculate_grid_transmission (front , flare_location )
36
+ transmission_rear = _calculate_grid_transmission (rear , flare_location )
40
37
total_transmission = transmission_front * transmission_rear
41
38
42
39
# The finest grids are made from multiple layers for the moment remove these and set 1
@@ -49,15 +46,15 @@ def get_grid_transmission(xy_flare):
49
46
return final_transmission
50
47
51
48
52
- def _calculate_grid_transmission (grid_params , xy_flare_stix ):
49
+ def _calculate_grid_transmission (grid_params , flare_location ):
53
50
r"""
54
51
Calculate grid transmission accounting for internal shadowing.
55
52
56
53
Parameters
57
54
----------
58
55
grid_params
59
56
Grid parameter tables
60
- xy_flare_stix
57
+ flare_location
61
58
Position of flare in stix imaging frame
62
59
63
60
Returns
@@ -68,7 +65,7 @@ def _calculate_grid_transmission(grid_params, xy_flare_stix):
68
65
pitch = grid_params ["p" ]
69
66
slit = grid_params ["slit" ]
70
67
thick = grid_params ["thick" ]
71
- flare_dist = np .abs (xy_flare_stix [ 0 ] * np .cos (orient )) + xy_flare_stix [ 1 ] * np .sin (orient )
68
+ flare_dist = np .abs (flare_location . Tx * np .cos (orient )) + flare_location . Ty * np .sin (orient )
72
69
shadow_width = thick * np .tan (flare_dist )
73
70
transmission = (slit - shadow_width ) / pitch
74
71
return transmission
0 commit comments