Repository navigation
Conversation
| """Hook called after reading data from FITS. Mixins override and chain via super().""" | ||
| s = super() | ||
| if hasattr(s, "on_deserialize"): | ||
| s.on_deserialize(data) |
There was a problem hiding this comment.
Hum this is a bit of code smell - it's breaking the inheritance pattern - I'd suggestion implement on the base case and either pass or raise not implemented error
There was a problem hiding this comment.
i implemented a hopefully more pythonic flow
Fits de/serialize hook for converting into fits serializeable icrs frame
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #458 +/- ##
==========================================
- Coverage 72.23% 68.27% -3.97%
==========================================
Files 78 80 +2
Lines 8085 9685 +1600
==========================================
+ Hits 5840 6612 +772
- Misses 2245 3073 +828 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
samaloney
left a comment
There was a problem hiding this comment.
I still need to check the code out and run it as hard to fully understand from just reading but looks good, left a few minor comments.
| return table_hdu | ||
|
|
||
|
|
||
| def CreateUtcColumn(table, data, colname, description="UTC Time"): |
There was a problem hiding this comment.
snake case
| def CreateUtcColumn(table, data, colname, description="UTC Time"): | |
| def create_utc_column(table, data, colname, description="UTC Time"): |
or maybe create_UTC_column not sure what the PEP says for this?
| CreateUtcColumn( | ||
| data, | ||
| [Time(d, format="isot", scale="utc") for d in mt["start_UTC"]], | ||
| "start_UTC", | ||
| description="start time of flare", | ||
| ) |
There was a problem hiding this comment.
data.add_column(Column([Time(d, format="isot", scale="utc") for d in mt["start_UTC"]], name="start_UTC",description="start time of flare")
not sure if the function is need id honest really do much?
| return kwargs["level"] == "L3" and service_type == 0 and service_subtype == 0 and ssid == 8 | ||
|
|
||
|
|
||
| def longest_constant_sequence(state_array): |
There was a problem hiding this comment.
test for this would be good
| return max_length, max_start_idx, max_state | ||
|
|
||
|
|
||
| def calculate_overlap(range1, range2): |
There was a problem hiding this comment.
test for this would be good
| solo_sun_hg, sun_solo_lt = spiceypy.spkezr("SOLO", et, "SUN_EARTH_CEQU", "None", "Sun") | ||
| sun_earth_hee, sun_earth_lt = spiceypy.spkezr("Earth", et, "SOLO_HEE", "None", "Sun") | ||
|
|
||
| return (sun_earth_lt - sun_solo_lt) * u.s |
There was a problem hiding this comment.
This is in the fits headers not - also is this from sun center or surface?
| CreateUtcColumn( | ||
| data, | ||
| [Time(d, format="isot", scale="utc") for d in mt["start_UTC"]], | ||
| "start_UTC", | ||
| description="start time of flare", | ||
| ) |
There was a problem hiding this comment.
Time(mt["start_UTC"]) does this work?
| # TODO redo | ||
| # if f_data_end > (Spice.instance.get_mk_date(meta_kernel_type="flown") - timedelta(hours=24)): | ||
| # return TestForProcessingResult.NotSuitable |
| np.nan * u.km, | ||
| np.nan * u.km, | ||
| np.nan * u.km, | ||
| peak_time, | ||
| np.nan * u.km, | ||
| np.nan * u.km, | ||
| np.nan * u.km, |
There was a problem hiding this comment.
Why is this a combination of km and time and are these in a a coordinate frame?
Also why is it 3 distances a time and 3 distances?
| u.Quantity(solo_y), | ||
| u.Quantity(solo_z), | ||
| frame=HeliographicStonyhurst(obstime=solo_times), | ||
| representation_type="cartesian", |
There was a problem hiding this comment.
did you serialise them as specifically cartesian
There was a problem hiding this comment.
Also what about the observer coordinate?
| super().on_deserialize(data, **kwargs) | ||
|
|
||
| @classmethod | ||
| def is_visible(cls, coord): |
There was a problem hiding this comment.
Need to careful about definitions here some of the problems should live on the examine in STIXpy as it depends - some sources can come from the corona
rework documentation structure
samaloney
left a comment
There was a problem hiding this comment.
So the use case for some of the columns isn't clear to me, not to say there isn't a very good use case just I don't know about it.
On the imaging I think the integrated counts used to make the image could be useful to add.
The min and max exposure are of the selected CPD file used for imaging think just need to state there could be ohter files with different values.
Could we link all CPD file the overlap with the flare in a "related" files column?
|
|
||
| **review comment:** _(to be filled in via `notebooks/flarelist_sdcloc_review_comments.yaml`)_ | ||
|
|
||
| #### GOES_class |
There was a problem hiding this comment.
For consistency Id say either 'GOES' or 'goes' everywhere
|
|
||
| **review comment:** _(to be filled in via `notebooks/flarelist_sdcloc_review_comments.yaml`)_ | ||
|
|
||
| #### goes_min_class_est |
There was a problem hiding this comment.
I guess we need some documentation with the flare list so can describe where this stuff comes from e.g. the data centre not Muriel's work
|
|
||
| **review comment:** _(to be filled in via `notebooks/flarelist_sdcloc_review_comments.yaml`)_ | ||
|
|
||
| #### goes_max_class_est |
There was a problem hiding this comment.
So the classes are derived from the flux do we need both?
|
|
||
| - **comment:** livetime- and area-corrected flux at the peak lightcurve bin (ct/s/keV/cm2, 5 energy channels) | ||
| - **unit:** ct / (keV s cm2) | ||
| - **example:** `[1.7785, 0.1944, 0.0736, 0.2886, 0.1244] ct / (keV s cm2)` |
There was a problem hiding this comment.
so this takes care of the det/pixel config so can directly compare counts event to event if the enable dets/pixels had changed?
|
|
||
| **review comment:** _(to be filled in via `notebooks/flarelist_sdcloc_review_comments.yaml`)_ | ||
|
|
||
| #### lc_bkg_peak |
There was a problem hiding this comment.
which pixel in the bkg det are in this?
|
|
||
| - **comment:** minimum CPD per-bin exposure ds (timedel) over the flare start..end window | ||
| - **unit:** ds | ||
| - **example:** `599 ds` |
There was a problem hiding this comment.
should also be in seconds
|
|
||
| **review comment:** the actual time period (center time) on which the location is calculated is defined first in stixcore. The visibility code might (stixpy) might modify the time period to be used for the location calculation | ||
|
|
||
| #### location_duration |
There was a problem hiding this comment.
I'm not sure maybe it would be better to store the imaging timbering e.g start and end time used to make the image.
|
|
||
| - **comment:** maximum CPD per-bin exposure ds (timedel) over the flare start..end window | ||
| - **unit:** ds | ||
| - **example:** `792 ds` |
There was a problem hiding this comment.
same conversation to seconds
|
|
||
| **review comment:** _(to be filled in via `notebooks/flarelist_sdcloc_review_comments.yaml`)_ | ||
|
|
||
| #### time_shift |
There was a problem hiding this comment.
maybe keep same naming as meta data standard?
|
|
||
| **review comment:** _(to be filled in via `notebooks/flarelist_sdcloc_review_comments.yaml`)_ | ||
|
|
||
| ### 6. 1-AU normalization — [`add_distance_normalized_flux`](../stixcore/products/level3/flarelist.py#L94-L110) |
There was a problem hiding this comment.
Nice to have but since this should be easily calculated from two other columns is it worth it/useful I'm not sure need more user/external feedback
No description provided.