Initial draft of SpectrogramMeta classes#245
Conversation
| # Identification | ||
| @property | ||
| @abc.abstractmethod | ||
| def instrument(self): |
There was a problem hiding this comment.
I think a short description and the type info should be encode here for each property e.g.
def instrument(self) -> str:
"""
Name of the instrument
"""
pass
and then here if we only return str then the default south be "" if that better or worse then returning a str or none e.g. -> str|None
There was a problem hiding this comment.
for properties like date_start, frequency_rangeor data_units, what should i write for them??
There was a problem hiding this comment.
"Start of the observation" Time
"Frequency range of observation" Quantity
"Unit for the data" Unit
Maybe we don't need the docstrings for them all but they types would be good
There was a problem hiding this comment.
One more doubt, what would you prefer for observer_location and data_mask?
|
Also you can embed mermaid charts directly in GitHub doesn't match exactly the UML but close enough classDiagram
direction TB
class NDMetaABC {
<<ndcube.meta>>
}
class SpectrogramMetaABC {
<<abstract>>
+instrument
+observatory
+detector
+date_start
+date_end
...
}
class NDMeta {
<<ndcube.meta>>
dict subclass
+axes
...
+slice()
+add()
+rebin()
}
class SpectrogramMeta {
<<concrete base>>
dict-backed via NDMeta
+instrument
+observatory
+detector
+date_start
+date_end
...
}
class WAVESMeta {
+background
+receiver
}
class CALISTOMeta {
+observer_location
}
class OtherInstrumentMetas {
<<...>>
}
%% Relationships
SpectrogramMetaABC --|> NDMetaABC : inherits
NDMeta --|> NDMetaABC : inherits
SpectrogramMeta --|> NDMeta : inherits
SpectrogramMeta ..|> SpectrogramMetaABC : implements
WAVESMeta --|> SpectrogramMeta
CALISTOMeta --|> SpectrogramMeta
OtherInstrumentMetas --|> SpectrogramMeta
|
| @property | ||
| @abc.abstractmethod | ||
| def data_units(self) -> Unit: | ||
| """Unit for the data""" | ||
| pass |
There was a problem hiding this comment.
I think this is aleady cover by the unit in NDCube
| def observer_location(self): | ||
| """Observer location.""" | ||
| pass |
There was a problem hiding this comment.
Maybe observe_coordinate would be better and this should be a SkyCoord | None
There was a problem hiding this comment.
Got it, I'm working on it
Thats so cool, I didn't know GitHub supported Mermaid diagrams. I'll definitely try using them, Thanks a lot! |
|
Should i add the rest of the classes in this PR or like break it in different PRs?? |
|
I think adding the classes necessary to handle the instruments that are currently supported would make sense. |
|
I have added the remaining classes, let know your thoughts on this @samaloney |

PR Description
Fixes #243
Implementing a metadata class hierarchy for radiospectra, following the pattern used in sunraster and the LC Radio Workshop metadata requirements.
I tried to make some flowcharts as well, will attach them too.
Changes:
SpectrogramMetaABCandSpectrogramMeta(backed by NDMeta) inradiospectra/spectrogram/meta.pyWAVESMetaandCALISTOMetainstrument specific subclasses for initial setupGenericSpectrogramto wrap raw dict metadata intoSpectrogramMetaautomaticallyAI Assistance Disclosure
AI tools were used for:
This is an initial draft, so I've just tried to make the changes in WAVES and CALISTO, if it looks in the right direction then I'll add the remaining subclasses also. Let me know your thoughts on this @samaloney and @hayesla.