MAVENSDC / Pydivide

A plotting tool for MAVEN in-situ key parameter data
3 stars 3 forks source link

Index Error #23

Open rgoalcast opened 4 years ago

rgoalcast commented 4 years ago

I am new to Pydivide, How can I correct IndexError? (10 August 2020)

insitu, iuvs = pydivide.read('2015-12-25') Traceback (most recent call last):

File "", line 1, in insitu, iuvs = pydivide.read('2015-12-25')

File "/Users/username/opt/anaconda3/lib/python3.8/site-packages/pydivide/read.py", line 77, in read date = re.findall(r'_(\d{8})', file)[0]

IndexError: list index out of range

and Today (17 August 2020),I am getting following error

import pydivide Traceback (most recent call last):

File "/Users/username/opt/anaconda3/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3343, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 1, in import pydivide

File "/Users/username/opt/MAVENSDC-Pydivide-626c30f/pydivide/init.py", line 2, in from .altplot import altplot

File "/Users/username/opt/MAVENSDC-Pydivide-626c30f/pydivide/altplot.py", line 6, in from .utilities import get_inst_obs_labels, param_list, orbit_time, range_select

File "/Users/username/opt/MAVENSDC-Pydivide-626c30f/pydivide/utilities.py", line 8, in from . import download_files_utilities as utils

File "/Users/username/opt/MAVENSDC-Pydivide-626c30f/pydivide/download_files_utilities.py", line 134 spedas_data_dir = os.getenv('SPEDAS_DATA_DIR') ^ IndentationError: unexpected indent

I am importing pydivide, error is coming, How can I correct error ? Thank you.

bryan-harter commented 4 years ago

The correct way to read in a specific date would be to type:

insitu, iuvs = pydivide.read(input_time = '2015-12-25')

I believe some of the documentation is outdated, sorry if the docs refer to the other way you tried to call the function.

Also, try updating your version of pydivide to solve the other error. It looks like you added in an incorrect indent in your code when you tried to fix the spedas_data_dir issues.

rgoalcast commented 4 years ago

I am trying this pydivide.download_files(start_date='2015-12-25', end_date='2015-12-31', insitu=True, list_files=True, new_files=True) got this in output mvn_kp_insitu_20151231_v15_r05.tab mvn_kp_insitu_20151230_v15_r05.tab mvn_kp_insitu_20151229_v15_r05.tab mvn_kp_insitu_20151228_v15_r05.tab mvn_kp_insitu_20151227_v15_r05.tab mvn_kp_insitu_20151226_v15_r05.tab mvn_kp_insitu_20151225_v15_r05.tab

But, during read insitu, iuvs = pydivide.read(input_time = '2015-12-25') No files found for the input date range, and no specific filenames were given. Exiting. Traceback (most recent call last):

File "", line 1, in insitu, iuvs = pydivide.read(input_time = '2015-12-25')

TypeError: cannot unpack non-iterable NoneType object

How can I correct error?