Convenient way to plot extra noises not calculated by core gwinc routines, and arbitrarily scale noises before plotting
This is just my attempt to flesh out the suggestions that @adf and I made in today's pygwinc presentation about having a way in pygwinc to allow non Python experts to add their own curves without hacking the core gwinc code, and to allow users to hack around with noise objects before plotting with gwinc. Here is my suggestion on how this might be done (@adf feel free to comment/agree/disagree!).
It would be nice to be able to manually construct a noise budget from a bunch of individual noises, either using core gwinc routines or by defining your own from some measured data. Maybe this is possible already, but perhaps it can be made more intuitive with the inclusion of support for operator overloading. For example:
# calculate all relevant coating noises
coating_budget = gwinc.noise.coatingthermal(...)
# calculate all relevant seismic noises
seismic_budget = gwinc.noise.seismic(...)
# get my custom noise object from my own code, not part of gwinc core code
extra_noise = my_noise_function(...) # returns an nb.Noise object
# combine all of these together
budget = coating_budget + seismic_budget + extra_noise # define a __mul__ operation in nb.Noise. The resulting budget is itself a noise object, and it remembers the noises were used to construct it.
# plot, ideally only showing total noises in each group, but
# as a bonus feature, allow the user to plot all sub-noises in
# particular group(s) using wildcards
budget.plot(..., drilldown=["coating.*", "seismic.*"]) # show all coating and seismic subnoises
It would also be great to be able to take one budget with all its subnoises and merge it together with another one calculated elsewhere, with some noises having been scaled (e.g. pesky factors of 2):
# load and calculate budget using IFO struct and core gwinc routines
theoretical_budget = gwinc.noise_calc(...)
# load measured data (nb.Noise objects)
measured_coating, measured_seismic, measured_shot = load_lab_data(...)
# manually scale measured shot noise e.g. to get it to fit what gwinc predicts
measured_shot *= 2 # nb.Noise would need to support __mul__ etc. You may also want to multiply by a numpy array here.
# construct budget from nb.Noise objects constructed from data taken in the lab
measured_budget = measured_coating + measured_seismic + measured_shot
# merge
budget = theoretical_budget + measured_budget
# plot
budget.plot(...)
Thoughts?