Skip to content

Conversation

@kashish2210
Copy link
Member

@kashish2210 kashish2210 commented Mar 30, 2025

recipes for Lightcurve

Note: I have included the lightcurve function here just to implement perfectly with recipes After reviewing #28, we can change this function and this PR majorly addresses after #34, complete review of #38 and after complete review of #39 this will have addition of Rebin and Bartlett's method and after #32 there will be new recipes for peridogram and bad_time_interval vs counts that are going to be implemented in this branch :)
additional note : this is the subbranch of #39

It majorly includes the following recipes:

using Plots
event_list = readevents("basic_test.fits")
plot(event_list, 0.1)
#implmentaion getting via using threshold
plot(event_list, 0.1, show_gaps=true, gap_threshold=5.0)
plot(event_list, axis_limits=[0, 10, 0, 2])
plot(event_list, 0.1, show_gaps=true, gap_threshold=5.0,axis_limits=[2, 15, 0, 10] )
using Plots
event_list = readevents("sample_event_data_lc5.fits")
# Plot the event list as a light curve with a bin size of 0.1
plot(event_list, 0.1; tstart=nothing, tseg=nothing, show_errors=true, show_gaps=false, gap_threshold=10.0, axis_limits=nothing)
using Plots

# Create a LightCurve object (example)
time_bins = collect(0:0.1:100)  # Convert to Vector{T}
counts = rand(0:100, 1001)  # Generate random integer counts
count_errors = sqrt.(counts)
light_curve = LightCurve(time_bins, counts, count_errors, :poisson)
plot(light_curve; show_errors=true, show_gaps=false, gap_threshold=10.0, axis_limits=nothing)
plot(LightCurve, event_list, 0.1; tstart=nothing, tseg=nothing, show_gaps=false, gap_threshold=10.0, axis_limits=nothing)
using Plots
time_bins = collect(0:0.1:100)  # Convert to Vector{T}
counts = rand(0:100, 1001)  # Generate random integer counts
count_errors = sqrt.(counts)
light_curve = LightCurve(time_bins, counts, count_errors, :poisson)
# Plot the combined light curve with events
plot(Val{:lightcurve_with_events}, light_curve, event_list; bin_size=0.1, tstart=nothing, tseg=nothing, axis_limits=nothing, color_by_energy=true)

assets

suggestion

I was hoping you could suggest me a way for hard intensity diagram plotting like

struct HardIntensityDiagram{T}
    hardness::Vector{T}
    intensity::Vector{T}
    hardness_error::Vector{T}
    intensity_error::Vector{T}
end

feedbacks

Looking for suggestion to add more recipes
@matteobachetti @fjebaker @stefanocovino

@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2025

Codecov Report

Attention: Patch coverage is 64.34109% with 92 lines in your changes missing coverage. Please review.

Project coverage is 83.08%. Comparing base (cddac34) to head (9c39565).
Report is 52 commits behind head on main.

Files with missing lines Patch % Lines
src/recipes.jl 0.00% 82 Missing ⚠️
src/lightcurve.jl 94.31% 10 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (cddac34) and HEAD (9c39565). Click for more details.

HEAD has 5 uploads less than BASE
Flag BASE (cddac34) HEAD (9c39565)
6 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #41       +/-   ##
===========================================
- Coverage   95.24%   83.08%   -12.17%     
===========================================
  Files           3        6        +3     
  Lines         505      875      +370     
===========================================
+ Hits          481      727      +246     
- Misses         24      148      +124     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@kashish2210 kashish2210 marked this pull request as draft June 15, 2025 18:44
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