Commit 3ef8ce17 authored by Qusai Al Shidi's avatar Qusai Al Shidi
Browse files

More doc fixes

parent b5a80a14
...@@ -61,7 +61,6 @@ use swmfpy.io.read_omni_data(). ...@@ -61,7 +61,6 @@ use swmfpy.io.read_omni_data().
**Examples**: **Examples**:
```python ```python
import datetime import datetime
import swmfpy.web import swmfpy.web
...@@ -112,7 +111,6 @@ pattern: adapt4[0,1]3*yyyymmddhh ...@@ -112,7 +111,6 @@ pattern: adapt4[0,1]3*yyyymmddhh
**Examples**: **Examples**:
```python ```python
import datetime as dt import datetime as dt
# Use datetime objects for the time # Use datetime objects for the time
...@@ -152,8 +150,7 @@ text file into a dictionary of lists. ...@@ -152,8 +150,7 @@ text file into a dictionary of lists.
- `dict` - { - `dict` - {
Auroral indeces 'AL', 'AE', 'AO', 'AU' (int): { Auroral indeces 'AL', 'AE', 'AO', 'AU' (int): {
- `'times'` _datetime.datetime_ - List of datetime objects 'times' (datetime.datetime)
corresponding to time in UT.
- `'values'` _int_ - List of indeces. - `'values'` _int_ - List of indeces.
} }
...@@ -184,7 +181,6 @@ and puts it into a dictionary. ...@@ -184,7 +181,6 @@ and puts it into a dictionary.
**Examples**: **Examples**:
```python ```python
indeces = swmfpy.io.read_wdc_asy_sym('wdc.dat') indeces = swmfpy.io.read_wdc_asy_sym('wdc.dat')
# Plot data # Plot data
plt.plot(indeces['SYM-H']['times'], plt.plot(indeces['SYM-H']['times'],
...@@ -192,7 +188,6 @@ and puts it into a dictionary. ...@@ -192,7 +188,6 @@ and puts it into a dictionary.
label='SYM-H [nT]' label='SYM-H [nT]'
) )
plt.xlabel('Time [UT]') plt.xlabel('Time [UT]')
``` ```
Important to note if there is bad data it will be filled as None. Important to note if there is bad data it will be filled as None.
...@@ -214,6 +209,7 @@ and turn it into a pandas.DataFrame. ...@@ -214,6 +209,7 @@ and turn it into a pandas.DataFrame.
magnetic_field, velocity magnetic_field, velocity
- `filtering` _bool_ - default=False Remove points where the value - `filtering` _bool_ - default=False Remove points where the value
is >sigma (default: sigma=3) from mean. is >sigma (default: sigma=3) from mean.
**kwargs: **kwargs:
- `coarseness` _int_ - default=3, Number of standard deviations - `coarseness` _int_ - default=3, Number of standard deviations
above which to remove if filtering=True. above which to remove if filtering=True.
...@@ -247,6 +243,9 @@ that SWMF can read as input IMF (IMF.dat). ...@@ -247,6 +243,9 @@ that SWMF can read as input IMF (IMF.dat).
- `enable_rb` - Enables solar wind input for the radiation belt model. - `enable_rb` - Enables solar wind input for the radiation belt model.
- `(default` - True) - `(default` - True)
**kwargs:
- `gse` _bool_ - (default: False) Use GSE coordinates instead of GSM.
Other paramaters: Other paramaters:
- `gse` - (default=False) - `gse` - (default=False)
Use GSE coordinate system for the file instead of GSM default. Use GSE coordinate system for the file instead of GSM default.
...@@ -282,13 +281,11 @@ from the GM model log. ...@@ -282,13 +281,11 @@ from the GM model log.
To plot AL and Dst get the log files To plot AL and Dst get the log files
```python ```python
geo = swmfpy.io.read_gm_log('run/GM/IO2/geoindex_e20140215-100500.log') geo = swmfpy.io.read_gm_log('run/GM/IO2/geoindex_e20140215-100500.log')
dst = swmfpy.io.read_gm_log('run/GM/IO2/log_e20140215-100500.log') dst = swmfpy.io.read_gm_log('run/GM/IO2/log_e20140215-100500.log')
# Plot AL indeces # Plot AL indeces
plt.plot(geo['times', geo['AL']) plt.plot(geo['times', geo['AL'])
``` ```
<a name=".swmfpy.paramin"></a> <a name=".swmfpy.paramin"></a>
...@@ -329,12 +326,10 @@ Note, if you have repeat commands this will replace all the repeats. ...@@ -329,12 +326,10 @@ Note, if you have repeat commands this will replace all the repeats.
**Examples**: **Examples**:
```python ```python
change['`SOLARWINDFILE`'] = [['T', 'UseSolarWindFile'], change['`SOLARWINDFILE`'] = [['T', 'UseSolarWindFile'],
['new_imf.dat', 'NameSolarWindFile']] ['new_imf.dat', 'NameSolarWindFile']]
# This will overwrite PARAM.in # This will overwrite PARAM.in
swmfpy.paramin.replace('PARAM.in.template', change) swmfpy.paramin.replace('PARAM.in.template', change)
``` ```
<a name=".swmfpy.paramin.read_command"></a> <a name=".swmfpy.paramin.read_command"></a>
...@@ -372,12 +367,10 @@ This will find the `COMMAND` and return a list of values for the parameters. ...@@ -372,12 +367,10 @@ This will find the `COMMAND` and return a list of values for the parameters.
**Examples**: **Examples**:
```python ```python
start_time = swmfpy.paramin.read_command('`STARTTIME`') start_time = swmfpy.paramin.read_command('`STARTTIME`')
end_time = swmfpy.paramin.read_command('`ENDTIME`') end_time = swmfpy.paramin.read_command('`ENDTIME`')
print('Starting month is ', start_time[1]) print('Starting month is ', start_time[1])
print('Ending month is ', end_time[1]) print('Ending month is ', end_time[1])
``` ```
This will treat all following lines as values for the command. To suppress This will treat all following lines as values for the command. To suppress
......
...@@ -21,8 +21,7 @@ def read_wdc_ae(wdc_filename): ...@@ -21,8 +21,7 @@ def read_wdc_ae(wdc_filename):
dict: { dict: {
Auroral indeces 'AL', 'AE', 'AO', 'AU' (int): { Auroral indeces 'AL', 'AE', 'AO', 'AU' (int): {
'times' (datetime.datetime): List of datetime objects 'times' (datetime.datetime)
corresponding to time in UT.
'values' (int): List of indeces. 'values' (int): List of indeces.
} }
""" """
...@@ -78,7 +77,6 @@ def read_wdc_asy_sym(wdc_filename): ...@@ -78,7 +77,6 @@ def read_wdc_asy_sym(wdc_filename):
Examples: Examples:
```python ```python
indeces = swmfpy.io.read_wdc_asy_sym('wdc.dat') indeces = swmfpy.io.read_wdc_asy_sym('wdc.dat')
# Plot data # Plot data
plt.plot(indeces['SYM-H']['times'], plt.plot(indeces['SYM-H']['times'],
...@@ -86,7 +84,6 @@ def read_wdc_asy_sym(wdc_filename): ...@@ -86,7 +84,6 @@ def read_wdc_asy_sym(wdc_filename):
label='SYM-H [nT]' label='SYM-H [nT]'
) )
plt.xlabel('Time [UT]') plt.xlabel('Time [UT]')
``` ```
Important to note if there is bad data it will be filled as None. Important to note if there is bad data it will be filled as None.
...@@ -160,6 +157,7 @@ def read_omni_csv(filename, filtering=False, **kwargs): ...@@ -160,6 +157,7 @@ def read_omni_csv(filename, filtering=False, **kwargs):
magnetic_field, velocity magnetic_field, velocity
filtering (bool): default=False Remove points where the value filtering (bool): default=False Remove points where the value
is >sigma (default: sigma=3) from mean. is >sigma (default: sigma=3) from mean.
**kwargs: **kwargs:
coarseness (int): default=3, Number of standard deviations coarseness (int): default=3, Number of standard deviations
above which to remove if filtering=True. above which to remove if filtering=True.
...@@ -222,6 +220,9 @@ def write_imf_input(data, outfilename="IMF.dat", enable_rb=True, **kwargs): ...@@ -222,6 +220,9 @@ def write_imf_input(data, outfilename="IMF.dat", enable_rb=True, **kwargs):
enable_rb: Enables solar wind input for the radiation belt model. enable_rb: Enables solar wind input for the radiation belt model.
(default: True) (default: True)
**kwargs:
gse (bool): (default: False) Use GSE coordinates instead of GSM.
Other paramaters: Other paramaters:
gse: (default=False) gse: (default=False)
Use GSE coordinate system for the file instead of GSM default. Use GSE coordinate system for the file instead of GSM default.
...@@ -296,13 +297,11 @@ def read_gm_log(filename, colnames=None, dtypes=None, index_time=True): ...@@ -296,13 +297,11 @@ def read_gm_log(filename, colnames=None, dtypes=None, index_time=True):
Examples: Examples:
To plot AL and Dst get the log files To plot AL and Dst get the log files
```python ```python
geo = swmfpy.io.read_gm_log('run/GM/IO2/geoindex_e20140215-100500.log') geo = swmfpy.io.read_gm_log('run/GM/IO2/geoindex_e20140215-100500.log')
dst = swmfpy.io.read_gm_log('run/GM/IO2/log_e20140215-100500.log') dst = swmfpy.io.read_gm_log('run/GM/IO2/log_e20140215-100500.log')
# Plot AL indeces # Plot AL indeces
plt.plot(geo['times', geo['AL']) plt.plot(geo['times', geo['AL'])
``` ```
""" """
......
...@@ -30,12 +30,10 @@ def replace_command(parameters, input_file, output_file='PARAM.in'): ...@@ -30,12 +30,10 @@ def replace_command(parameters, input_file, output_file='PARAM.in'):
Examples: Examples:
```python ```python
change['#SOLARWINDFILE'] = [['T', 'UseSolarWindFile'], change['#SOLARWINDFILE'] = [['T', 'UseSolarWindFile'],
['new_imf.dat', 'NameSolarWindFile']] ['new_imf.dat', 'NameSolarWindFile']]
# This will overwrite PARAM.in # This will overwrite PARAM.in
swmfpy.paramin.replace('PARAM.in.template', change) swmfpy.paramin.replace('PARAM.in.template', change)
``` ```
""" """
# Author: Qusai Al Shidi # Author: Qusai Al Shidi
...@@ -93,12 +91,10 @@ def read_command(command, paramin_file='PARAM.in', **kwargs): ...@@ -93,12 +91,10 @@ def read_command(command, paramin_file='PARAM.in', **kwargs):
Examples: Examples:
```python ```python
start_time = swmfpy.paramin.read_command('#STARTTIME') start_time = swmfpy.paramin.read_command('#STARTTIME')
end_time = swmfpy.paramin.read_command('#ENDTIME') end_time = swmfpy.paramin.read_command('#ENDTIME')
print('Starting month is ', start_time[1]) print('Starting month is ', start_time[1])
print('Ending month is ', end_time[1]) print('Ending month is ', end_time[1])
``` ```
This will treat all following lines as values for the command. To suppress This will treat all following lines as values for the command. To suppress
......
...@@ -28,7 +28,6 @@ def get_omni_data(time_from, time_to, **kwargs): ...@@ -28,7 +28,6 @@ def get_omni_data(time_from, time_to, **kwargs):
Examples: Examples:
```python ```python
import datetime import datetime
import swmfpy.web import swmfpy.web
...@@ -163,7 +162,6 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs): ...@@ -163,7 +162,6 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs):
Examples: Examples:
```python ```python
import datetime as dt import datetime as dt
# Use datetime objects for the time # Use datetime objects for the time
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment