Action #3170

Have cssens handle diffuse map cube

Added by Martin Pierrick over 4 years ago. Updated over 2 years ago.

Status:ClosedStart date:03/02/2020
Priority:NormalDue date:
Assigned To:Martin Pierrick% Done:

100%

Category:-Estimated time:1.00 hour
Target version:2.0.0
Duration:

Description

The cssens script does not currently handle map cubes. Need to implement a calculation of the source flux specific to that kind of spatial model.


Recurrence

No recurrence.

History

#1 Updated by Martin Pierrick over 4 years ago

  • Status changed from New to Pull request
  • % Done changed from 0 to 90

Code available in branch 3170-cssens-add-mapcubes of my gitlab fork
Just added a few lines of code to precompute the flux in each map of the map cubes and have source flux computed as these map fluxes scaled by spectral normalization.
Not tested extensively.
Note the addition of a flag to tell if the source handled is a map cube or not (not sure you want it done that way).

#2 Updated by Martin Pierrick over 4 years ago

Wait a minute... There seems to be a problem when handling a mapcube with multiprocessing. I get this message:
ValueError: *** ERROR in GNodeArray::set_value(double&): Invalid value. Attempting to set interpolating value without having any nodes. Interpolation can only be done if nodes are available
Is it that the mapcube spectrum is not propagated over threads, so when trying to evaluate the mapcube spectrum it fails ? Currently investigating the bug...
Updated: alternative possibility is that the cube was not loaded

#3 Updated by Martin Pierrick over 4 years ago

  • Status changed from Pull request to In Progress

#4 Updated by Martin Pierrick over 4 years ago

So the problem was indeed that the information set by the method set_mc_cone() in GModelSpatialDiffuseCube is currently lost when the class is pickled during multiprocessing (see issue #3179). I am currently testing a new version where the existence of the map cube spectrum is checked in each thread, in the call to the get_sensitivity() method.

#5 Updated by Martin Pierrick over 4 years ago

Quick update on this... There is on branch 3170-cssens-add-mapcubes on my gitlab fork a working version of the code. It can be integrated if needed but feedback or further testing will be required for sure as I have already encountered some unsatisafactory results when using the tool on halos. The issue is not necessarily related to the implementations I made and may have to do with convergence of the sensitivity estimate. To be investigated...

#6 Updated by Knödlseder Jürgen over 3 years ago

  • Target version set to 2.0.0

#7 Updated by Knödlseder Jürgen over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

I merged the code into devel.

Also available in: Atom PDF