Action #1296

Add GSkymap::Scale(index,scale)

Added by Lu Chia-Chun over 10 years ago. Updated almost 10 years ago.

Status:ClosedStart date:07/24/2014
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.0.0
Duration:

Description

This method is in parallel with GCTAResponseTable::scale(const int& index, const double& scale), to scale pixel contents.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 10 years ago

  • Description updated (diff)

You can do

>>> map=gammalib.GSkymap("CAR","CEL",0.0,0.0,1.0,1.0,10,10)
>>> map[0] = 3.4
>>> map[0] *= 2.0
>>> print(map[0])
6.8

Or are you looking for something else?

#2 Updated by Lu Chia-Chun over 10 years ago

just a function to automatically scale each pixel by a constant.
It’s not necessary since we can always go to each pixel and do what you described. You can reject this issue if you don’t like to have such a function.

#3 Updated by Knödlseder Jürgen almost 10 years ago

  • Status changed from New to Closed
  • Assigned To changed from Lu Chia-Chun to Knödlseder Jürgen
  • Target version set to 1.0.0
  • % Done changed from 0 to 100
  • Remaining (hours) set to 0.0

I added the operators

GSkymap& operator*=(const double& factor);
GSkymap& operator/=(const double& factor);

to GSkymap that allow multiplication or division of all pixel values by a given factor.

Also available in: Atom PDF