-
Notifications
You must be signed in to change notification settings - Fork 2
/
configuration.html
270 lines (257 loc) · 17.6 KB
/
configuration.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>SpacePy Configuration — SpacePy v0.7.0 Manual</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b76e3c8a" />
<link rel="stylesheet" type="text/css" href="_static/sphinxdoc.css?v=92e3d466" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=fd3f3429" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<script src="_static/documentation_options.js?v=fe7df9b0"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script type="text/javascript" src="_static/copybutton.js"></script>
<link rel="icon" href="_static/spacepy_favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="SpacePy Scripts" href="scripts.html" />
<link rel="prev" title="Publication List" href="publications.html" />
</head><body>
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="index.html"><img src="_static/spacepy_logo.jpg" border="0" alt="spacepy_logo"/></a>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="scripts.html" title="SpacePy Scripts"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="publications.html" title="Publication List"
accesskey="P">previous</a> |</li>
<li><a href="https://spacepy.github.io/"">homepage</a>| </li>
<li><a href="https://github.com/spacepy/spacepy">development</a>| </li>
<li><a href="search.html">search</a>| </li>
<li><a href="index.html">documentation </a> »</li>
<li class="nav-item nav-item-this"><a href="">SpacePy Configuration</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="spacepy-configuration">
<h1>SpacePy Configuration<a class="headerlink" href="#spacepy-configuration" title="Link to this heading">¶</a></h1>
<p>SpacePy has a few tunable options that can be altered through the <code class="docutils literal notranslate"><span class="pre">spacepy.rc</span></code>
configuration file. All options have defaults which will be used if not specified in
the configuration file. These defaults are usually fine for most people and may
change between SpacePy releases, so we do not recommend changing the
configuration file without substantial reason.</p>
<p><code class="docutils literal notranslate"><span class="pre">spacepy.rc</span></code> lives in the per-user SpacePy directory, called <code class="docutils literal notranslate"><span class="pre">.spacepy</span></code>.
You can find this directory by:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">spacepy</span>
<span class="gp">>>> </span><span class="n">spacepy</span><span class="o">.</span><span class="n">DOT_FLN</span>
<span class="go">'/home/username/.spacepy'</span>
</pre></div>
</div>
<p>On Unix-like operating systems, it is in a user’s home directory; on Windows,
in the user’s Documents and Settings folder. If it doesn’t exist, this directory
(and <code class="docutils literal notranslate"><span class="pre">spacepy.rc</span></code>) is automatically created when SpacePy is imported.</p>
<p><code class="docutils literal notranslate"><span class="pre">spacepy.rc</span></code> has an INI-style format, parsed by <a class="reference external" href="https://docs.python.org/3/library/configparser.html#module-configparser" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">configparser</span></code></a>. It
contains a single section, <code class="docutils literal notranslate"><span class="pre">[spacepy]</span></code>.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#the-spacepy-directory">The spacepy directory</a></p></li>
<li><p><a class="reference internal" href="#available-configuration-options">Available configuration options</a></p></li>
<li><p><a class="reference internal" href="#developer-documentation">Developer documentation</a></p></li>
</ul>
</div></blockquote>
<section id="the-spacepy-directory">
<h2>The spacepy directory<a class="headerlink" href="#the-spacepy-directory" title="Link to this heading">¶</a></h2>
<p>If you prefer a different location for the SpacePy
directory, set the environment variable <code class="docutils literal notranslate"><span class="pre">$SPACEPY</span></code> to a location of
your choice. For example, with a <code class="docutils literal notranslate"><span class="pre">csh</span></code>, or <code class="docutils literal notranslate"><span class="pre">tcsh</span></code> you would:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">setenv</span> <span class="n">SPACEPY</span> <span class="o">/</span><span class="n">a</span><span class="o">/</span><span class="n">different</span><span class="o">/</span><span class="nb">dir</span>
</pre></div>
</div>
<p>for the <code class="docutils literal notranslate"><span class="pre">bash</span></code> shell you would:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">export</span> <span class="n">SPACEPY</span><span class="o">=/</span><span class="n">a</span><span class="o">/</span><span class="n">different</span><span class="o">/</span><span class="nb">dir</span>
</pre></div>
</div>
<p>If <code class="docutils literal notranslate"><span class="pre">$SPACEPY</span></code> is not an absolute path, it is treated as relative to
the working directory at the time of import. In particular, that means
if it is defined as an empty string (rather than an undefined
variable), <code class="docutils literal notranslate"><span class="pre">.spacepy</span></code> is made directly in the current
directory. Home directory references (<code class="docutils literal notranslate"><span class="pre">~</span></code>) are expanded via
<a class="reference external" href="https://docs.python.org/3/library/os.path.html#os.path.expanduser" title="(in Python v3.13)"><code class="xref py py-func docutils literal notranslate"><span class="pre">expanduser()</span></code></a>.</p>
<p>If you change the default location, make sure you add the environment
variable <code class="docutils literal notranslate"><span class="pre">$SPACEPY</span></code> to your <code class="docutils literal notranslate"><span class="pre">.cshrc,</span> <span class="pre">.tcshrc,</span></code> or <code class="docutils literal notranslate"><span class="pre">.bashrc</span></code>
script. If this directory does not exist, it will be created.</p>
<p>The actual <code class="docutils literal notranslate"><span class="pre">.spacepy</span></code> directory is made inside the directory
specified by <code class="docutils literal notranslate"><span class="pre">$SPACEPY</span></code>.</p>
<p>This directory contains the configuration file and also SpacePy-related
data, which can be updated with <a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a>.</p>
</section>
<section id="available-configuration-options">
<h2>Available configuration options<a class="headerlink" href="#available-configuration-options" title="Link to this heading">¶</a></h2>
<dl class="simple">
<dt>enable_old_data_warning</dt><dd><p>SpacePy maintains certain databases from external sources, notably the
leapsecond database used by <a class="reference internal" href="autosummary/spacepy.time.html#module-spacepy.time" title="spacepy.time"><code class="xref py py-mod docutils literal notranslate"><span class="pre">time</span></code></a>. By default
<a class="reference external" href="https://docs.python.org/3/library/exceptions.html#UserWarning" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">UserWarning</span></code></a> is issued if the leap second database
is out of date. Set this option to False to suppress this warning (and
warnings about out-of-date data which may be added in the future.)</p>
</dd>
<dt>keepalive</dt><dd><p>True to attempt to use HTTP keepalives when downloading data in
<a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a> (default). This is faster when
downloading many small files but may be fragile (e.g. if a proxy
server is required). Set to False for a more robust and flexible,
but slower, codepath.</p>
</dd>
<dt>leapsec_url</dt><dd><p>URL of the leapsecond database used by time conversions.
<a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a> will download from the URL.
The default should almost always be acceptable.</p>
</dd>
<dt>ncpus</dt><dd><p>Number of CPUs to use for computations that can be
multithreaded/multiprocessed. By default, they will use the number of CPUs
reported by <a class="reference external" href="https://docs.python.org/3/library/multiprocessing.html#multiprocessing.cpu_count" title="(in Python v3.13)"><code class="xref py py-func docutils literal notranslate"><span class="pre">multiprocessing.cpu_count()</span></code></a>. You may wish to set this
to a lower number if you need to reserve other processors on your machine.</p>
</dd>
<dt>notice</dt><dd><p>True to display the SpacePy license and other information on import (default);
False to omit.</p>
</dd>
<dt>omni2_url</dt><dd><p>URL containing the OMNI2 data.
<a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a> will download from the URL.
The default should almost always be acceptable.</p>
</dd>
<dt>qindenton_url</dt><dd><p>URL containing Qin-Denton packaging of OMNI data as as single file.
<a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a> will download from the URL.
The default should almost always be acceptable.</p>
</dd>
<dt>qd_daily_url</dt><dd><p>URL containing Qin-Denton packaging of OMNI data in daily files,
supplemental to <code class="docutils literal notranslate"><span class="pre">qindenton_url</span></code>. <a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a>
will download from the URL. The default should almost always be
acceptable.</p>
</dd>
<dt>psddata_url</dt><dd><p>URL containing PSD data.
<a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a> will download from the URL if requested.
The default should almost always be acceptable.</p>
</dd>
<dt>support_notice</dt><dd><p>True to display a notice on import if not a release version of SpacePy
(default); False to omit. Those regularly installing from git instead
of a release may want to set this to False.</p>
</dd>
<dt>user_agent</dt><dd><p>User Agent for network access. If this is set,
<a class="reference internal" href="autosummary/spacepy.toolbox.html#spacepy.toolbox.update" title="spacepy.toolbox.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">update()</span></code></a> will use this User Agent string on all
HTTP requests. Normally leaving this unset should be fine.</p>
</dd>
</dl>
</section>
<section id="developer-documentation">
<h2>Developer documentation<a class="headerlink" href="#developer-documentation" title="Link to this heading">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">spacepy.rc</span></code> is loaded into a dictionary (<code class="docutils literal notranslate"><span class="pre">spacepy.config</span></code>) by SpacePy’s
main <code class="docutils literal notranslate"><span class="pre">__init__.py</span></code>. All options from the <code class="docutils literal notranslate"><span class="pre">[spacepy]</span></code> section are loaded,
with no developer intervention needed. Each key is the option’s name; the
associated value is the option’s value. To specify a default, add to the
<code class="docutils literal notranslate"><span class="pre">defaults</span></code> dictionary at the top of <code class="docutils literal notranslate"><span class="pre">_read_config</span></code>; each default, if not
overridden by the config file, will be included in the config dict. Values are
assumed to be strings. The <code class="docutils literal notranslate"><span class="pre">caster</span></code> dictionary is keyed by option name; the
value for each key is a function to be applied to the value with the same key
to produce a different type from a string.</p>
<hr class="docutils" />
<dl class="field-list simple">
<dt class="field-odd">Release<span class="colon">:</span></dt>
<dd class="field-odd"><p>0.7.0</p>
</dd>
<dt class="field-even">Doc generation date<span class="colon">:</span></dt>
<dd class="field-even"><p>Nov 08, 2024</p>
</dd>
</dl>
<p>For additions or fixes to this page, contact the SpacePy Team at Los Alamos.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/logo.png" alt="Logo"/>
</a></p>
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">SpacePy Configuration</a><ul>
<li><a class="reference internal" href="#the-spacepy-directory">The spacepy directory</a></li>
<li><a class="reference internal" href="#available-configuration-options">Available configuration options</a></li>
<li><a class="reference internal" href="#developer-documentation">Developer documentation</a></li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="publications.html"
title="previous chapter">Publication List</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="scripts.html"
title="next chapter">SpacePy Scripts</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/configuration.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="scripts.html" title="SpacePy Scripts"
>next</a> |</li>
<li class="right" >
<a href="publications.html" title="Publication List"
>previous</a> |</li>
<li><a href="https://spacepy.github.io/"">homepage</a>| </li>
<li><a href="https://github.com/spacepy/spacepy">development</a>| </li>
<li><a href="search.html">search</a>| </li>
<li><a href="index.html">documentation </a> »</li>
<li class="nav-item nav-item-this"><a href="">SpacePy Configuration</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011-2024, The SpacePy Team.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
</div>
</body>
</html>