Skip to content

Draft: Add Phase-Resolved Analysis Tutorial and Tools.#497

Draft
KoothodilAbhijithAugustine wants to merge 1 commit intocositools:developfrom
KoothodilAbhijithAugustine:phase_resolved_analysis_version_one
Draft

Draft: Add Phase-Resolved Analysis Tutorial and Tools.#497
KoothodilAbhijithAugustine wants to merge 1 commit intocositools:developfrom
KoothodilAbhijithAugustine:phase_resolved_analysis_version_one

Conversation

@KoothodilAbhijithAugustine
Copy link
Contributor

@KoothodilAbhijithAugustine KoothodilAbhijithAugustine commented Feb 27, 2026

Description

Resolves #395 and #413

This draft PR introduces a complete tutorial and a set of supporting Python tools for performing phase-resolved pulsar analysis within the cosipy framework.

Currently, the workflow demonstrates how to process Data Challenge 2 (DC2) FITS data for the Crab pulsar and its corresponding albedo background. The end goal of this pipeline is to prepare isolated on-pulse and off-pulse FITS files that are ready for downstream COSI Spectral Fitting.

Key Additions

  • Phase-Resolved Analysis Tutorial (example_notebook.ipynb): A step-by-step Jupyter Notebook guiding users through combining unbinned data, slicing by Mission Elapsed Time (MET), assigning phases, plotting the pulse profile, and selecting phase intervals.
  • phase_assigner.py: A new module that reads a pulsar ephemeris file (e.g., crab.par) and calculates/appends the exact rotational phase to individual photon events in a FITS file.
  • plot_pulse_profile.py: A plotting utility to generate and visualize the folded light curve/pulse profile from the phase-assigned data.
  • phase_selector.py: A filtering tool to extract specific phase windows (e.g., on-pulse and off-pulse regions) and save them as new FITS files.

@KoothodilAbhijithAugustine KoothodilAbhijithAugustine added the phase_analysis Modulations, pulses and phase resolved analyses label Feb 27, 2026
@KoothodilAbhijithAugustine KoothodilAbhijithAugustine added this to the v4.0 - DC4 milestone Feb 27, 2026
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 0% with 302 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.35%. Comparing base (fb0f9da) to head (d3584a3).
⚠️ Report is 1331 commits behind head on develop.

Files with missing lines Patch % Lines
cosipy/phase_resolved_analysis/phase_selector.py 0.00% 97 Missing ⚠️
cosipy/phase_resolved_analysis/time_selector.py 0.00% 92 Missing ⚠️
...sipy/phase_resolved_analysis/plot_pulse_profile.py 0.00% 65 Missing ⚠️
cosipy/phase_resolved_analysis/phase_assigner.py 0.00% 45 Missing ⚠️
cosipy/phase_resolved_analysis/__init__.py 0.00% 3 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Files with missing lines Coverage Δ
cosipy/phase_resolved_analysis/__init__.py 0.00% <0.00%> (ø)
cosipy/phase_resolved_analysis/phase_assigner.py 0.00% <0.00%> (ø)
...sipy/phase_resolved_analysis/plot_pulse_profile.py 0.00% <0.00%> (ø)
cosipy/phase_resolved_analysis/time_selector.py 0.00% <0.00%> (ø)
cosipy/phase_resolved_analysis/phase_selector.py 0.00% <0.00%> (ø)

... and 72 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase_analysis Modulations, pulses and phase resolved analyses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool to obtain a phasogram

2 participants