mpound / pdrtpy

PhotoDissociation Region Toolbox Python module
GNU General Public License v3.0
6 stars 3 forks source link

ability to add a user-computed model to a ModelSet instance. #55

Closed mpound closed 2 years ago

mpound commented 2 years ago

Dear Marc,

thank you for the update. I find a lot of improvements. However, I have a new feature request:

The list of intensity and ratio files will never be complete in terms of what the user may want. A simple case that I tried yesterday was pure CII intensities from kt2013. However, this can apply to any ratio or intensity that the user may want to look at, but where no FITS file is there. Numerically, I can easily generate the values or ratios from the existing data. For the kt2013 CII case e.g. by mods = ms.get_models(["CII_158","OI_145", "FIR"],model_type='both') cii_field = (mods['FIR'].data)*(mods['OI_145+CII_158/FIR'].data)/((mods['OI_145/CII_158'].data)+1.0)

However, I cannot use the ModelPlot methods to work with this data set. The solution that I think of to implement a ModelSet.register method. This should allow to define new models in the existing ModelSet by defining the dataset in a numerical way, e.g. like above, give it a key and inherit or redefine the other properties from another model in the ModelSet. Then I can even compare the Measurement with those user-defined data when the keys match.

Do you think that this is easily possible? Probably I am overlooking things. There may be another solution, but it would be good to have the full flexibility of the maths combining the FITS files within the ModelSet-ModelPlot combo.

Cheers Volker

mpound commented 2 years ago

Good idea and one I've wanted to implement for a while. I could even imagine allowing the user to write out the files to a disk area where they could be read in and registered again later, saving the repetition of arithmetic.

mpound commented 2 years ago

I now have this working in the development branch and will be part of version 2.2.7

mpound commented 2 years ago

This is now officially in release 2.2.9