robintw / Py6S

A Python interface to the 6S Radiative Transfer Model
GNU Lesser General Public License v3.0
191 stars 105 forks source link

Aeronet's import_aeronet_data returning indexing error #61

Closed soypat closed 4 years ago

soypat commented 4 years ago

Using a .dubovik file acquired using the step-by-step method returns error.

/usr/local/lib/python3.6/dist-packages/Py6S/SixSHelpers/aeronet.py in _get_aot(cls, df)
    206 
    207         # Remove the columns for AOT wavelengths with no data
--> 208         aot_df = df.ix[:, inds]
    209         aot_df = aot_df.dropna(axis=1, how='all')
    210         aot_df = aot_df.dropna(axis=0, how='any')

/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py in __getattr__(self, name)
   5272             if self._info_axis._can_hold_identifiers_and_holds_name(name):
   5273                 return self[name]
-> 5274             return object.__getattribute__(self, name)
   5275 
   5276     def __setattr__(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute 'ix'

A attribute/key check of the dataframe could be useful to spot errors early on and not raise them within the code.

robintw commented 4 years ago

Thanks - this is the same as #59, and I've just fixed it - will push commits and do a new release shortly.

robintw commented 4 years ago

Fixed in 7a6da6e.