Class Imager
Usage:
java skyview.geometry.test.Imager [key=value] [key=value] ...
If the code is being executed from Jar file, then use
java -jar skyview.jar [key=value] [key=value]...
The field keys are not case sensitive but the values may be.
Valid field keys include:
Lon: The longitude of the center of the output image in the coordinate system selected. Note that the default coordinate system is J2000, so the longitude is the right ascension. The value is specified in decimal degrees.
Lat: The latitude of the center of the output image in the coordinate system selected. J2000 is the default coordinate system, so by default Lat corresponds to declination. The value is specified in decimal degrees.
Position : The comma separated longitude and latitude. If Position and Lon/Lat are specified then the values specified in Lon/Lat override those in position.
CopyWCS : An existing FITS file may be used to define the WCS to be used for the output. If this argument is specified any other argument that specifies the output image geometry is ignored.
Coordinates : A string describing the coordinate system to be used for the output image. It comprises an inital letter which gives the coordiante system, which prefixes a number giving the epoch of the coordiante system.
- J: Julian (FK5) coordiantes, e.g., J2000.
- B: Besselian coordinates, e.g., B1950.
- E: Julian Ecliptic coordinates, e.g., E2000.
- H: Helioecliptic coordinates (i.e., coordinates centered on the instantaneous position of the sun), e.g., H2002.4356.
- G: Galactic coordinates. Characters after the first are ignored.
- I: ICRS coordinates. Characters after the first are ignored.
Projection: The projection used to convert from celestial to plane coordinates. The projection string is the 3 character string used in the FITS WCS papers, with only the first letter capitalized. Supported output projections include:
- Tan: The tangent plane on gnomonic projection.
- Sin: The sine or orthographic projection.
- Ait: The Hammer-Aitoff projection.
- Mol: MillWeide projection.
- Car: The cartesian or plate-caree projection.
- Zea: The Zenithal equal area projection
- Csc: The COBE sperical cube projection.
- Toa: The HTM TOAST projection
Sampler: The sampler defines how the input images are sampled to get values at the putput pixels. Sampling algorithims include:
- NN: Nearest Neighbor.
- LI: [Bi-]Linear interpolation.
- Lanczos[n]: A Lanczos smoothly truncated Sinc interpolator of order n. Lanczos defaults to order 3.
- Spline[n]: The n'th order spline interpolation. Defaults to cubic splines. The order may range from 2 to 5.
- Clip: A flux conserving exact area resampler where output pixels serve as clipping windows on the input image.
Scale: The size of the output pixels in degrees. If the pixels are square only a single values is given. Non-square pixels can be specified as Scale=xsize,ysize.
Size: The size of the entire image in degrees.
Pixels: The number of output pixels along an edge. If the output image is not square this can be specified as Pixels=xPixels,yPixels
Rotation: A rotation in the output plane to be applied to the data (in decimal degrees)
Survey: The survey from which the output image is to be created. More than one survey can be specified as survey1,survey2,survey3,...
Ebins: For surveys with a third dimension, the binning to be applied in this dimension. Currently this is specified using as x0,dx,n where x0 is the starting bin for the first output bin, dx is the width of the output bins, and n is the number of output bins. These are expressed in terms of the input energy bins, such that if the survey data has 10 bins, the first bin ranges from 0-1, the second from 1-2 and the last from 9-10. If we wished to rebin this data into four evenly spaced bins excluding the first and last bins, then Ebins=1,2,4. A default binning is defined for each 3-d survey included in SkyView.
Output: The output file name. If data is being created from more than one survey, then the survey short name will be appended to the name. The default output filename is output.fits. The strings "-" or "stdout" are used to specify writing to the standard output.
Compress: Write the output in GZIP compressed form. The value field is ignored.
Float: Write output in 4 byte reals rather than 8 byte. The value field is ignored.
The following options control where the imager task finds survey data.
XMLRoot: The directory containing the XML survey descriptions
Cache: Directory location (or locations) where cached files (survey files retrieved from remote locations) are to be found. The first cache location is also used when a remote file is retrieved.
PurgeCache: Should files cached during this retrieval be deleted after processing? Only files cached during the current operation will be deleted. If there are survey files in the cache area from previous requests that are used in the current request, these will be retained.
SurveyXML: Gives the name of a file containing an XML description of a survey. This allows the user to create an image from a survey they are describing. Use a "," to separate multiple survey files.
The following operations allow the user to override the basic processing operations.
The following options control the classes that are used in processing the user request. Most users can ignore these.
SurveyFinder: The class of the object that finds the appropriate survey object for the surveys the user has requested.
ImageFinder The class of the object that finds the appropriate images within a survey for each pixel of the output object.
PreProcessor: One or more objects that do image pre-processing.
Mosaicker: The object that actually generates the output image melding together the input images.
PostProcessor: One or more classes of object that do image post processing. One example used by default in some surveys is the skyview.geometry.Deedger. You can force de-edging by specifying the class, or turn it off by setting PostProcessor=null.
NoFITS: Do not create a FITS output file. This could be used for debugging, or more likely in combination with graphics output created by the skyview.ij.IJProcessor where the user wants only a JPEG or GIF and does not need a FITS file. See the help for the IJProcessor for details on supported formats and other options.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
The beginning of the first pixel in energy space.protected CoordinateSystem
The CoordinateSystem object for the output image.protected Image[]
The candidate images for use in resamplingprotected double
The width of pixels in energy spaceprotected DepthSampler
The energy sampler object used when creaing the output image.protected double
The lon/lat (or RA/dec) coordinates of the output image.protected double
The lon/lat (or RA/dec) coordinates of the output image.protected Image
The current output imageprotected Projection
The Projection object for the output image.protected Scaler
The Scaler object for the output image.protected Sampler
The sampler object used to create the output image.protected Survey
The current Survey object being used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Clear out state that may confuse subsequent processingvoid
Create the FITS fileprotected void
protected void
doProcessSurvey
(String surveyID, Survey surv) void
dynoProcess
(String name, Boolean updates) Run a processor.Image[]
Get the candidate images that may be used for resamplingdouble[]
Get any adjustments made to image intensities to minimize edge effects.Get the output data as 1-d double arraystatic Imager
Get an Imager object -- normally the last one created.double
getLat()
Get the central latitude/declination of the output imagedouble
getLon()
Get the central longitude/RA of the output imageint
Get the energy depth of the output imageint
Get the height of the output image in pixelsint
Get the width of the output image in pixelsGet the sampler name.Get the Scaler used for the output image.static double
getSum
(double[] arr) Get the current survey being processedstatic String
protected skyview.executive.Imager.ImageState
boolean
init()
protected Image[]
loadCandidates
(Position pos, Survey surv) protected Image
protected int[]
protected Position
protected void
loadSurvey
(String surveyID) protected WCS
loadWCS()
static void
Generate an image given the input parameters.void
postprocessSurvey
(Boolean allProc) void
processSurvey
(String surveyID) Process a particular survey.protected int[]
reuseMatch
(String surveyID) void
run()
Run the commandvoid
Run an image with a given set of arguments.
-
Field Details
-
bin0
protected double bin0The beginning of the first pixel in energy space. -
dBin
protected double dBinThe width of pixels in energy space -
s
The Scaler object for the output image. -
p
The Projection object for the output image. -
c
The CoordinateSystem object for the output image. -
samp
The sampler object used to create the output image. -
dsamp
The energy sampler object used when creaing the output image. -
lon
protected double lonThe lon/lat (or RA/dec) coordinates of the output image. -
lat
protected double latThe lon/lat (or RA/dec) coordinates of the output image. -
surv
The current Survey object being used. -
cand
The candidate images for use in resampling -
output
The current output image
-
-
Constructor Details
-
Imager
public Imager()Initialize the imager. Make sure that choices have been made for the basic elements needed for running the code.
-
-
Method Details
-
main
Generate an image given the input parameters. See class documentation for usage.- Throws:
Exception
-
getVersion
-
getSamplerName
Get the sampler name. -
getScaler
Get the Scaler used for the output image. -
getImageData
Get the output data as 1-d double array -
getLon
public double getLon()Get the central longitude/RA of the output image -
getLat
public double getLat()Get the central latitude/declination of the output image -
getSurvey
Get the current survey being processed -
getEdgeAdjustments
public double[] getEdgeAdjustments()Get any adjustments made to image intensities to minimize edge effects. -
getCandidates
Get the candidate images that may be used for resampling -
getPixelDepth
public int getPixelDepth()Get the energy depth of the output image -
getPixelWidth
public int getPixelWidth()Get the width of the output image in pixels -
getPixelHeight
public int getPixelHeight()Get the height of the output image in pixels -
run
Run an image with a given set of arguments. Retained for compatibility with V1.00. Putting the argument handling in the main code allows more flexibility in creating Image objects.- Throws:
Exception
-
checkUpdateSettings
public void checkUpdateSettings() -
init
- Throws:
Exception
-
run
Run the command- Throws:
Exception
-
loadSurvey
- Throws:
Exception
-
loadWCS
- Throws:
Exception
-
loadPosition
- Throws:
Exception
-
loadImage
- Throws:
Exception
-
loadCandidates
- Throws:
Exception
-
loadSamplers
- Throws:
Exception
-
reuseMatch
-
loadMatch
- Throws:
Exception
-
doProcess
- Throws:
Exception
-
doProcess
- Throws:
Exception
-
dynoProcess
Run a processor.- Parameters:
name
- The class name of the processorupdates
- Indicates whether the processor should be run. If null, then any processor should run. Otherwise run the processor only if the values of updates is the same as the value of the updatesOutput method of the processor.- Throws:
Exception
-
clearImageCache
public void clearImageCache()Clear out state that may confuse subsequent processing -
haveImage
-
processSurvey
Process a particular survey.- Throws:
Exception
-
getSum
public static double getSum(double[] arr) -
doProcessSurvey
- Throws:
Exception
-
postprocessSurvey
- Throws:
Exception
-
createFitsFile
Create the FITS file- Throws:
Exception
-
getImager
Get an Imager object -- normally the last one created.
-