Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of density as a free parameter for tomography #764

Merged
merged 19 commits into from
Mar 6, 2024

Conversation

sc458930
Copy link
Contributor

Addition of density as a free parameter for tomography


Sharmistha Chattopadhyay

Modified prob3.py

  • Introduced tomography_type
  • tomography_type - [mass of earth, mass of core (with constrain), mass of core (without constrain)
  • physics parameters:
  1. mass of earth (12 layers): density_scale
  2. mass of core - with constrain (5 layers): core_density_scale

Introduced scaling_params.py

  • Contains the scaling factors and scaling arrays corresponding to each tomography type

Modified layers.py

  • Introduced multiplication of scaling factor with density array

Modified numba_osc_tests.py

  • Introduced unit test for all the tomography types

Copy link
Contributor

@JanWeldert JanWeldert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to modify the Layers class to be able to deal with density scale changes rather than to do everything in the osc stage and reinitialize the class every time

if self.neutrino_decay:
self.decay_params.decay_alpha3 = self.params.decay_alpha3.value.m_as('eV**2')

if self.lri_type is not None:
self.lri_params.v_lri = self.params.v_lri.value.m_as('eV')
if self.tomography_type == "mass_of_earth":
self.tomography_params.density_scale = self.params.density_scale.value.m_as('dimensionless')
self.layers = Layers(earth_model, detector_depth, prop_height,scaling_array=self.tomography_params.density_scale)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to give the Layers class something like a scale function that you can call here to not initialize the class every time the stage is called. That would simplify the entire code (not only this part) and should be faster.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Jan, I have made the modifications. Instead of calling Layers class everytime, now I am calling the scaling function. The scaling function multiplies the scaling factors with the density array. In prob3.py I update the physics parameters (density_scale for mass of Earth, core_density_scale for mass of core (with constrain), etc). Then I call the scaling function from Layers class, where the scaling is done. In this way, the density array is scaled depending on the type of tomography.

Copy link
Contributor

@JanWeldert JanWeldert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better now. It might be even simpler to just multiply container['densities'] with the scaling array (and store an unscaled version of container['densities'] somewhere), but this also works.

for container in self.data:
self.layers.calcLayers(container['true_coszen'])
container['densities'] = self.layers.density.reshape((container.size, self.layers.max_layers))
container['distances'] = self.layers.distance.reshape((container.size, self.layers.max_layers))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also have to overwrite this? The scaling shouldn't change the distances, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes right. We don't need to overwrite container['distances']. I have removed it. We only require till container['densities'].

@sc458930 sc458930 merged commit 480c067 into icecube:master Mar 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants