|
3 | 3 |
|
4 | 4 | ## emm_emirs.py |
5 | 5 | ## Created by Aurélien STCHERBININE |
6 | | -## Last modified by Aurélien STCHERBININE : 09/05/2022 |
| 6 | +## Last modified by Aurélien STCHERBININE : 10/05/2022 |
7 | 7 |
|
8 | 8 | ##---------------------------------------------------------------------------------------- |
9 | 9 | """Projection of an EMM/EMIRS pixel fov on Mars. |
|
16 | 16 | from copy import deepcopy |
17 | 17 | import os |
18 | 18 | import yaml |
| 19 | +# Local |
| 20 | +from . import circular_pixels |
19 | 21 |
|
20 | 22 | # Name of the current file |
21 | 23 | _py_file = 'emm_emirs.py' |
|
26 | 28 |
|
27 | 29 | ##----------------------------------------------------------------------------------- |
28 | 30 | ## Load data |
29 | | -with open(os.path.join(data_path, 'instruments.yml') as f_inst: |
| 31 | +with open(os.path.join(data_path, 'instruments.yml')) as f_inst: |
30 | 32 | instruments = yaml.safe_load(f_inst) |
31 | | -with open(os.path.join(data_path, 'celestial_objects.yml') as f_obj: |
| 33 | +with open(os.path.join(data_path, 'celestial_objects.yml')) as f_obj: |
32 | 34 | objects = yaml.safe_load(f_obj) |
33 | 35 |
|
34 | 36 | # EMIRS IFOV [rad] |
35 | 37 | ifov_emirs = u.Quantity(instruments['instruments']['emm-emirs']['ifov']).to('rad').value |
36 | 38 | # Mars radius [km] |
37 | | -Rmars = u.Quantity(instruments['planets']['mars']['radius']).to('km').value |
| 39 | +Rmars = u.Quantity(objects['planets']['mars']['radius']).to('km').value |
38 | 40 |
|
39 | 41 | ##----------------------------------------------------------------------------------- |
40 | 42 | ## EMIRS pixel footprint projection |
@@ -73,9 +75,9 @@ def emirs_ifov_px_projection(lon_grid, lat_grid, lon_px, lat_px, emer, lon_subsc |
73 | 75 | | 0 -> Outside |
74 | 76 | """ |
75 | 77 | # Compute footprint ellipse parameters |
76 | | - a, b, θ = params_ellipse_fov(lon_px, lat_px, emer, lon_subsc, lat_subsc, d_Mars_sc, ifov) |
| 78 | + a, b, θ = circular_pixels.params_ellipse_fov(lon_px, lat_px, emer, lon_subsc, lat_subsc, d_Mars_sc, ifov) |
77 | 79 | # Search for grid pixels within the EMIRS footprint |
78 | | - mask_ellipse = in_ellipse_spherical(lon_grid, lat_grid, Rmars, a, b, lon_px, lat_px, θ) |
| 80 | + mask_ellipse = circular_pixels.in_ellipse_spherical(lon_grid, lat_grid, Rmars, a, b, lon_px, lat_px, θ) |
79 | 81 | mask_ellipse2 = deepcopy(mask_ellipse) * 1. # bool to float |
80 | 82 | # Output |
81 | 83 | return mask_ellipse2 |
|
0 commit comments