Mochi integration - #117
Draft
kyleaoman wants to merge 50 commits into
Draft
Conversation
… mochi-integration
Remove obsolete functions and parameters because of new gridsearch
Method was an artefact and no longer required. Could still be useful for testing(?)
Parameter disproportionately slows down spectral convergence. Other parameters already offer more accessible max resolution control.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To do
Just opening a draft PR as a place to discuss and perhaps collaboratively develop.
I've had an initial quick hack starting to integrate the
mochiapproach into the overallmartiniframework. Some initial notes:Mochiclass analogous to the mainMartiniclass that could implement a similar API and take advantage of a lot of existing functionality. This is done (at least as a rough draft), you can create aMochi, callMochi.insert_source_in_cube()and end up with aDataCubeobject populated with emission. The convolution, write to fits/hdf5, etc. features fromMartinithen work automatically.AdaptiveCellGridclass so that some of the information (e.g. cell coordinates) can be held centrally instead of passed around many functions. The current implementation is still rough but splits up the process into functions corresponding to the relevant steps (initial grid, refined, interpolated, regular grid, radiative transfer). Many options still need to be exposed to the outside world, and I think that there's still some unnecessary passing of arguments etc., but what's there gives an idea of a suggested framework.martinifeatures that can be dropped.camelCasetosnake_case, just a consistency choice. Also started on many of the docstrings, just filling stuff in as I was trying to figure out what types various things were supposed to have.As evidence that "it works!" here are two tiny mom0 maps from the same particles. They're not identical because
mochihas a limited depth along the LoS and I haven't made sure to cover all particles that can be included bymartini(plus the expected scanline vs non-scanline differences), but at least the general data-wrangling is operational.martini:

mochi:

This is about a day's effort so if you prefer to go down a different path then no harm done. If this approach seems promising then I'm happy to collaborate on a full implementation, perhaps aiming for a release in time for PHISCC. I think that there's probably a reasonable way to divide up the work. Note that everything is self-contained in the new
mochisubdirectory in this branch. That could stay there, move around within themartininamespace, or be split off as a separate package or sub-package. There are various pros/cons. For example under this repo you benefit from having the docs, CI and deployment pipelines already set up. However perhaps you prefer more ownership and autonomy. We can discuss further if wanted.