Skip to content

Commit

Permalink
update to version 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AStcherbinine committed May 13, 2020
1 parent adcc423 commit e260407
Show file tree
Hide file tree
Showing 9 changed files with 917 additions and 132 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-1.4-blue)
![version](https://img.shields.io/badge/version-1.4.2-blue)
![pythonversion](https://img.shields.io/badge/Python-3.7-blue)
![idlversion](https://img.shields.io/badge/IDL-8.3-blue)

Expand Down
22 changes: 18 additions & 4 deletions docs/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ Using IDL routines containing in omegapy/omega_routines/*.

`import_list_obs_csv(filename)`

`corr_therm(omega)`
`corr_therm(omega, npool=1)`

`corr_therm2(omega)`

`corr_atm(omega)`

`corr_atm2(omega)`

`corr_save_omega(obsname, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True)`
`corr_save_omega(obsname, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True, npool=1)`

`corr_save_omega_list(liste_obs, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True)`
`corr_save_omega_list(liste_obs, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True, npool=1)`

`set_omega_bin_path(new_path)`

Expand All @@ -47,6 +47,12 @@ Using IDL routines containing in omegapy/omega_routines/*.

`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)`


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

Expand All @@ -62,7 +68,13 @@ Display of OMEGAdata cubes.

`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_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, plot=True, grid=True, out=False, **kwargs)`
`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)`

`save_map_omega_list(omega_list, lat_min=-90, lat_max=90, lon_min=0, lon_max=360, pas_lat=0.1, pas_lon=0.1, lam=1.085, data_list=None, data_desc='', mask_list=None, sav_filename='auto', base_folder='../data/OMEGA/sav_map_list_v2/', ext='')`

`load_map_omega_list(filename)`

`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)`


## [`omegapy.useful_functions`](doc_useful_functions.md)
Expand All @@ -81,6 +93,8 @@ Some useful generic functions.

`load_pickle(filename, disp=True)`

`test_security_overwrite(path)`

`reg_lin(X, Y)`

`planck(lam, T)`
Expand Down
125 changes: 116 additions & 9 deletions docs/doc_omega_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ Using IDL routines containing in omegapy/omega_routines/*.

`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)`
`corr_therm(omega, npool=1)`

`corr_therm2(omega)`

`corr_atm(omega)`

`corr_atm2(omega)`

`corr_save_omega(obsname, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True)`
`corr_save_omega(obsname, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True, npool=1)`

`corr_save_omega_list(liste_obs, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True)`
`corr_save_omega_list(liste_obs, folder='auto', base_folder=_omega_py_path, security=True, overwrite=True, compress=True, npool=1)`

`set_omega_bin_path(new_path)`

Expand All @@ -47,6 +49,12 @@ Using IDL routines containing in omegapy/omega_routines/*.

`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)`


### OMEGAdata class
~~~python
Expand Down Expand Up @@ -335,6 +343,31 @@ omegapy.omega_data.load_omega_list(basename, disp=True):
The array of loaded objects of OMEGA/MEx observation.
~~~

~~~python
omegapy.omega_data.load_omega_list2(liste_obs, therm_corr=True, atm_corr=True, **kwargs)
Load a list of saved OMEGAdata objects, using load_omega().

Parameters
==========
liste_obs : array of str
List of OMEGA/MEx observations ID.
therm_corr : bool or None, optional (default None)
| True -> Only results with thermal correction.
| False -> Only results without thermal correction.
| None -> Both with and without thermal correction.
atm_corr : bool or None, optional (default None)
| True -> Only results with atmospheric correction.
| False -> Only results without atmospheric correction.
| None -> Both with and without atmospheric correction.
**kwargs:
Optional arguments for autoload_omega().

Returns
=======
omega_list : list of OMEGAdata objects
The list of loaded objects of OMEGA/MEx observation.
~~~

~~~python
omegapy.omega_data.import_list_obs_csv(filename):
Import a list of observations ID from a csv file generated by JMars.
Expand All @@ -354,13 +387,18 @@ omegapy.omega_data.import_list_obs_csv(filename):
Correction thermique 1 - Détermitation réflectance à 5µm à partir de celle à 2.4µm puis CN -- Méthode historique (Calvin & Erard 1997)

~~~python
omegapy.omega_data.corr_therm(omega):
omegapy.omega_data.corr_therm(omega, npool=1):
Remove the thermal component in the OMEGA hyperspectral cube.

Parallelization is implemented using the multiprocessing module. The number of
process to run is controlled by the npool argument.

Parameters
==========
omega : OMEGAdata
The OMEGA observation data.
npool : int, optional (default 1)
Number of parallelized worker process to use.

Returns
=======
Expand Down Expand Up @@ -428,10 +466,13 @@ omegapy.omega_data.corr_atm2(omega):
### Correction & Saving
Import an OMEGA/MEx observation, apply a thermal and atmospheric correction (M1) and save the OMEGAdata object at each step.

~~~
~~~python
omegapy.omega_data.corr_save_omega(obsname, folder='auto', base_folder=_omega_py_path, security=True,
overwrite=True, compress=True):
overwrite=True, compress=True, npool=1):
Correction and saving of OMEGA/MEx observations.

Parallelization is implemented using the multiprocessing module. The number of
process to run is controlled by the npool argument.

Parameters
==========
Expand All @@ -452,12 +493,17 @@ omegapy.omega_data.corr_save_omega(obsname, folder='auto', base_folder=_omega_py
compress : bool, optional (default True)
If True, the radiance cube after correction is removed (i.e. set to None)
in order to reduce the size of the saved file.
npool : int, optional (default 1)
Number of parallelized worker process to use.
~~~

~~~
omegapy.omega_data.corr_save_omega_list(liste_obs, folder='auto', base_folder=_omega_py_path,
security=True, overwrite=True, compress=True):
security=True, overwrite=True, compress=True, npool=1):
Correction and saving of a list of OMEGA/MEx observations.

Parallelization is implemented using the multiprocessing module. The number of
process to run is controlled by the npool argument.

Parameters
==========
Expand All @@ -478,6 +524,8 @@ omegapy.omega_data.corr_save_omega_list(liste_obs, folder='auto', base_folder=_o
compress : bool, optional (default True)
If True, the radiance cube after correction is removed (i.e. set to None)
in order to reduce the size of the saved file.
npool : int, optional (default 1)
Number of parallelized worker process to use.
~~~

~~~python
Expand Down Expand Up @@ -537,7 +585,7 @@ omegapy.omega_data.get_names(omega_list):

~~~python
omegapy.omega_data.get_ls(omega_list):
"""Return the array of the Solar longitude of each OMEGA/MEx observation in omega_list.
Return the array of the Solar longitude of each OMEGA/MEx observation in omega_list.

Parameters
==========
Expand All @@ -552,7 +600,7 @@ omegapy.omega_data.get_ls(omega_list):


### Update quality
~~python
~~~Python
omegapy.omega_data.update_cube_quality(obs_name='ORB*.pkl', folder='auto', version=_Version,
base_folder=_omega_py_path):
Update the quality attribute of previously saved OMEGAdata objects.
Expand All @@ -571,3 +619,62 @@ omegapy.omega_data.update_cube_quality(obs_name='ORB*.pkl', folder='auto', versi
The base folder path.
~~~


### Testing observations quality
~~~python
omegapy.omega_data.test_cube(obs):
Test the quality of an OMEGA/MEx observation from the header informations
witout open it.

Parameters
==========
obs : str
The name of the OMEGA observation.

Returns
=======
test_quality : bool
| True -> Accepted observation.
| False -> Rejected observation.
~~~

~~~python
omegapy.omega_data.compute_list_good_observations(savfilename='liste_good_obs.csv',
folder='../data/OMEGA/liste_obs', security=True):
Scan the available OMEGA/MEx data cubes and list the observations considered as
good quality.
The results are saved in the specified csv file.

Parameters
==========
savfilename : str
The name of the csv file to save the data.
folder : str
The name of the folder where the saved file will be located.
Final saved file path = folder + savfilename
security : bool, optional (default True)
Enable / disable checking before overwriting a file.
| True -> Check if the target file already exists before overwriting on it.
And if is the case, you will be asked for a confirmation.
| False -> Didn't care about the already existing files.
~~~

### Conversion UTC to MY
~~~python
omegapy.omega_data.utc_to_my(dt):
Convert a UTC datetime to the corresponding Martian Year (MY).

Martian Years are numbered according to the calendar proposed by R. Todd Clancy
(Clancy et al., Journal of Geophys. Res 105, p 9553, 2000): Martian Year 1 begins
(at a time such that Ls=0) on April 11th, 1955.

Parameters
==========
dt : datetime.datetime
The UTC datetime object.

Returns
=======
my : int
The corresponding Martian Year.
~~~
Loading

0 comments on commit e260407

Please sign in to comment.