Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alt_analysis issue #21

Open
Randa-Almadhoun opened this issue Feb 26, 2017 · 0 comments
Open

alt_analysis issue #21

Randa-Almadhoun opened this issue Feb 26, 2017 · 0 comments

Comments

@Randa-Almadhoun
Copy link

I tried reading data from csv file and use function alt_analysis, but I get an error in the analysis code related to the index of the data. the error message is as follows:

/home/kuri/anaconda3/lib/python3.6/site-packages/px4tools/analysis.py in alt_analysis(data, min_alt, max_alt)
    107         pass
    108     (-1*data.LPSP_Z).plot(legend=True)
--> 109     (data.SENS_BaroAlt - data.SENS_BaroAlt[i0_Baro].values[0]).plot(legend=True)
    110     (data.GPS_Alt - data.GPS_Alt[i0_GPS].values[0]).plot(legend=True)
    111     (-1*data).LPOS_Z.plot(legend=True)
AttributeError: 'numpy.float64' object has no attribute 'values'

I modified alt_analysis function in analysis.py by removing the [i0_GPS] & [i0_Baro] since each of the GPS_Alt, and SENS_BaroAlt is field by itself in the csv file and it is np array that could be accessed using values. Also, printing i0_Baro = data.SENS_BaroAlt.first_valid_index() doesn't return the correct first valid index so I had to find the first correct index. I also modified mapping in the same way since it also complained about the index index 0 is out of bounds for axis 0 with size 0...

The changes that were done could be found in the following links:
analysis.py
mapping.py

After these modifications, the plots were generated,
but I would like to verify these modifications or know if this issue appears to others or did it happen because of the log that was used ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant