mshumko / asilib

An open source package providing data access and analysis tools for the world's all-sky imager (ASI) data.
https://aurora-asi-lib.readthedocs.io/
GNU General Public License v3.0
10 stars 4 forks source link

Issue Importing asilib.asi #5

Closed jcastigliano closed 1 year ago

jcastigliano commented 1 year ago

Steps to reproduce:

Installed using: python3 -m pip install aurora-asi-lib OS: Ventura 13.4 AND Windows 10 19045.3086 Mac: Python Version 3.9.12, Windows: 3.10.11

Error message:

When using "import asilib.asi" -> ModuleNotFoundError: No module named 'asilib.asi'

When using "import asilib" -> AttributeError: module 'asilib' has no attribute 'asi'

Additional information:

The code example I'm using from the documentation website (creation of a keogram):

import matplotlib.pyplot as plt

import asilib.asi

location_code = 'GILL' time_range = ['2015-02-02T10', '2015-02-02T11']

asi = asilib.asi.rego(location_code, time_range=time_range, alt=230) ax, p = asi.plot_keogram(color_map='Greys_r') plt.xlabel('Time') plt.ylabel('Geographic Latitude [deg]') plt.colorbar(p) plt.tight_layout() plt.show()

The code I wrote based on the above example(I know it's far from the most efficient): import matplotlib.pyplot as plt

import asilib.asi

loop = 1 while loop == 1: print("Enter 4 letter camera location code (format: XXXX):") location_code = input() location_code = location_code.upper() print('Enter the start date (format: YYYY-MM-DD):') startDate = input() print('Enter the start time in UT (format: 00):') startTime = input() startTime = 'T' + startTime print('Enter the end time in UT (format: 00):') endTime = input() endTime = 'T' + endTime endDate = startDate + endTime startDate = startDate + startTime time_range = [startDate, endDate]

asi = asilib.asi.themis(location_code, time_range, alt=110)
ax, p = asi.plot_keogram(color_map='Greys_r', aacgm=True)
plt.xlabel('Time')
plt.ylabel('Magnetic Latitude [deg]')
plt.colorbar(p)
plt.tight_layout()
plt.show()
print("Create another keogram? Y/N")
loopCheck = input()
loopCheck = loopCheck.lower()
if loopCheck[0] == 'y':
    loop = 1
else:
    loop = 0
mshumko commented 1 year ago

@jcastigliano I don't seem to have this import bug with the latest version of asilib (0.17.1). What version that you're using? Can you reply with the output of

import asilib
print(asilib.__version__)
jcastigliano commented 1 year ago

That was probably the issue. I only had 0.11.0 on Windows. I've uninstalled and done a fresh install and will update you if needed or more likely than not close the thread. Thanks!

On Mac: 0.17.0 On Windows: 0.11.0