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

Modified Example Notebooks with new ori file #264

Merged
merged 14 commits into from
Nov 14, 2024

Conversation

ckarwin
Copy link
Contributor

@ckarwin ckarwin commented Nov 12, 2024

I updated the spectral fit example notebooks (crab, GRB, and extended) with the new ori file, in order to be compatible with the recent changes to the SpacecraftFile class. The new ori file is the DC2 ori file which also includes the orbital information. It can be found here: https://s3.us-west-1.wasabisys.com/cosi-pipeline-public/COSI-SMEX/DC2/Data/Orientation/20280301_3_month_with_orbital_info.ori.

I also needed to update COSILike, since the scattmap now requires passing the source location. Lastly, I added an option in the scattmap calculation (and COSILike) to include the Earth occultation, with the default set to true.

This PR resolves issues #260 #262 and partially #263 (the other notebooks will also need to be updated, which I leave to the respective owners).

@ckarwin ckarwin requested a review from hiyoneda November 12, 2024 17:36
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.86%. Comparing base (f71e55d) to head (5b693b5).
Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
cosipy/threeml/COSILike.py 75.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
cosipy/spacecraftfile/SpacecraftFile.py 90.94% <100.00%> (+2.72%) ⬆️
cosipy/threeml/COSILike.py 70.44% <75.00%> (+1.45%) ⬆️

@ckarwin
Copy link
Contributor Author

ckarwin commented Nov 12, 2024

@hirokiyoneda This is ready for review when you have time.

@ckarwin
Copy link
Contributor Author

ckarwin commented Nov 12, 2024

@hirokiyoneda Ok, I needed to update the unit test coverage for additional lines I added, but all tests are now passing.

@eneights I recently merged your PR #256, but then soon realized it wasn't in the right place. It was in a directory called "spectral_fits", but it's better to be in the threeml directory, since that is the class it is testing. I moved it to the right place as part of this PR, and so there is nothing for you to do, but please be aware.

@hiyoneda
Copy link
Contributor

I am running the notebooks, and found a quick mistake. The 3rd cell in `SpectralFit_Crab.ipynb' is:

fetch_wasabi_file('COSI-SMEX/DC2/Data/Orientation/20280301_3_month_with_orbital_info.ori', output=str(data_path / '20280301_3_month_modified.ori'))

Should it be data_path / '20280301_3_month_with_orbital_info.ori'?

@ckarwin
Copy link
Contributor Author

ckarwin commented Nov 13, 2024

@hiyoneda Yes, sorry, it's fixed now.

@hiyoneda
Copy link
Contributor

Thanks! I am leaving my office, and the new orientation file is still being downloaded. I'll check it tomorrow morning here.

@ckarwin
Copy link
Contributor Author

ckarwin commented Nov 13, 2024

Ok, thank you!

@hiyoneda
Copy link
Contributor

I confirmed that the new orientation file worked well without any errors, but I encountered the following error on the GRB notebook. I think that the binned event file is in the old format and does not have coordsys in PsiChi axis. Do you think that it is easy to fix it? (If not, I can merge this PR and make a new issue).

Screenshot 2024-11-14 at 12 43 26

@ckarwin
Copy link
Contributor Author

ckarwin commented Nov 14, 2024

@hiyoneda Thanks for double checking. I ran through all three notebooks before making a PR to make sure everything was working, including the GRB notebook, and I didn't have this same issue. As part of this I downloaded all the files from scratch using the fetch_wasabi commands in the notebook. I just ran the GRB notebook again and it works fine for me. Can you double check that you are using the correct files and that they were downloaded ok?

Copy link
Contributor

@hiyoneda hiyoneda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used old files I previously downloaded, sorry. After downloading the new ones, everything worked well. Now we can merge this!

@hiyoneda hiyoneda merged commit 5ea0243 into cositools:develop Nov 14, 2024
4 checks passed
@ckarwin
Copy link
Contributor Author

ckarwin commented Nov 14, 2024

Ok, no problem. Thanks again.

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