Git Product home page Git Product logo

atmos's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

atmos's Issues

Autodownloading iers files

Two files are downloaded upon importing pyatmos, "Leap_Second.dat" and "finals2000A.all" into your root folder. I'd like to be able to specify where they're downloaded instead of automatically downloading.

pip installation broken

I am unable to install the package with pip;

Collecting pyatmos
  Using cached pyatmos-1.2.3-py3-none-any.whl (47 kB)
Requirement already satisfied: astropy in ./miniconda3/lib/python3.9/site-packages (from pyatmos) (5.2)
Collecting pyshtools
  Using cached pyshtools-4.10.1.tar.gz (38.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
  
  ...
  
  numpy.distutils.system_info.FFTWNotFoundError:
          FFTW (http://www.fftw.org/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [fftw]) or by setting
          the FFTW environment variable.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Concatenation Error in NRLMSISE-00 Example

I've installed and attempting to run the NRLMSISE-00 Exalpe to test my installation. I'm running the Annaconda Distribution of Python 3.8 on a Mac Pro Desktop (2019) under Mac OSX Monterey (ver. 12.0.1).

The source code I'm running is:

from` pyatmos import download_sw_nrlmsise00,read_sw_nrlmsise00
# Download or update the space weather file from www.celestrak.com
swfile = download_sw_nrlmsise00() 
# Read the space weather data
swdata = read_sw_nrlmsise00(swfile) 

from pyatmos import nrlmsise00
# Set a specific time and location
t = '2014-07-22 22:18:45' # time(UTC) 
lat,lon,alt = 25,102,600 # latitude, longitude in [degree], and altitude in [km]
nrl00 = nrlmsise00(t,(lat,lon,alt),swdata)
print(nrl00.rho) # [kg/m^3]
print(nrl00.T) # [K]
print(nrl00.nd) # composition in [1/m^3]

The output I get is:

The space weather data in /Users/user/src/sw-data/ is already the latest.
Traceback (most recent call last):

  File "/Users/user/Various_Python_Examples/NRLMSISE-00_Example/NRLMSIME-00_ex.py", line 17, in <module>
    swdata = read_sw_nrlmsise00(swfile)

  File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/pyatmos/msise/spaceweather.py", line 94, in read_sw_nrlmsise00
    SW_OBS_PRE = np.vstack((np.array(SW_OBS),np.array(SW_PRE)))

  File "<__array_function__ internals>", line 5, in vstack

  File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/numpy/core/shape_base.py", line 282, in vstack
    return _nx.concatenate(arrs, 0)

  File "<__array_function__ internals>", line 5, in concatenate

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 29 and the array at index 1 has size 32


In [17]: runfile('/Users/user/Various_Python_Examples/NRLMSISE-00_Example/NRLMSIME-00_ex.py', wdir='/Users/user/Various_Python_Examples/NRLMSISE-00_Example')
The space weather data in /Users/user/src/sw-data/ is already the latest.
Traceback (most recent call last):

  File "/Users/user/Various_Python_Examples/NRLMSISE-00_Example/NRLMSIME-00_ex.py", line 17, in <module>
    swdata = read_sw_nrlmsise00(swfile)

  File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/pyatmos/msise/spaceweather.py", line 94, in read_sw_nrlmsise00
    SW_OBS_PRE = np.vstack((np.array(SW_OBS),np.array(SW_PRE)))

  File "<__array_function__ internals>", line 5, in vstack

  File "/Users/user/opt/anaconda3/lib/python3.8/site-packages/numpy/core/shape_base.py", line 282, in vstack
    return _nx.concatenate(arrs, 0)

  File "<__array_function__ internals>", line 5, in concatenate

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 29 and the array at index 1 has size 32

Please advise.

Sam Dupree.

Missing package numba

Just installed pyatmos (v1.2.3) for the first time with pip on Python 3.9.2. Seems as though the automatic installer was missing the package numba. After I installed that with pip it seemed to work fine. Might be something to fix in the next release :)

Errors retreiving spaceweather files using JB2008

I'm running PyAtmos ver. 1.2.4 under Python ver. 3.9.x under the Anaconda distribution on a Mac Pro (2019) that runs Mac OSX ver. 13.2.1 (Ventura). In running the following example:

from pyatmos import download_sw_jb2008,read_sw_jb2008
# Download or update the space weather file from https://sol.spacenvironment.net
swfile = download_sw_jb2008() 
# Read the space weather data
swdata = read_sw_jb2008(swfile) 

from pyatmos import jb2008
# Set a specific time and location
t = '2014-07-22 22:18:45' # time(UTC) 
lat,lon,alt = 25,102,600 # latitude, longitude in [degree], and altitude in [km]
jb08 = jb2008(t,(lat,lon,alt),data)
print(jb08.rho) # [kg/m^3]
print(jb08.T) # [K]

I get the following error messages.

================================================================================
Feb 18, 2023 at 04:53:42
~/Various_Python_Examples/JB2008_Example/JB2008_ex.py
--------------------------------------------------------------------------------
Downloading the Space Weather file 'SOLFSMY.TXT' from Space Environment Technologies(SET)
/Users/user/opt/anaconda3/lib/python3.9/site-packages/paramiko/transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,
Traceback (most recent call last):
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 1346, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Users/user/opt/anaconda3/lib/python3.9/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Users/user/opt/anaconda3/lib/python3.9/http/client.py", line 1331, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Users/user/opt/anaconda3/lib/python3.9/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Users/user/opt/anaconda3/lib/python3.9/http/client.py", line 1040, in _send_output
    self.send(msg)
  File "/Users/user/opt/anaconda3/lib/python3.9/http/client.py", line 980, in send
    self.connect()
  File "/Users/user/opt/anaconda3/lib/python3.9/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Users/user/opt/anaconda3/lib/python3.9/ssl.py", line 501, in wrap_socket
    return self.sslsocket_class._create(
  File "/Users/user/opt/anaconda3/lib/python3.9/ssl.py", line 1041, in _create
    self.do_handshake()
  File "/Users/user/opt/anaconda3/lib/python3.9/ssl.py", line 1310, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/Various_Python_Examples/JB2008_Example/JB2008_ex.py", line 5, in <module>
    swfile = download_sw_jb2008() 
  File "/Users/user/opt/anaconda3/lib/python3.9/site-packages/pyatmos/jb2008/spaceweather.py", line 42, in download_sw_jb2008
    wget_download(url1,swfile1,desc1)
  File "/Users/user/opt/anaconda3/lib/python3.9/site-packages/pyatmos/utils/try_download.py", line 17, in wget_download
    wget_out = wget.download(url,dir_file)
  File "/Users/user/opt/anaconda3/lib/python3.9/site-packages/wget.py", line 526, in download
    (tmpfile, headers) = ulib.urlretrieve(binurl, tmpfile, callback)
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 239, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 1389, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/Users/user/opt/anaconda3/lib/python3.9/urllib/request.py", line 1349, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>

The problem appears to be associated with wget_download thru download_sw_jb2008() .

Any suggestions?

Sam Dupree.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.