Skip to content

Commit f869d32

Browse files
committed
deploy v1.0
1 parent 8867df0 commit f869d32

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
__pycache__/
55
*.py[cod]
66
*$py.class
7+
8+
.venv/

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ pip3 install .
2626
# Package importation
2727
import spip
2828
import numpy as np
29+
2930
# Genaration of a longitude/latitude grid to project the footprint
30-
lon_array, lat_array = np.arange(0, 360.5, 0.5), np.arange(-90, 90.5, 0.5)
31+
lon_array = np.arange(0, 360.5, 0.5)
32+
lat_array = np.arange(-90, 90.5, 0.5)
3133
lon_grid, lat_grid = np.meshgrid(lon_array, lat_array)
34+
3235
# Pixel parameters
33-
lon_px, lat_px = # Longitude/Latitude of the pixel center [deg]
34-
emer = # Emergence angle of the pixel on the surface [deg]
35-
lon_subsc, lat_subsc = # Longitude/Latitude sub-spacecraft [deg]
36-
d_Mars_sc = # Distance surface-spacraft [km]
36+
lon_px, lat_px = 58.2, 79.3 # Longitude/Latitude of the pixel center [deg]
37+
emer = 61.7 # Emergence angle of the pixel on the surface [deg]
38+
lon_subsc, lat_subsc = 28.0, 24.9 # Longitude/Latitude sub-spacecraft [deg]
39+
d_Mars_sc = 27212 # Distance surface-spacraft [km]
3740
Rmars = spip.emm_emirs.Rmars # 3390 [km]
3841
ifov = spip.emm_emirs.ifov_emirs # 2.7e-3 [rad]
42+
3943
# Generation of the mask map of the pixel footprint
4044
#-- EMM/EMIRS spacecraft
4145
mask_footprint = spip.emm_emirs.emirs_ifov_px_projection(
@@ -52,7 +56,7 @@ mask_footprint = spip.emm_emirs.emirs_ifov_px_projection(
5256
)
5357

5458
#-- General case, cirular pixel
55-
a, b, θ = spip.circalar_pixels.params_ellipse_fov(
59+
a, b, θ = spip.circular_pixels.params_ellipse_fov(
5660
lon_px,
5761
lat_px,
5862
emer,
@@ -62,7 +66,7 @@ a, b, θ = spip.circalar_pixels.params_ellipse_fov(
6266
ifov
6367
)
6468

65-
mask_footprint = spip.circalar_pixels.in_ellipse_spherical(
69+
mask_footprint = spip.circular_pixels.in_ellipse_spherical(
6670
lon_grid,
6771
lat_grid,
6872
Rmars,

spip/emm_emirs.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## emm_emirs.py
55
## 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
77

88
##----------------------------------------------------------------------------------------
99
"""Projection of an EMM/EMIRS pixel fov on Mars.
@@ -16,6 +16,8 @@
1616
from copy import deepcopy
1717
import os
1818
import yaml
19+
# Local
20+
from . import circular_pixels
1921

2022
# Name of the current file
2123
_py_file = 'emm_emirs.py'
@@ -26,15 +28,15 @@
2628

2729
##-----------------------------------------------------------------------------------
2830
## 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:
3032
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:
3234
objects = yaml.safe_load(f_obj)
3335

3436
# EMIRS IFOV [rad]
3537
ifov_emirs = u.Quantity(instruments['instruments']['emm-emirs']['ifov']).to('rad').value
3638
# 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
3840

3941
##-----------------------------------------------------------------------------------
4042
## EMIRS pixel footprint projection
@@ -73,9 +75,9 @@ def emirs_ifov_px_projection(lon_grid, lat_grid, lon_px, lat_px, emer, lon_subsc
7375
| 0 -> Outside
7476
"""
7577
# 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)
7779
# 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, θ)
7981
mask_ellipse2 = deepcopy(mask_ellipse) * 1. # bool to float
8082
# Output
8183
return mask_ellipse2

0 commit comments

Comments
 (0)