-
Notifications
You must be signed in to change notification settings - Fork 20
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
Memory leak, downloading cells and SMEX GRB #145
Conversation
…dd the cell to download and process the files needed by the TS map notebook.
Hi @Yong2Sheng, I started reviewing your PR, and so far things look good. A few comments below.
What is the point of this? It is better to just name things what they are.
I don't know if I would really consider this a "memory leak". You're just removing un-needed files from RAM. You can probably remove "to prevent memory leak" from your comment. Also, I think you can just run gc.collect() without assigning it to a dummy variable.
|
…the response and source injector related files together respectively; update the index.rst file under the tutorial folder.
Hi @ckarwin, Thank you for your comments and suggestions! Comment 1
I updated this file on Wasabi and the cell. The comment explaining the "1s" in the file name has been removed from the downloading cell. Comment 2
This phrase has been removed from the notebook
If I don't assign a dummy variable, the Other changes
|
Thanks, @Yong2Sheng! This looks really good. A couple more requests:
|
Hi @ckarwin, Comment 1
It's deleted now. Comment 2
Sorry, I now realized that they are intermediate files generated by Thank you very much! |
I actually found that one of the files is used in Point_source_response.ipynb, although the cell is commented out:
Do you still want this cell? If so, you might still need the file. Or is this something that needs to be fixed later? |
…. the errors when loading dewll time map has been fixed, removed the comment used to warn the errors.
Hi @ckarwin, I tested the cell, there is no error when loading the dwell time map now, so the error has been fixed. But I still want to keep this cell since it tells the users that they can load the dwell time map instead calculating it. Here are the main changes:
Thank you very much! |
Hi @Yong2Sheng, Ok, thanks for updating that. I have another question now. What is the difference between DetectorResponse.ipynb and Point_source_response.ipynb? It seems that the point source response is already handled in the former notebook, and so why do we need the latter notebook? Does that latter notebook provide any additional information that is not already covered in the first notebook, or is it just another example? I think it's fine if it's just another example, but it would be good to comment on this at the beginning of Point_source_response.ipynb, i.e. make it clear how this notebook relates to the other one. Sorry for all the questions, but I think it's good to handle these issues now, while we are already working on related things. Otherwise, it will probably be a while before we revisit these small details. |
Hi @ckarwin, This is a good question. @israelmcmc initially made DetectorResponse.ipynb, which includes the part that deals with the point source response. I think the differences are:
So I would conclude that
Maybe we should keep both of them and provide information for the users to distinguish them? What do you think? @ckarwin @israelmcmc Thank you very much! |
Good point. I think we should reorganize these 2 tutorials. When I wrote the DetectorResponse.ipynb we didn't yet have the SpacecrateFile, but I still wanted to show how it would be convolved in order to obtain the expected excess. This is what I have in mind (from the tutorial docs page), which I think it's a logical way to present it for someone starting now: https://cositools.github.io/cosipy/tutorials/index.html
What do you think? I can update DetectorResponse.ipynb in order to obtain the response with a Spacecraft File. @Yong2Sheng can you update Point_source_resonse.ipynb (which I think needs to change its name to SpacecraftFile.ipynb) so it explains the points above? |
Hi @israelmcmc, Thank you for the suggestions! For the
Is it correct? |
Sorry for the confusion, @Yong2Sheng. I meant to modify Point_source_resonse.ipynb so it describes:
I think the first 2 bullet points are already there, it would mean adding the scatt map and removing the PSR calculation. I'll PM on slack to coordinate about this. |
@israelmcmc Sounds good! |
To summarize our chat:
|
Sounds good. Thanks for taking care of this, @Yong2Sheng @israelmcmc! One last request for this PR @Yong2Sheng, can you remove this folder: https://github.com/Yong2Sheng/cosipy_SpacecraftFile/tree/fast_ts_map_galactic/docs/tutorials/data? I checked with @eneights and it's not being used. |
Hi @ckarwin, I deleted the folder Although it says that there is a change in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again, @Yong2Sheng ! Great job.
I updated the
fast_ts_fit.py
and the notebook for DC2 based the comments I received from the internal release.Update 1
Following the suggestion by @israelmcmc, the GRB in the notebook has been replaced by the SMEX one simulated by @eneights.
Update 2
The memory usage is improved.
If you use less cores, the memory usage will be less at the cost of longer computational time.
Update 3
I added the downloading cells in the notebook so that the files needed will be downloaded to the same directory of the notebook. The size of the files are also mentioned in the cells.
The zipped response will be unzipped and deleted by the cells.
Note
You will see some commented lines in
fast_ts_fit.py
that are used for speed benchmark. They might be used in the future so I want to keep them for now.