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

Add geodetic altitude to CSV log #190

Closed

Conversation

simfinite
Copy link
Contributor

Hi,
I would like to have the geodetic altitude added to the CSV log. Besides my personal use cases, this may be helpful for future work on issue #184. Also, it'll simply make the log more complete.

I noticed, that the altitude AGL / distance above ground is currently being logged twice. I removed one of the entries in the second commit, because I think there shouldn't be any redundant data in the output file. If this shall be kept for backwards-compatibility, just omit the 2nd commit.

@simfinite
Copy link
Contributor Author

Just realized I wasn't running all of the tests locally.. I can reproduce this now and will look into it.

@simfinite simfinite force-pushed the csv_log_geodetic_latitude branch from daeb31c to efdc1ef Compare May 11, 2019 13:31
@simfinite
Copy link
Contributor Author

Ok, here is a new attempt. The failure of test case RunCheckCases was due to the reference log file check_cases/orbit/logged_data/BallOut.csv missing the new column. In order not to change the existing reference data (there are minor numerical differences when comparing to logs of the current version), I produced a new log, but only merged the new column into the existing file. Since this was a bit tricky to accomplish, here is the code I used:

new = pandas.read_csv("BallOut.new.csv", index_col="Time", float_precision='round_trip')
old = pandas.read_csv("BallOut.old.csv", index_col="Time", float_precision='round_trip')
merged = old.copy()
merged["Altitude Geodetic (ft)"] = new["Altitude Geodetic (ft)"]
merged.to_csv("BallOut.csv", float_format="%.16g")

It's a bit hard to see in a textual diff, but what this accomplishes is that all values of the old logfile are exactly preseverd, such that...

diff = merged.loc[:]-old.loc[:]
(diff == 0).all()

... outputs True for all columns but the new one (Altitude Geodetic (ft)).

I also found some comments listing the log columns, so I updated those.

The last commit still includes all changes to remove one of the duplicate altitude/distance AGL columns. May be omitted, if it's not desired to remove that column.

@simfinite
Copy link
Contributor Author

hmm, the failures on Travis CI, I cannot reproduce reliably with my local setup. Although I have seen the segfault in TestInputSocket and also failure of CheckScripts occasionally when running tests in parallel with -j8.

@bcoconni
Copy link
Member

bcoconni commented May 13, 2019

You can get the same result when the property position/geod-alt-ft is specified in the <output> element :

<output name="result.csv" type="CSV" rate="10">
  <property> position/geod-alt-ft </property>
</output>

So there is no reason to add C++ code to get that value (and that saves the trouble about the file check_cases/orbit/logged_data/BallOut.csv).

@simfinite
Copy link
Contributor Author

Ok, thank's for the help. I didn't know that one could specify additional properties, so that's good to know. For what it's worth, I still think removing the duplicate distance/altitude AGL would be an improvement to the C++ code, but probably not worth the trouble. Closing this now, as it's not required to be merged anymore.

@simfinite simfinite closed this May 15, 2019
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

Successfully merging this pull request may close these issues.

2 participants