-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from fjebaker/fergus/ogip-flexibility
More flexibility with OGIP datasets
- Loading branch information
Showing
8 changed files
with
147 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "SpectralFitting" | ||
uuid = "f2c56810-742e-4b72-8bf4-27af3bb81a12" | ||
authors = ["Fergus Baker <[email protected]>"] | ||
version = "0.5.4" | ||
version = "0.5.5" | ||
|
||
[deps] | ||
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
struct NuStarData{T,H} <: AbstractDataset | ||
data::SpectralData{T} | ||
paths::SpectralDataPaths | ||
observation_id::String | ||
exposure_id::String | ||
object::String | ||
header::H | ||
end | ||
|
||
NuStarData(spec_path; rmf_matrix_index = 3, rmf_energy_index = 2, kwargs...) = NuStarData( | ||
load_ogip_dataset( | ||
spec_path; | ||
rmf_matrix_index = rmf_matrix_index, | ||
rmf_energy_index = rmf_energy_index, | ||
kwargs..., | ||
)..., | ||
) | ||
|
||
make_label(data::NuStarData) = data.observation_id | ||
|
||
@_forward_SpectralData_api NuStarData.data | ||
|
||
function Base.show(io::IO, @nospecialize(data::NuStarData{T})) where {T} | ||
print(io, "NuStarData[obs_id=$(data.observation_id)]") | ||
end | ||
|
||
function _printinfo(io, data::NuStarData{T}) where {T} | ||
descr = """NuStarData: | ||
. Object : $(data.object) | ||
. Observation ID : $(data.observation_id) | ||
. Exposure ID : $(data.exposure_id) | ||
""" | ||
print(io, descr) | ||
_printinfo(io, data.data) | ||
end | ||
|
||
|
||
abstract type AbstractXmmNewtonDevice end | ||
struct XmmEPIC <: AbstractXmmNewtonDevice end | ||
|
||
struct XmmData{T,H,D} <: AbstractDataset | ||
device::D | ||
data::SpectralData{T} | ||
paths::SpectralDataPaths | ||
observation_id::String | ||
exposure_id::String | ||
object::String | ||
header::H | ||
end | ||
|
||
XmmData( | ||
device::AbstractXmmNewtonDevice, | ||
spec_path; | ||
rmf_matrix_index = 2, | ||
rmf_energy_index = 3, | ||
kwargs..., | ||
) = XmmData( | ||
device, | ||
load_ogip_dataset( | ||
spec_path; | ||
rmf_matrix_index = rmf_matrix_index, | ||
rmf_energy_index = rmf_energy_index, | ||
kwargs..., | ||
)..., | ||
) | ||
|
||
make_label(data::XmmData) = data.observation_id | ||
|
||
@_forward_SpectralData_api XmmData.data | ||
|
||
function Base.show(io::IO, @nospecialize(data::XmmData{T})) where {T} | ||
print(io, "XmmData[dev=$(data.device),obs_id=$(data.observation_id)]") | ||
end | ||
|
||
function _printinfo(io, data::XmmData{T}) where {T} | ||
descr = """XmmData for $(Base.typename(typeof(data.device)).name): | ||
. Object : $(data.object) | ||
. Observation ID : $(data.observation_id) | ||
. Exposure ID : $(data.exposure_id) | ||
""" | ||
print(io, descr) | ||
_printinfo(io, data.data) | ||
end | ||
|
||
|
||
export NuStarData, XmmData, XmmEPIC |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.