Monthly Flarelists#458
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% 66.85% -5.38%
==========================================
Files 78 80 +2
Lines 8085 9093 +1008
==========================================
+ Hits 5840 6079 +239
- Misses 2245 3014 +769 ☔ View full report in Codecov by Sentry. 🚀 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
|
|
||
|
|
||
| class FlarelistSDCLocImg(FlarelistSDCLoc, FlarePeekPreviewMixin): | ||
| class FlarelistSDCLocImg(FlarelistSDCLoc, FlarePeakPreviewMixin): |
There was a problem hiding this comment.
| class FlarelistSDCLocImg(FlarelistSDCLoc, FlarePeakPreviewMixin): | |
| class FlareListSDCLoccationImage(FlarelistSDCLoc, FlarePeakPreviewMixin): |
|
|
||
|
|
||
| class FlarelistSCLocImg(FlarelistSCLoc, FlarePeekPreviewMixin): | ||
| class FlarelistSCLocImg(FlarelistSCLoc, FlarePeakPreviewMixin): |
There was a problem hiding this comment.
| class FlarelistSCLocImg(FlarelistSCLoc, FlarePeakPreviewMixin): | |
| class FlareListSCLocationImage(FlarelistSCLoc, FlarePeakPreviewMixin): |
No description provided.