NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links


healpix.core.dm
Class HealpixMapImp

java.lang.Object
  extended by healpix.core.HealpixIndex
      extended by healpix.core.dm.HealpixMapImp
All Implemented Interfaces:
AbstractHealpixMap, HealpixMap, Serializable, Cloneable

public class HealpixMapImp
extends HealpixIndex
implements HealpixMap, Serializable, Cloneable

A Healpix map can generate sky maps encoded in the HEALPix sky indexing scheme (http://healpix.jpl.nasa.gov/). The created maps can be written to a FITS data set for further processing with e.g. visualisation/analysis tools in the HEALPix distribution.

Version:
$Id: HealpixMapImp.java,v 1.1.2.4 2010/02/22 14:55:50 healpix Exp $
Author:
ejoliet
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface healpix.core.dm.AbstractHealpixMap
AbstractHealpixMap.Scheme
 
Field Summary
 
Fields inherited from class healpix.core.HealpixIndex
ns_max, nside, nsidelist, REVISION, z0
 
Constructor Summary
HealpixMapImp(long pixels, String[] maps)
          Construct a HEALPix mapper whose sphere tesselisation contains no less than a given number of pixels.
HealpixMapImp(short nsideIndex, String[] maps)
          Construct a HEALPix mapper for a given NSIDE.
HealpixMapImp(String[] maps, double[][] mapIt)
          Construct a HEALPix mapper for a given map names and data columns.
 
Method Summary
 void add(AngularPosition pos, double val)
          Add a value to a HEALPix cell in the default map.
 void add(int i, AngularPosition pos, double val)
          Add a value to a HEALPix cell in a map
 void add(int index, double val)
          Add a value to a HEALPix cell in the default map.
 int ang2pix(AngularPosition pos)
          Get the map ith pixel from an AngularPosition position
 int ang2pix(double theta, double phi)
          Returns the index healpix pixel from an angular position
 void average(int n)
          Replace each cell value by the average of all values added to the cell.
 void convert_nest2ring()
          makes the conversion map NEST to RING
 void convert_ring2nest()
          makes the conversion map RING to NEST
 double get(AngularPosition pos)
          Return the value of an HEALPix cell in the default map.
 double get(int pixId)
          Return the value of an HEALPix cell in the default map.
 double get(int i, int pixId)
          Return the value of an HEALPix cell in the map.
 int getCount(int i, int pixId)
          Get the accumulated added value to a pixel
 int getImap(String cname)
          Get the number corresponding to that name cname
 double[][] getMapItemData()
          Gets the column(s) data values
 double getMax()
          Returns maximum value from default map.
 double getMax(int i)
          Returns maximum value from a map.
 double getMaxMapItem(int i)
          Gets the max map item.
 double getMin()
          Returns minimum value from default map
 double getMin(int i)
          Returns minimum value from a map.
 double getMinMapItem(int i)
          Gets the min map item.
 String[] getName()
          Get the names from the HealpixMap
 int getNside()
          Return the value of the HEALPix NSIDE parameter.
 int getPosCount(int i, AngularPosition pos)
          Get the accumulated added value to a pixel
 AbstractHealpixMap.Scheme getScheme()
          Return the current HEALPix scheme.
 double mean(int imap, int firstPix, int lastPix)
          Average value over data from firstPix to lastPix index
 double[] mollpro(int xsize, double lon0)
          Method to get the projected map dependent of the scheme : will obtain xsize as x-dimension of the output-array and lon0 as the longitude (in degrees)
 void normalize(int n)
          Scale a map by total number of values added, i.e. the sum of all cell values amounts to one after the operation
 long nPixel()
          Return the number of pixels/cells of the sphere tesselisation.
 int nside()
          Return the value of the HEALPix NSIDE parameter.
 AngularPosition pix2ang(long ipix)
          Returns the angular position AngularPosition pointing at that pixel index in the healpix sphere tesslated
 HealpixMap regrade(int nside)
          Down/Upgrade the map resolution
 void scale(int n, double f)
          Scale each cell value by the given value.
 void setImap(int i)
          Sets the map data from its number in healpix map
 void setName(String[] colname)
          Set the names of the maps
 void setNside(int nside)
          Setting the resolution number nside
 void setScheme(AbstractHealpixMap.Scheme scheme)
          Set the HEALPix scheme.
 void setValueCell(int ipix, double val)
          Sets the value val into the cell numbered ipix in default map
 void setValueCell(int nmap, int ipix, double val)
          Sets the value val into the cell numbered ipix in nmap map
 Object shallowClone()
          Shallow clone.
 void toDataSet(String name)
          Write generated maps to a FITS data set.
 
Methods inherited from class healpix.core.HealpixIndex
ang2pix_nest, ang2pix_ring, Ang2Vec, angDist, bitdiff, calculateNSide, corners_nest, corners_ring, crossProduct, dotProduct, getChildrenAt, getOrder, getPixRes, InRing_nested_longset, inRing, inRing, InRing, inRingCxx, InRingLongSet, integration_limits_in_costh, intrs_intrv, log2, neighbours_nest, nest2ring, next_in_line_nest, npix2Nside, nside2Npix, nside2order, parentAt, pix2ang_nest, pix2ang_ring, pix2vec_nest, pix2vec_ring, pixel_boundaries, printVec, query_disc, query_polygon, query_strip, query_triangle, ring, ring2nest, ringNum, setOrder, surfaceTriangle, vec2pix_nest, vec2pix_ring, Vect2Ang, vector
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HealpixMapImp

public HealpixMapImp(String[] maps,
                     double[][] mapIt)
              throws Exception
Construct a HEALPix mapper for a given map names and data columns.

Parameters:
mapIt - the data array
maps - Array of strings with map names. the length of the array determines the number of maps to generate.
Throws:
Exception

HealpixMapImp

public HealpixMapImp(short nsideIndex,
                     String[] maps)
              throws Exception
Construct a HEALPix mapper for a given NSIDE.

Parameters:
nsideIndex - HEALPix sphere tesselisation is done with NSIDE=2^nSideIndex - nSideIndex must be greater or equal to 0.
maps - Array of strings with map names. the length of the array determines the number of maps to generate.
Throws:
Exception

HealpixMapImp

public HealpixMapImp(long pixels,
                     String[] maps)
              throws Exception
Construct a HEALPix mapper whose sphere tesselisation contains no less than a given number of pixels.

Parameters:
pixels - Minimum number of cells/pixels that the tesselisation shall contain.
maps - Names of Healpix maps to create.
Throws:
Exception
Method Detail

getScheme

public AbstractHealpixMap.Scheme getScheme()
Description copied from interface: AbstractHealpixMap
Return the current HEALPix scheme.

Specified by:
getScheme in interface AbstractHealpixMap
Returns:
the current HEALPix scheme.

setScheme

public void setScheme(AbstractHealpixMap.Scheme scheme)
Description copied from interface: AbstractHealpixMap
Set the HEALPix scheme.

Specified by:
setScheme in interface AbstractHealpixMap
Parameters:
scheme - Scheme to set.

nPixel

public long nPixel()
Description copied from interface: AbstractHealpixMap
Return the number of pixels/cells of the sphere tesselisation.

Specified by:
nPixel in interface AbstractHealpixMap
Returns:
the number of pixels/cells of the sphere tesselisation.

nside

public int nside()
Description copied from interface: AbstractHealpixMap
Return the value of the HEALPix NSIDE parameter.

Specified by:
nside in interface AbstractHealpixMap
Returns:
the value of HEALPIx NSIDE parameter.

add

public void add(AngularPosition pos,
                double val)
Description copied from interface: HealpixMap
Add a value to a HEALPix cell in the default map.

Specified by:
add in interface HealpixMap
Parameters:
pos - Position of HEALPix cell whose value is to be incremented - spherical coordinates (0<=theta<=pi; 0<=phi<=2pi).
val - Value to add to the HEALPix cell.

get

public double get(AngularPosition pos)
Description copied from interface: HealpixMap
Return the value of an HEALPix cell in the default map.

Specified by:
get in interface HealpixMap
Parameters:
pos - Position of HEALPix cell whose value is to be incremented - spherical coordinates (0<=theta<=pi; 0<=phi<=2pi).
Returns:
the value of the cell.

getCount

public int getCount(int i,
                    int pixId)
Get the accumulated added value to a pixel

Parameters:
i - ith map
pixId - pixel id
Returns:
number of added value

getPosCount

public int getPosCount(int i,
                       AngularPosition pos)
                throws Exception
Get the accumulated added value to a pixel

Parameters:
i - ith map
pos - Angular position in sky
Returns:
number of added value
Throws:
Exception

get

public double get(int i,
                  int pixId)
Description copied from interface: HealpixMap
Return the value of an HEALPix cell in the map.

Specified by:
get in interface HealpixMap
Parameters:
i - Map index in the range 0 to number of maps-1
pixId - Pixel id.
Returns:
the value of the cell.

get

public double get(int pixId)
Description copied from interface: HealpixMap
Return the value of an HEALPix cell in the default map.

Specified by:
get in interface HealpixMap
Parameters:
pixId - Pixel id.
Returns:
the value of the cell.

add

public void add(int index,
                double val)
Description copied from interface: HealpixMap
Add a value to a HEALPix cell in the default map.

Specified by:
add in interface HealpixMap
Parameters:
index - Pixel Id.
val - Value to add to the HEALPix cell.

add

public void add(int i,
                AngularPosition pos,
                double val)
Description copied from interface: HealpixMap
Add a value to a HEALPix cell in a map

Specified by:
add in interface HealpixMap
Parameters:
i - Map index in the range 0 to number of maps-1
pos - Position of HEALPix cell whose value is to be incremented - spherical coordinates (0<=theta<=pi; 0<=phi<=2pi).
val - Value to add to the HEALPix cell.

normalize

public void normalize(int n)
Description copied from interface: HealpixMap
Scale a map by total number of values added, i.e. the sum of all cell values amounts to one after the operation

Specified by:
normalize in interface HealpixMap
Parameters:
n - Index of map to normalise.

average

public void average(int n)
Description copied from interface: HealpixMap
Replace each cell value by the average of all values added to the cell.

Specified by:
average in interface HealpixMap
Parameters:
n - Index of map.

scale

public void scale(int n,
                  double f)
Description copied from interface: HealpixMap
Scale each cell value by the given value.

Specified by:
scale in interface HealpixMap
Parameters:
n - Index of map
f - Value to multiply by.

toDataSet

public void toDataSet(String name)
               throws Exception
Description copied from interface: HealpixMap
Write generated maps to a FITS data set.

Specified by:
toDataSet in interface HealpixMap
Parameters:
name - Name of the data set.
Throws:
Exception

regrade

public HealpixMap regrade(int nside)
Description copied from interface: HealpixMap
Down/Upgrade the map resolution

Specified by:
regrade in interface HealpixMap
Parameters:
nside - resolution number
Returns:
HealpixMap

getMin

public double getMin()
Description copied from interface: HealpixMap
Returns minimum value from default map

Specified by:
getMin in interface HealpixMap
Returns:
the minimum value from ith map

getMax

public double getMax()
Description copied from interface: HealpixMap
Returns maximum value from default map.

Specified by:
getMax in interface HealpixMap
Returns:
the maximum value from default map

getMax

public double getMax(int i)
Description copied from interface: HealpixMap
Returns maximum value from a map.

Specified by:
getMax in interface HealpixMap
Parameters:
i - a map index from 0 to nMap-1
Returns:
the maximum value from ith map

getMaxMapItem

public double getMaxMapItem(int i)
Gets the max map item.

Parameters:
i - the i
Returns:
the max map item

getMin

public double getMin(int i)
Description copied from interface: HealpixMap
Returns minimum value from a map.

Specified by:
getMin in interface HealpixMap
Parameters:
i - a map index from 0 to nMap-1
Returns:
the minimum value from ith map

getMinMapItem

public double getMinMapItem(int i)
Gets the min map item.

Parameters:
i - the i
Returns:
the min map item

setValueCell

public void setValueCell(int nmap,
                         int ipix,
                         double val)
Description copied from interface: HealpixMap
Sets the value val into the cell numbered ipix in nmap map

Specified by:
setValueCell in interface HealpixMap
Parameters:
nmap - the nth map
ipix - the ith pixel
val - the double value to set

setValueCell

public void setValueCell(int ipix,
                         double val)
Description copied from interface: HealpixMap
Sets the value val into the cell numbered ipix in default map

Specified by:
setValueCell in interface HealpixMap
Parameters:
ipix - the ith pixel
val - the double value to set

getNside

public int getNside()
Return the value of the HEALPix NSIDE parameter.

Returns:
the value of HEALPIx NSIDE parameter.

setNside

public void setNside(int nside)
Setting the resolution number nside

Parameters:
nside - resolution number

ang2pix

public int ang2pix(double theta,
                   double phi)
            throws Exception
Description copied from interface: HealpixMap
Returns the index healpix pixel from an angular position

Specified by:
ang2pix in interface HealpixMap
Parameters:
theta - angle (along meridian), in [0,Pi], theta=0 : north pole
phi - angle (along parallel), in [0,2*Pi]
Returns:
integer index pixel
Throws:
Exception

ang2pix

public int ang2pix(AngularPosition pos)
            throws Exception
Get the map ith pixel from an AngularPosition position

Parameters:
pos - the AngularPosition position
Returns:
healpix ith pixel number
Throws:
Exception

pix2ang

public AngularPosition pix2ang(long ipix)
                        throws Exception
Description copied from interface: HealpixMap
Returns the angular position AngularPosition pointing at that pixel index in the healpix sphere tesslated

Specified by:
pix2ang in interface HealpixMap
Parameters:
ipix - the index pixel to get the angular position
Returns:
the angular position theta,phi
Throws:
Exception

mollpro

public double[] mollpro(int xsize,
                        double lon0)
Method to get the projected map dependent of the scheme : will obtain xsize as x-dimension of the output-array and lon0 as the longitude (in degrees)

Specified by:
mollpro in interface HealpixMap

getName

public String[] getName()
Description copied from interface: AbstractHealpixMap
Get the names from the HealpixMap

Specified by:
getName in interface AbstractHealpixMap
Returns:
String[] names

setName

public void setName(String[] colname)
Description copied from interface: AbstractHealpixMap
Set the names of the maps

Specified by:
setName in interface AbstractHealpixMap
Parameters:
colname - names maps

getImap

public int getImap(String cname)
Description copied from interface: AbstractHealpixMap
Get the number corresponding to that name cname

Specified by:
getImap in interface AbstractHealpixMap
Parameters:
cname - map name which we want to get the ith number
Returns:
ith map

setImap

public void setImap(int i)
Description copied from interface: AbstractHealpixMap
Sets the map data from its number in healpix map

Specified by:
setImap in interface AbstractHealpixMap
Parameters:
i - map ith number

convert_nest2ring

public void convert_nest2ring()
                       throws Exception
makes the conversion map NEST to RING

Specified by:
convert_nest2ring in interface HealpixMap
Throws:
Exception

convert_ring2nest

public void convert_ring2nest()
                       throws Exception
makes the conversion map RING to NEST

Specified by:
convert_ring2nest in interface HealpixMap
Throws:
Exception

getMapItemData

public double[][] getMapItemData()
Description copied from interface: HealpixMap
Gets the column(s) data values

Specified by:
getMapItemData in interface HealpixMap
Returns:
the map(s) double values

mean

public double mean(int imap,
                   int firstPix,
                   int lastPix)
Description copied from interface: HealpixMap
Average value over data from firstPix to lastPix index

Specified by:
mean in interface HealpixMap
Parameters:
imap - the ith map
firstPix - first pixel index to count
lastPix - last pixel index to count
Returns:
the arithmetic mean

shallowClone

public Object shallowClone()
Shallow clone.

Returns:
the object

"Built from revision exported"

Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650