seismopy / mopy

A python package to calculate seismic source parameters
11 stars 1 forks source link

ChannelGroup -> StatsGroup #8

Closed d-chambers closed 5 years ago

d-chambers commented 5 years ago

I believe that ChannelInfo should be renamed to StatsGroup and that we should think of it as a group of Trace.Stats-like objects (but it can be much more too!). This has a few implications:

  1. Where there is overlap, we should make sure StatsGroup's columns have the same names as Trace.Stats. For example, the parameters defining the start/stop of windows should be "starttime" and "endtime" rather than "tw_start", "tw_stop" or the like.

  2. We should add a method to init a stats group from a Stream object by simply harvesting the stats objects of the traces contained therein.

  3. The attribute of TraceGroup and SpectrumGroup that accesses the StatsGroup dataframe should simply be "stats" and to access the attached actual StatsGroup object should be either _stats_group or stats_group. All processing info can then just be tracked on the StatsGroup object.

d-chambers commented 5 years ago

What do you guys think @sboltz and @sgjholt ?

sboltz commented 5 years ago

I think that makes sense. I definitely like the parallel to the Trace.stats attribute.

sgjholt commented 5 years ago

I second this, it will make it easier for us to use in the long run too. I guess if it ain't broke don't fix it!

d-chambers commented 5 years ago

ok @sboltz (and maybe @sgjholt, depending on what you are working on) let me know when any work you are doing that would be affected by this refactor is merged into master then I will do it before it becomes you start something else.

sboltz commented 5 years ago

@d-chambers, I think I am okay on my end for you to do the refactor.

sgjholt commented 5 years ago

@d-chambers this doesn't affect me at all right now, still working at the lowest level. My next task will be to create the SpectrumGroup.fit_source() as mentioned in https://github.com/seismopy/mopy/issues/1. The refactor will be done before I get to this I'm sure!