-
Notifications
You must be signed in to change notification settings - Fork 24
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
Adopt Astropy file formats for ASCII outputs #122
Comments
I don't fully understand - it looked like the first line did have a comment in the example! Is this just for the .spec files, in which case what is the proposed new format. If this is a really important feature to implement, then naturally I have no objections - but if the .spec file format is significantly changed, it will mean I'll need to make changes to scripts I currently use, so IMHO it should only be made if there is a demonstrable benefit to be had.... |
Nick, The generalized reason for doing this is that the community is adopting this kind of format for reading and writing ascii files. They have developed routines in astropy which allow you to read such files, without counting columns. Had we and you been using this type of file format and the astropy routines, the change I made in the file formats of one of the files a few months ago would NOT have affected your routines. Furthermore, using the astropy routines would also give us more flexible ways to create files in the future, e.g including the density and T in a single file, and or choosing to write files as fits tables instead of ascii files. The astropy routines determine the format of the file and read it without your having to specify what format is. On the other hand, if you don’t like astropy then the only thing you would need to do is to ignore the row that contains the column names, and keep counting. Knox |
Oh, I understand - so the line that James was referring to was the line with the names of the columns in - which is a comment at the moment, but would not be a comment in future. It looked like the suggestion was to remove all of the comment lines, which would be a problem since I have some quite elaborate scripts that use the parameters of the simulation, normally stored in comments in the preamble of a .spec file, to do lots of things. If they will all still be there than thats totally cool! Nick |
Correct. It is just one line, actually just one character, that would change. |
Yes, sorry, I wasn't overly clear there. This is implemented by pull request #123 Nick, this should make everything easier anyway. I've tried to describe the procedures on this wiki page - Feel free to test my python functions on any model run with the latest dev version and let me know if anything messes up (@kslong , @smangham , @Higginbottom ) Once I've finished testing the 'advanced mode' stuff I will also make other diagnostic outputs follow the same convention. This should mean that dealing with python outputs is in general a lot easier. |
@kslong has suggested, and I think I agree, that adopting file formats consistent with Astropy would be sensible. The astropy.io.ascii module allows one to read in files of the following format
i.e. the first line has no comments.
With commands like
@Higginbottom , any objection? We could have try/except commands in our scripts to catch users who didn't have astropy installed.
The text was updated successfully, but these errors were encountered: