skycalc-cli 1.3__tar.gz → 1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- skycalc_cli-1.5/PKG-INFO +40 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/README.rst +2 -1
- {skycalc_cli-1.3 → skycalc_cli-1.5}/setup.py +3 -8
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli/skycalc.py +30 -19
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli/skycalc_cli.py +3 -4
- skycalc_cli-1.5/skycalc_cli.egg-info/PKG-INFO +40 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli.egg-info/entry_points.txt +0 -1
- skycalc_cli-1.5/skycalc_cli.egg-info/requires.txt +1 -0
- skycalc_cli-1.3/PKG-INFO +0 -43
- skycalc_cli-1.3/skycalc_cli.egg-info/PKG-INFO +0 -43
- skycalc_cli-1.3/skycalc_cli.egg-info/requires.txt +0 -2
- {skycalc_cli-1.3 → skycalc_cli-1.5}/LICENSE.txt +0 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/MANIFEST.in +0 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/setup.cfg +0 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli/__init__.py +0 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli.egg-info/SOURCES.txt +0 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli.egg-info/dependency_links.txt +0 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli.egg-info/not-zip-safe +0 -0
- {skycalc_cli-1.3 → skycalc_cli-1.5}/skycalc_cli.egg-info/top_level.txt +0 -0
skycalc_cli-1.5/PKG-INFO
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: skycalc_cli
|
|
3
|
+
Version: 1.5
|
|
4
|
+
Summary: ESO SkyCalc Command Line Interface
|
|
5
|
+
Home-page: http://www.eso.org/observing/etc/bin/gen/form?INS.MODE=swspectr+INS.NAME=SKYCALC
|
|
6
|
+
Author: European Southern Observatory
|
|
7
|
+
Author-email: usd-help@eso.org
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: sky model observatory telescope astronomy ephemeris sun moon
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
License-File: LICENSE.txt
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
|
|
19
|
+
######################################
|
|
20
|
+
SkyCalc Command Line Interface (CLI)
|
|
21
|
+
######################################
|
|
22
|
+
|
|
23
|
+
============
|
|
24
|
+
Installation
|
|
25
|
+
============
|
|
26
|
+
|
|
27
|
+
The SkyCalc CLI requires Python 3.8 or later (Python 2 users: pip installs
|
|
28
|
+
the last compatible release, 1.4). Install the SkyCalc CLI
|
|
29
|
+
on your computer using the command: ::
|
|
30
|
+
|
|
31
|
+
pip install --user skycalc_cli
|
|
32
|
+
|
|
33
|
+
This will also install skycalc_cli's dependency, i.e. the requests package for
|
|
34
|
+
making HTTP calls.
|
|
35
|
+
|
|
36
|
+
=============
|
|
37
|
+
Documentation
|
|
38
|
+
=============
|
|
39
|
+
|
|
40
|
+
Documentation can be found on the `ESO SkyCalc Web Page <https://www.eso.org/observing/etc/doc/skycalc/helpskycalccli.html>`_.
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
Installation
|
|
7
7
|
============
|
|
8
8
|
|
|
9
|
-
The SkyCalc CLI
|
|
9
|
+
The SkyCalc CLI requires Python 3.8 or later (Python 2 users: pip installs
|
|
10
|
+
the last compatible release, 1.4). Install the SkyCalc CLI
|
|
10
11
|
on your computer using the command: ::
|
|
11
12
|
|
|
12
13
|
pip install --user skycalc_cli
|
|
@@ -8,18 +8,14 @@ def readme():
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
setup(name='skycalc_cli',
|
|
11
|
-
version='1.
|
|
11
|
+
version='1.5',
|
|
12
12
|
description='ESO SkyCalc Command Line Interface',
|
|
13
13
|
long_description=readme(),
|
|
14
14
|
classifiers=[
|
|
15
15
|
'Development Status :: 5 - Production/Stable',
|
|
16
16
|
'License :: OSI Approved :: MIT License',
|
|
17
|
-
'Programming Language :: Python :: 2',
|
|
18
|
-
'Programming Language :: Python :: 2.7',
|
|
19
17
|
'Programming Language :: Python :: 3',
|
|
20
|
-
'Programming Language :: Python :: 3
|
|
21
|
-
'Programming Language :: Python :: 3.5',
|
|
22
|
-
'Programming Language :: Python :: 3.6',
|
|
18
|
+
'Programming Language :: Python :: 3 :: Only',
|
|
23
19
|
'Topic :: Scientific/Engineering :: Astronomy',
|
|
24
20
|
],
|
|
25
21
|
keywords='sky model observatory telescope astronomy ephemeris sun moon',
|
|
@@ -29,10 +25,9 @@ setup(name='skycalc_cli',
|
|
|
29
25
|
author_email='usd-help@eso.org',
|
|
30
26
|
license='MIT',
|
|
31
27
|
packages=['skycalc_cli'],
|
|
32
|
-
python_requires='>=
|
|
28
|
+
python_requires='>=3.8',
|
|
33
29
|
install_requires=[
|
|
34
30
|
'requests',
|
|
35
|
-
'setuptools'
|
|
36
31
|
],
|
|
37
32
|
entry_points={
|
|
38
33
|
'console_scripts': ['skycalc_cli=skycalc_cli.skycalc_cli:main'],
|
|
@@ -2,20 +2,35 @@
|
|
|
2
2
|
"""skycalc Module"""
|
|
3
3
|
|
|
4
4
|
from __future__ import print_function
|
|
5
|
+
import os
|
|
5
6
|
import sys
|
|
6
7
|
import json
|
|
7
8
|
from datetime import datetime
|
|
8
9
|
import requests
|
|
9
10
|
|
|
11
|
+
# Base URL of the SkyCalc service (an ETC web installation). The CLI uses its
|
|
12
|
+
# CGI scripts under bin/script and the result directory tmp. This is the only
|
|
13
|
+
# place a server name appears; the backend is planned to move to a stable
|
|
14
|
+
# name under etc.eso.org, at which point only this constant changes.
|
|
15
|
+
# Override with the environment variable SKYCALC_CLI_BASE_URL or the base_url
|
|
16
|
+
# argument of SkyModel and AlmanacQuery, e.g.
|
|
17
|
+
# 'http://localhost:8080/observing/etc' for a local etc1 container.
|
|
18
|
+
DEFAULT_BASE_URL = 'https://etimecalret-002.eso.org/observing/etc'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_base_url(base_url=None):
|
|
22
|
+
"""Return the base URL to use, without a trailing slash."""
|
|
23
|
+
url = base_url or os.environ.get('SKYCALC_CLI_BASE_URL') or DEFAULT_BASE_URL
|
|
24
|
+
return url.rstrip('/')
|
|
25
|
+
|
|
10
26
|
|
|
11
27
|
class AlmanacQuery:
|
|
12
28
|
"""AlmanacQuery for Querying the SkyCalc Almanac"""
|
|
13
29
|
|
|
14
|
-
def __init__(self, indic):
|
|
30
|
+
def __init__(self, indic, base_url=None):
|
|
15
31
|
|
|
16
32
|
self.almdata = None
|
|
17
|
-
self.
|
|
18
|
-
self.almurl = '/observing/etc/api/skycalc_almanac'
|
|
33
|
+
self.almurl = get_base_url(base_url) + '/bin/script/skycalc_almanac.py'
|
|
19
34
|
|
|
20
35
|
# Left: users keyword (skycalc_cli),
|
|
21
36
|
# Right: skycalc Almanac output keywords
|
|
@@ -100,11 +115,9 @@ class AlmanacQuery:
|
|
|
100
115
|
|
|
101
116
|
def query(self):
|
|
102
117
|
|
|
103
|
-
url = self.almserver + self.almurl
|
|
104
|
-
|
|
105
118
|
rawdata = None
|
|
106
119
|
try:
|
|
107
|
-
response = requests.post(
|
|
120
|
+
response = requests.post(self.almurl, data=json.dumps(self.almindic))
|
|
108
121
|
rawdata = response.text
|
|
109
122
|
except requests.exceptions.RequestException as e:
|
|
110
123
|
print('Error: Almanac query failed.')
|
|
@@ -153,13 +166,13 @@ class bcolors:
|
|
|
153
166
|
class SkyModel:
|
|
154
167
|
"""SkyModel for querying the Advanced SkyModel"""
|
|
155
168
|
|
|
156
|
-
def __init__(self):
|
|
169
|
+
def __init__(self, base_url=None):
|
|
157
170
|
|
|
158
171
|
self.stop_on_errors_and_exceptions = True
|
|
159
172
|
self.data = None
|
|
160
|
-
self.
|
|
161
|
-
self.url = self.
|
|
162
|
-
self.deleter_script_url = self.
|
|
173
|
+
self.base_url = get_base_url(base_url)
|
|
174
|
+
self.url = self.base_url + '/bin/script/skycalc_api.py'
|
|
175
|
+
self.deleter_script_url = self.base_url + '/bin/script/rmtmp.py'
|
|
163
176
|
self.bugreport_text = ''
|
|
164
177
|
self.tmpdir = ''
|
|
165
178
|
self.params = {
|
|
@@ -253,11 +266,13 @@ class SkyModel:
|
|
|
253
266
|
# lam/dlam where dlam is wavelength step (not the res.element)
|
|
254
267
|
'wres': 20000,
|
|
255
268
|
'wgrid_user': [500.0, 510.0, 520.0, 530.0, 540.0, 550.0],
|
|
256
|
-
#
|
|
269
|
+
# convolve by Line Spread Function
|
|
257
270
|
'lsf_type': 'none', # string grid ['none','Gaussian','Boxcar']
|
|
258
271
|
'lsf_gauss_fwhm': 5.0, # wavelength bins float > 0
|
|
259
272
|
'lsf_boxcar_fwhm': 5.0, # wavelength bins float > 0
|
|
260
|
-
'observatory': 'paranal'
|
|
273
|
+
'observatory': 'paranal', # paranal
|
|
274
|
+
# compute temperature and bolometric radiance
|
|
275
|
+
'temp_flag': 1
|
|
261
276
|
}
|
|
262
277
|
|
|
263
278
|
def handle_exception(self, e, msg):
|
|
@@ -318,8 +333,7 @@ class SkyModel:
|
|
|
318
333
|
self.handle_exception(
|
|
319
334
|
e, 'Exception raised trying to decode server response ')
|
|
320
335
|
|
|
321
|
-
tmpurl = self.
|
|
322
|
-
tmpdir + '/skytable.fits'
|
|
336
|
+
tmpurl = self.base_url + '/tmp/' + tmpdir + '/skytable.fits'
|
|
323
337
|
|
|
324
338
|
if(status == 'success'):
|
|
325
339
|
try:
|
|
@@ -341,17 +355,14 @@ class SkyModel:
|
|
|
341
355
|
|
|
342
356
|
def callwith(self, newparams):
|
|
343
357
|
for key, val in newparams.items():
|
|
344
|
-
|
|
345
|
-
self.params[key] = val
|
|
346
|
-
else: # invalid
|
|
347
|
-
print('callwith() ignoring invalid keyword: ', key)
|
|
358
|
+
self.params[key] = val
|
|
348
359
|
self.call()
|
|
349
360
|
|
|
350
361
|
def printparams(self, keys=None):
|
|
351
362
|
if keys is None:
|
|
352
363
|
p = self.params
|
|
353
364
|
else:
|
|
354
|
-
p = dict((k, self.params[k]) for k in keys
|
|
365
|
+
p = dict((k, self.params[k]) for k in keys)
|
|
355
366
|
for k in p:
|
|
356
367
|
print(k, p[k])
|
|
357
368
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
# please contact usd-help@eso.org
|
|
7
7
|
|
|
8
8
|
from __future__ import print_function
|
|
9
|
-
import pkg_resources
|
|
10
9
|
import sys
|
|
11
10
|
import json
|
|
12
11
|
import getopt
|
|
@@ -100,9 +99,9 @@ def main():
|
|
|
100
99
|
if opt in ("-h", "--help"):
|
|
101
100
|
usage()
|
|
102
101
|
sys.exit()
|
|
103
|
-
elif opt
|
|
104
|
-
version
|
|
105
|
-
print('skycalc_cli version ' +
|
|
102
|
+
elif opt == "--version":
|
|
103
|
+
from importlib.metadata import version as pkg_version
|
|
104
|
+
print('skycalc_cli version ' + pkg_version('skycalc_cli'))
|
|
106
105
|
sys.exit(0)
|
|
107
106
|
elif opt in ("-v", "--verbose"):
|
|
108
107
|
isVerbose = True
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: skycalc_cli
|
|
3
|
+
Version: 1.5
|
|
4
|
+
Summary: ESO SkyCalc Command Line Interface
|
|
5
|
+
Home-page: http://www.eso.org/observing/etc/bin/gen/form?INS.MODE=swspectr+INS.NAME=SKYCALC
|
|
6
|
+
Author: European Southern Observatory
|
|
7
|
+
Author-email: usd-help@eso.org
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: sky model observatory telescope astronomy ephemeris sun moon
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
License-File: LICENSE.txt
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
|
|
19
|
+
######################################
|
|
20
|
+
SkyCalc Command Line Interface (CLI)
|
|
21
|
+
######################################
|
|
22
|
+
|
|
23
|
+
============
|
|
24
|
+
Installation
|
|
25
|
+
============
|
|
26
|
+
|
|
27
|
+
The SkyCalc CLI requires Python 3.8 or later (Python 2 users: pip installs
|
|
28
|
+
the last compatible release, 1.4). Install the SkyCalc CLI
|
|
29
|
+
on your computer using the command: ::
|
|
30
|
+
|
|
31
|
+
pip install --user skycalc_cli
|
|
32
|
+
|
|
33
|
+
This will also install skycalc_cli's dependency, i.e. the requests package for
|
|
34
|
+
making HTTP calls.
|
|
35
|
+
|
|
36
|
+
=============
|
|
37
|
+
Documentation
|
|
38
|
+
=============
|
|
39
|
+
|
|
40
|
+
Documentation can be found on the `ESO SkyCalc Web Page <https://www.eso.org/observing/etc/doc/skycalc/helpskycalccli.html>`_.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests
|
skycalc_cli-1.3/PKG-INFO
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 1.2
|
|
2
|
-
Name: skycalc_cli
|
|
3
|
-
Version: 1.3
|
|
4
|
-
Summary: ESO SkyCalc Command Line Interface
|
|
5
|
-
Home-page: http://www.eso.org/observing/etc/bin/gen/form?INS.MODE=swspectr+INS.NAME=SKYCALC
|
|
6
|
-
Author: European Southern Observatory
|
|
7
|
-
Author-email: usd-help@eso.org
|
|
8
|
-
License: MIT
|
|
9
|
-
Description-Content-Type: UNKNOWN
|
|
10
|
-
Description: ######################################
|
|
11
|
-
SkyCalc Command Line Interface (CLI)
|
|
12
|
-
######################################
|
|
13
|
-
|
|
14
|
-
============
|
|
15
|
-
Installation
|
|
16
|
-
============
|
|
17
|
-
|
|
18
|
-
The SkyCalc CLI works in Python 2.7 or Python3. Install the SkyCalc CLI
|
|
19
|
-
on your computer using the command: ::
|
|
20
|
-
|
|
21
|
-
pip install --user skycalc_cli
|
|
22
|
-
|
|
23
|
-
This will also install skycalc_cli's dependency, i.e. the requests package for
|
|
24
|
-
making HTTP calls.
|
|
25
|
-
|
|
26
|
-
=============
|
|
27
|
-
Documentation
|
|
28
|
-
=============
|
|
29
|
-
|
|
30
|
-
Documentation can be found on the `ESO SkyCalc Web Page <https://www.eso.org/observing/etc/doc/skycalc/helpskycalccli.html>`_.
|
|
31
|
-
|
|
32
|
-
Keywords: sky model observatory telescope astronomy ephemeris sun moon
|
|
33
|
-
Platform: UNKNOWN
|
|
34
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
35
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
-
Classifier: Programming Language :: Python :: 2
|
|
37
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
38
|
-
Classifier: Programming Language :: Python :: 3
|
|
39
|
-
Classifier: Programming Language :: Python :: 3.4
|
|
40
|
-
Classifier: Programming Language :: Python :: 3.5
|
|
41
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
42
|
-
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
43
|
-
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 1.2
|
|
2
|
-
Name: skycalc-cli
|
|
3
|
-
Version: 1.3
|
|
4
|
-
Summary: ESO SkyCalc Command Line Interface
|
|
5
|
-
Home-page: http://www.eso.org/observing/etc/bin/gen/form?INS.MODE=swspectr+INS.NAME=SKYCALC
|
|
6
|
-
Author: European Southern Observatory
|
|
7
|
-
Author-email: usd-help@eso.org
|
|
8
|
-
License: MIT
|
|
9
|
-
Description-Content-Type: UNKNOWN
|
|
10
|
-
Description: ######################################
|
|
11
|
-
SkyCalc Command Line Interface (CLI)
|
|
12
|
-
######################################
|
|
13
|
-
|
|
14
|
-
============
|
|
15
|
-
Installation
|
|
16
|
-
============
|
|
17
|
-
|
|
18
|
-
The SkyCalc CLI works in Python 2.7 or Python3. Install the SkyCalc CLI
|
|
19
|
-
on your computer using the command: ::
|
|
20
|
-
|
|
21
|
-
pip install --user skycalc_cli
|
|
22
|
-
|
|
23
|
-
This will also install skycalc_cli's dependency, i.e. the requests package for
|
|
24
|
-
making HTTP calls.
|
|
25
|
-
|
|
26
|
-
=============
|
|
27
|
-
Documentation
|
|
28
|
-
=============
|
|
29
|
-
|
|
30
|
-
Documentation can be found on the `ESO SkyCalc Web Page <https://www.eso.org/observing/etc/doc/skycalc/helpskycalccli.html>`_.
|
|
31
|
-
|
|
32
|
-
Keywords: sky model observatory telescope astronomy ephemeris sun moon
|
|
33
|
-
Platform: UNKNOWN
|
|
34
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
35
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
-
Classifier: Programming Language :: Python :: 2
|
|
37
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
38
|
-
Classifier: Programming Language :: Python :: 3
|
|
39
|
-
Classifier: Programming Language :: Python :: 3.4
|
|
40
|
-
Classifier: Programming Language :: Python :: 3.5
|
|
41
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
42
|
-
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
43
|
-
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|