Skip to content

Commit

Permalink
update to version 2.0 - Full Python !
Browse files Browse the repository at this point in the history
  • Loading branch information
AStcherbinine committed Oct 7, 2020
1 parent e08a1a4 commit 48c731a
Show file tree
Hide file tree
Showing 35 changed files with 6,134 additions and 2,034 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
![version](https://img.shields.io/badge/version-1.4.2-blue)
![version](https://img.shields.io/badge/version-2.0-blue)
![pythonversion](https://img.shields.io/badge/Python-3.7-blue)
![idlversion](https://img.shields.io/badge/IDL-8.3-blue)

# OMEGA-Py : Python tools for OMEGA data

Expand Down
27 changes: 17 additions & 10 deletions docs/doc.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# OMEGA-Py documentation - v1.2
# OMEGA-Py documentation - v2.0

## [`omegapy.omega_data`](doc_omega_data.md)

Importation of OMEGA observations in the OMEGAdata class.
Using IDL routines containing in omegapy/omega_routines/*.
Importation and correction of OMEGA/MEx observations from binaries files.

`class OMEGAdata(obs='', empty=False, data_path=_omega_bin_path)`
`class OMEGAdata(obs='', empty=False, data_path=_omega_bin_path, corrV=True, corrL=True)`

`find_cube(lat, lon, cmin=0, cmax=10000, out=False)`
`find_cube(lon0, lat0, cmin=0, cmax=10000, out=False)`

`autosave_omega(omega, folder='auto', base_folder=_omega_py_path, security=True, disp=True)`

`autoload_omega(obs_name, folder='auto', version=Version, base_folder=_omega_py_path, therm_corr=None, atm_corr=None, disp=True)`
`autoload_omega(obs_name, folder='auto', version=_Version, base_folder=_omega_py_path, therm_corr=None, atm_corr=None, disp=True)`

`save_omega(omega, savname='auto', folder='', base_folder=_omega_py_path, pref ='', suff='', disp=True)`

`load_omega(filename, disp=True)`

`load_omega_list(basename, disp=True)`

`load_omega_list2(liste_obs, therm_corr=True, atm_corr=True, **kwargs)`

`import_list_obs_csv(filename)`

`corr_therm(omega, npool=1)`
Expand All @@ -45,28 +46,32 @@ Using IDL routines containing in omegapy/omega_routines/*.

`get_ls(omega_list)`

`update_cube_quality(obs_name='ORB*.pkl', folder='auto', version=Version, base_folder=_omega_py_path)`
`update_cube_quality(obs_name='ORB*.pkl', folder='auto', version=_Version, base_folder=_omega_py_path)`

`test_cube(obs)`

`compute_list_good_observations(savfilename='liste_good_obs.csv', folder='../data/OMEGA/liste_obs', security=True)`

`utc_to_my(dt)`

`shared_lam(lam_list)`

`shared_lam_omegalist(omega_list)`


## [`omegapy.omega_plots`](doc_omega_plots.md)

Display of OMEGAdata cubes.

`show_omega(omega, lam, refl=True, lam_unit='m', cmap='Greys_r', vmin=None, vmax=None, title='auto', xlim=(None, None), ylim=(None, None), Nfig=None)`

`show_omega_v2(omega, lam, refl=True, lam_unit='m', cmap='Greys_r', vmin=None, vmax=None, alpha=None, title='auto', lonlim=(None, None), latlim=(None, None), Nfig=None, polar=False, cbar=True)`
`show_omega_v2(omega, lam, refl=True, lam_unit='m', cmap='Greys_r', vmin=None, vmax=None, alpha=None, title='auto', lonlim=(None, None), latlim=(None, None), Nfig=None, polar=False, cbar=True, grid=True, mask=None, negatives_longitudes='auto')`

`show_omega_interactif(omega, lam, refl=True, lam_unit='m', cmap='Greys_r', vmin=None, vmax=None, title='auto', autoyscale=True, xlim=(None, None), ylim=(None, None))`

`show_omega_interactif_v2(omega, lam=1.085, refl=True, lam_unit='m', data=None, cmap='Greys_r', cb_title='IBD', title='auto', vmin=None, vmax=None, autoyscale=True, ylim_sp=(None, None), alpha=None, lonlim=(None, None), latlim=(None, None), polar=False, cbar=True, grid=True)`
`show_omega_interactif_v2(omega, lam=1.085, refl=True, lam_unit='m', data=None, cmap='Greys_r', cb_title='data', title='auto', vmin=None, vmax=None, autoyscale=True, ylim_sp=(None, None), alpha=None, lonlim=(None, None), latlim=(None, None), polar=False, cbar=True, grid=True, mask=None, lam_mask=None, negatives_longitudes='auto')`

`show_ibd_v2(omega, ibd, cmap='viridis', vmin=None, vmax=None, alpha=None, title='auto', cb_title = 'IBD', lonlim=(None, None), latlim=(None, None), Nfig=None, polar=False, cbar=True)`
`show_data_v2(omega, data, cmap='viridis', vmin=None, vmax=None, alpha=None, title='auto', cb_title = 'data', lonlim=(None, None), latlim=(None, None), Nfig=None, polar=False, cbar=True, grid=True, mask=None, negatives_longitudes='auto')`

`show_omega_list_v2(omega_list, lam=1.085, lat_min=-90, lat_max=90, lon_min=0, lon_max=360, pas_lat=0.1, pas_lon=0.1, cmap='Greys_r', vmin=None, vmax=None, title='auto', Nfig=None, polar=False, cbar=True, cb_title='auto', data_list=None, mask_list=None, plot=True, grid=True, out=False, negatives_longitudes=False, **kwargs)`

Expand All @@ -76,6 +81,8 @@ Display of OMEGAdata cubes.

`show_omega_list_v2_man(data, grid_lat, grid_lon, infos, cmap='Greys_r', vmin=None, vmax=None, title='auto', Nfig=None, polar=False, cbar=True, cb_title='auto', grid=True, negatives_longitudes=False, **kwargs)`

`plot_psp(sp1_id, *args, sp2_id=(None, None), Nfig=None, sp_dict=picked_spectra, **kwargs)`


## [`omegapy.useful_functions`](doc_useful_functions.md)

Expand Down
71 changes: 57 additions & 14 deletions docs/doc_omega_data.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# OMEGA-Py documentation - v1.2
# OMEGA-Py documentation - v2.0

## `omegapy.omega_data`

Importation of OMEGA observations in the OMEGAdata class.
Using IDL routines containing in omegapy/omega_routines/*.
Importation and correction of OMEGA/MEx observations from binaries files.

`class OMEGAdata(obs='', empty=False, data_path=_omega_bin_path)`
`class OMEGAdata(obs='', empty=False, data_path=_omega_bin_path, corrV=True, corrL=True)`

`find_cube(lat, lon, cmin=0, cmax=10000, out=False)`
`find_cube(lon0, lat0, cmin=0, cmax=10000, out=False)`

`autosave_omega(omega, folder='auto', base_folder=_omega_py_path, security=True, disp=True)`

Expand Down Expand Up @@ -55,11 +54,15 @@ Using IDL routines containing in omegapy/omega_routines/*.

`utc_to_my(dt)`

`shared_lam(lam_list)`

`shared_lam_omegalist(omega_list)`


### OMEGAdata class
~~~python
class omegapy.omega_data.OMEGAdata(obs='', empty=False, data_path=_omega_bin_path):
Importation of OMEGA/MEx observation, using the readomega_vpy.pro IDL routine.
class omegapy.omega_data.OMEGAdata(obs='', empty=False, data_path=_omega_bin_path, corrV=True, corrL=True):
Importation of OMEGA/MEx observation.

Parameters
==========
Expand All @@ -70,6 +73,10 @@ class omegapy.omega_data.OMEGAdata(obs='', empty=False, data_path=_omega_bin_pat
data_path : str, optional (default _omega_py_path)
The path of the directory containing the data (.QUB) and
navigation (.NAV) files.
corrV : bool, optional (default True)
If True, compute the correction on the visible channel (Vis).
corrL : bool, optional (default True)
If True, compute the correction on the long-IR channel (L).

Attributes
==========
Expand All @@ -93,6 +100,8 @@ class omegapy.omega_data.OMEGAdata(obs='', empty=False, data_path=_omega_bin_pat
The elevation of the pixel footprint center point (km).
loct : 2D array of floats
The array of the local time for each pixel of the observation.
my : int
The Martian Year number at the time of the observation.
emer : 2D array
The angle of emergent line (from the surface) (deg).
inci : 2D array
Expand All @@ -117,7 +126,7 @@ class omegapy.omega_data.OMEGAdata(obs='', empty=False, data_path=_omega_bin_pat
Information about the saturation of the Vis-channel.
summation : int
The downtrack summing.
bits_per_data : int
bits_per_data : float
The compression rate in bits per data.
data_quality : int
Information about the data quality, from 0 to 5 depending on missing lines and
Expand Down Expand Up @@ -190,16 +199,16 @@ class omegapy.omega_data.OMEGAdata(obs='', empty=False, data_path=_omega_bin_pat

### Observation search
~~~python
omegapy.omega_data.find_cube(lat, lon, cmin=0, cmax=10000, out=False):
omegapy.omega_data.find_cube(lon0, lat0, cmin=0, cmax=10000, out=False):
Display the available OMEGA/MEx cubes with observations of the target
latitude and longitude, using the IDL procedure `findcub.pro`.
latitude and longitude, Python translation of the IDL procedure `findcub.pro`.

Parameters
==========
lat : float
The target latitude (in degrees).
lon : float
lon0 : float
The target longitude (in degrees).
lat0 : float
The target latitude (in degrees).
cmin : float, optional (default 0)
The minimum orbit number.
cmax : float, optional (default 10000)
Expand All @@ -211,7 +220,7 @@ omegapy.omega_data.find_cube(lat, lon, cmin=0, cmax=10000, out=False):
=======
cub_list : array-like
List of matching observations.
Format : (orbit, x, y, dmin, altMEx, inci, emer, phas, Ls)
Format : (orbit, x, y, dmin, altMEx, inci, emer, phas, loct, Ls, MY)
~~~

### OMEGAdata files handling
Expand Down Expand Up @@ -678,3 +687,37 @@ omegapy.omega_data.utc_to_my(dt):
my : int
The corresponding Martian Year.
~~~

### Shared wavelength array between different observations
~~~python
omegapy.omega_data.shared_lam(lam_list):
Return a list of wavelength shared by all the input wavelength arrays.

Parameters
==========
lam_list : list of 1D np.array
The list of wavelength array.

Returns
=======
lam2 : 1D np.array
The wavelength array that contains only wavelength shared by all the arrays of
lam_list.
~~~

~~~python
omegapy.omega_data.shared_lam_omegalist(omega_list):
Return a list of wavelength shared by all the wavelength arrays of the input
OMEGA/MEx observations.

Parameters
==========
omega_list : list of OMEGAdata
The list of OMEGA/MEx observations.

Returns
=======
lam2 : 1D np.array
The wavelength array that contains only wavelength shared by all the arrays of
lam_list.
~~~
Loading

0 comments on commit 48c731a

Please sign in to comment.