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

pickle object to text file #10

Open
bosby74 opened this issue Jan 2, 2021 · 2 comments
Open

pickle object to text file #10

bosby74 opened this issue Jan 2, 2021 · 2 comments

Comments

@bosby74
Copy link

bosby74 commented Jan 2, 2021

Hi,
I'm trying the use of your SplitPy software and I'm finding some very interesting characteristics as the use of open platform (python) or the the automatization of the process that take into account the downloading of the data. I tested your example of TGTN station without error so everything seem to be installed properly.
Anyway, since I'm not a very proficient user of python, I'm finding some difficulties to "read humanly" the results saved because the pickle object resulted at the end of the analysis is not easily manageable (at least for me). Are there any scripts to convert the pickle object of the results into a csv ot txt file? If not, do you plan to write down some in the next future? Or to provide example in your website?
Thanks in advance,
Simone

@paudetseis
Copy link
Owner

Hi and thanks for your feedback. It's nice to hear that you find this code useful. Our original intent was to save disk space and essentially save a single file per object - admittedly this part is a bit clunky and could be improved. It is certainly possible to add flexibility to save the individual results into a .csv file and we will look into this in a future release. I will note that it is possible to get the estimates in a .csv table once you run the script split_average.py.

In the mean time, you can read the individual pickle files by navigating to the folder of interest (e.g., in the DATA/NY.TGTN/ folder), open a python window and type:

>>> import pickle
>>> file = open('Split_results_manual.pkl', 'rb')
>>> split_SC = pickle.load(file)
>>> split_RC = pickle.load(file)
>>> split_null = pickle.load(file)
>>> split_quality = pickle.load(file)

and then you check the content of each split variable and extract the value that you want, e.g.:

>>> split_SC.__dict__  # This shows the object split_SC as a dictionary with keys and values
>>> dt_SC = split_SC.dtt
>>> dt_SC_err = split_SC.edtt
>>> phi_SC = split_SC.phi
>>> phi_SC_err = split_SC.ephi
...

...and so on. You can also get the value of the Null (True or False) as well as the quality of the estimate:

>>> print(split_null)
>>> print(split_quality)

@bosby74
Copy link
Author

bosby74 commented Jan 6, 2021

Thank you,
these commands will help me on read the pickles file and to write out the result on a text file.
Ciao,
Simone

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

2 participants