ImageSet¶
-
class
wwt_data_formats.imageset.
ImageSet
(**kwargs)[source]¶ Bases:
wwt_data_formats.LockedXmlTraits
,wwt_data_formats.abcs.UrlContainer
A set of images.
Attributes Summary
The bandpass of the image data.
The angular scale of the image.
The level of the highest (coarsest-resolution) tiling available.
TBD.
The horizontal location of the center of the image’s projection coordinate system.
The vertical location of the center of the image’s projection coordinate system.
Textual credits for the image originator.
A URL giving the source of the image or more information about its creation.
The renderer mode to which these data apply.
The URL of the DEM data.
A textual description of the imagery.
TBD.
The extension of the image file(s) in this set, including a leading period.
TBD.
TBD.
The ID number of the WWT Community that this content came from.
The ID number of this content item on the WWT Communities system.
A name used to refer to this imageset.
The horizontal positioning of the image relative to its projection coordinate system.
The vertical positioning of the image relative to its projection coordinate system.
TBD.
The type of projection used to place this image on the sky.
TBD.
TBD.
The rotation of image’s projection coordinate system, in degrees.
TBD.
TBD.
A URL to a standard WWT thumbnail representation of this imageset.
The number of levels of tiling.
The URL of the image data.
This is a legacy parameter.
Methods Summary
set_position_from_wcs
(headers, width, height)Set the positional information associated with this imageset to match a set of WCS headers.
Compute a set of WCS headers for this ImageSet’s positional information.
Attributes Documentation
-
band_pass
¶ The bandpass of the image data.
-
base_degrees_per_tile
¶ The angular scale of the image.
For untiled images, should be the pixel scale: the number of degrees per pixel in the vertical direction. Non-square pixels are not supported.
For tiled images, this is the height of the image with its dimensions padded out to the next largest power of 2 for tiling purposes. If a square image is 1200 pixels tall and has a height of 0.016 deg, the padded height would be 2048 pixels and this parameter should be set to 0.016 * 2048 / 1200 = 0.0273.
-
base_tile_level
¶ The level of the highest (coarsest-resolution) tiling available.
This should be zero except for special circumstances.
-
bottoms_up
¶ TBD.
-
center_x
¶ The horizontal location of the center of the image’s projection coordinate system.
For sky images, this is a right ascension in degrees.
-
center_y
¶ The vertical location of the center of the image’s projection coordinate system.
For sky images, this is a declination in degrees.
-
credits
¶ Textual credits for the image originator.
-
credits_url
¶ A URL giving the source of the image or more information about its creation.
-
data_set_type
¶ The renderer mode to which these data apply.
Possible values are
"Earth"
,"Planet"
,"Sky"
,"Panorama"
,"SolarSystem"
, and"Sandbox"
.
-
dem_url
¶ The URL of the DEM data.
Either a URL or a URL template. TODO: details
-
description
¶ A textual description of the imagery.
-
elevation_model
¶ TBD.
-
file_type
¶ The extension of the image file(s) in this set, including a leading period.
-
generic
¶ TBD.
-
mean_radius
¶ TBD.
-
msr_community_id
¶ The ID number of the WWT Community that this content came from.
-
msr_component_id
¶ The ID number of this content item on the WWT Communities system.
-
name
¶ A name used to refer to this imageset.
Various parts of the WWT internals reference imagesets by this name, so it should be distinctive.
-
offset_x
¶ The horizontal positioning of the image relative to its projection coordinate system.
For untiled sky images, the image is by default positioned such that its lower left lands at the center of the projection coordinate system (namely,
center_x
andcenter_y
). The offset is measured in pixels and moves the image leftwards. Therefore,offset_x = image_width / 2
places the center of the image atcenter_x
. This parameter is therefore analogous to the WCS keywordCRVAL1
.For tiled sky images, the offset is measured in degrees, and a value of zero means that the center of the image lands at the center of the projection coordinate system.
-
offset_y
¶ The vertical positioning of the image relative to its projection coordinate system.
For untiled sky images, the image is by default positioned such that its lower left lands at the center of the projection coordinate system (namely,
center_x
andcenter_y
). The offset is measured in pixels and moves the image downwards. Therefore,offset_y = image_height / 2
places the center of the image atcenter_y
. This parameter is therefore analogous to the WCS keywordCRVAL2
.For tiled sky images, the offset is measured in degrees, and a value of zero means that the center of the image lands at the center of the projection coordinate system.
-
permission
¶ TBD.
-
projection
¶ The type of projection used to place this image on the sky.
For untiled images, this should be “SkyImage”. For tiled images, it should be “Tan”. The
set_position_from_wcs()
method will set this value appropriately based ontile_levels
.
-
quad_tree_map
¶ TBD.
-
reference_frame
¶ TBD.
-
rotation_deg
¶ The rotation of image’s projection coordinate system, in degrees.
For sky images, this is East from North, i.e. counterclockwise.
-
sparse
¶ TBD.
-
stock_set
¶ TBD.
-
thumbnail_url
¶ A URL to a standard WWT thumbnail representation of this imageset.
-
tile_levels
¶ The number of levels of tiling.
Should be zero for untiled images. An image with
tile_levels = 1
has been broken into four tiles, each 256x256 pixels. Fortile_levels = 2
, there are sixteen tiles, and the padded height of the tiled area is256 * 2**2 = 1024
pixels. Image with dimensions of 2048 pixels or smaller do not need to be tiled, so if this parameter is nonzero it will usually be 4 or larger.
-
url
¶ The URL of the image data.
Either a URL or a URL template. TODO: details
-
width_factor
¶ This is a legacy parameter. Leave it at 2.
Methods Documentation
-
set_position_from_wcs
(headers, width, height, place=None, fov_factor=1.7)[source]¶ Set the positional information associated with this imageset to match a set of WCS headers.
- Parameters
- headers
Header
or string-keyed dict-like A set of FITS-like headers including WCS keywords such as
CRVAL1
.- widthpositive integer
The width of the image associated with the WCS, in pixels.
- heightpositive integer
The height of the image associated with the WCS, in pixels.
- placeoptional
Place
If specified, the centering and zoom level of the
Place
object will be set to match the center and size of this image.- fov_factoroptional float
If place is provided, its zoom level will be set so that the angular height of the client viewport is this factor times the angular height of the image. The default is 1.7.
- headers
- Returns
- self
For convenience in chaining function calls.
Notes
Certain of the ImageSet parameters take on different meanings depending on whether the image in question is a tiled “study” or not. This method will alter its behavior depending on whether the
tile_levels
attribute is greater than zero. If you are computing coordinates for a tiled study, make sure to set this parameter before calling this function.For the time being, the WCS must be equatorial using the gnomonic (
TAN
) projection.Required keywords in headers are:
CTYPE1
andCTYPE2
CRVAL1
andCRVAL2
CRPIX1
andCRPIX2
Either: -
CDELT1
,CDELT2
,PC1_1
, andPC1_2
; or -CD1_1
,CD2_2
If present
PC1_2
,PC2_1
,CD1_2
, and/orCD2_1
are used. If absent, they are assumed to be zero.
-
wcs_headers_from_position
()[source]¶ Compute a set of WCS headers for this ImageSet’s positional information.
- Returns
- A string-keyed dict-like containing FITS/WCS header keywords such as
CTYPE1
,CRPIX1
, etc.
Notes
At the moment, this function only works for ImageSets with a projection type of
SKY_IMAGE
. Support for other projections might be added later, if the need arises..
-