Wolfram Research

Function Repository Resource:

VizierCatalogData (3.0.0) current version: 3.0.1 »

Source Notebook

Import astronomical data from the VizieR database

Contributed by: Truman Tapia

ResourceFunction["VizierCatalogData"]["keywords"]

queries the VizieR database using keywords and returns all the tables found as one Dataset.

ResourceFunction["VizierCatalogData"]["keywords","prop"]

returns the property "prop" of the catalogues found by the query specified by "keywords".

ResourceFunction["VizierCatalogData"][list]

makes the query using a list of keywords.

ResourceFunction["VizierCatalogData"][list,"prop"]

returns the property "prop" of the catalogues found using a list of keywords.

Details and Options

ResourceFunction["VizierCatalogData"] retrieves data from VizieR using ASU.
ResourceFunction["VizierCatalogData"] has the following properties:
"Data"actual data of the catalogs
"ColumnList"List of all the columns
"ColumnDescription"Dataset describing the columns
"Title"titles of the catalogs
"CatalogSize"number of rows of the catalogs
"Metadata"Dataset showing the metadata
ResourceFunction["VizierCatalogData"] has the following options:
MaxItems50an Integer specifying the maximun number of rows in each table
"Columns""Default"List containing the columns to retrieve, or All to get all columns of a catalog
"Filter"Nonea Select operator specifying a filter to apply in the query
"DataSource""France"origin of the data
"AstroCenter"Automaticcenter of sky region
"AstroRange"Allrange of sky region
"AstroCenter" can be specified through Entity, keywords, or {ra,dec}.
"AstroRange" takes the following settings:
rexplicit radius of a circle
{r1,r2}inner and outer radius of an annulus
{{ra1,ra2},{dec1,dec2}}explicit limit for right ascension and declination
Angles in "AstroCenter" and "AstroRange" values can be numbers or Quantities. Numbers are interpreted as degrees.
ResourceFunction["VizierCatalogData"]["DataSource"] displays the supported values of the option "DataSource". Some data sources may fail to return the expected number of rows in certain cases.
"Filter" option supports only a small portion of the Select functionality (See the Options and Possible Issues sections).
The following modifiers can be used in ResourceFunction["VizierCatalogData"][,prop,"modifier"]:
"Dataset"a dataset with table names as keys and lists of associations as values
"Association"an association with table names as keys and lists of associations as values
"RawData"an association with table names as keys and lists as values
"Dataset" and "Association" modifers translate VizieR units to Wolfram units and use Quantity in the result.

Examples

Basic Examples (2) 

Get the catalogues that match with the keyword Hipparcos:

In[1]:=
ResourceFunction["VizierCatalogData"]["Hipparcos"]
Out[1]=

Get just the first table of the last query with 200 rows:

In[2]:=
ResourceFunction["VizierCatalogData"]["I/239/hip_main", MaxItems -> 200]
Out[2]=

Scope (3) 

Get the metadata of the Fifth Fundamental Catalog using its table name "I/149A/catalog":

In[3]:=
ResourceFunction["VizierCatalogData"]["I/149A/catalog", "Metadata"]
Out[3]=

Get the whole catalog:

In[4]:=
ResourceFunction["VizierCatalogData"]["I/149A/catalog", "Data", MaxItems -> All, "Columns" -> All]
Out[4]=

Or equivalently using just the one argument function:

In[5]:=
fk5 = ResourceFunction["VizierCatalogData"]["I/149A/catalog", MaxItems -> All, "Columns" -> All]
Out[5]=

Using "RawData" as the data modifier can reduce the memory consumption:

In[6]:=
rawfk5 = ResourceFunction["VizierCatalogData"]["I/149A/catalog", "Data", "RawData", MaxItems -> All, "Columns" -> All]
Out[6]=

See memory consumption:

In[7]:=
{ByteCount[fk5], ByteCount[rawfk5]}
Out[7]=

VizieR does not return all the columns in a catalog by default:

In[8]:=
Dimensions[
 Values@ResourceFunction["VizierCatalogData"]["I/149A/catalog", "RawData", MaxItems -> 1, "Columns" -> "Default"]]
Out[8]=

To get all the columns in a catalog use "Columns"All:

In[9]:=
Dimensions[
 Values@ResourceFunction["VizierCatalogData"]["I/149A/catalog", "RawData", MaxItems -> 1, "Columns" -> All]]
Out[9]=

Calculate the time to get data from the VizieR mirror in Russia:

In[10]:=
First@AbsoluteTiming[
  ResourceFunction["VizierCatalogData"]["I/149A/catalog", "RawData", MaxItems -> All, "Columns" -> All, "DataSource" -> "Russia"]]
Out[10]=

Using a different mirror can safe time:

In[11]:=
First@AbsoluteTiming[
  ResourceFunction["VizierCatalogData"]["I/149A/catalog", "RawData", MaxItems -> All, "Columns" -> All, "DataSource" -> "US"]]
Out[11]=

Options (11) 

DataSource (1) 

Get data from the VizieR mirror in China:

In[12]:=
ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "DataSource" -> "China"]
Out[12]=

MaxItems (1) 

Get the first 5 rows of a catalog:

In[13]:=
ResourceFunction["VizierCatalogData"]["J/ApJ/799/95/table8", MaxItems -> 5]
Out[13]=

Columns (2) 

Get the list of columns of a catalog:

In[14]:=
ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "ColumnList"]
Out[14]=

Get specific columns from the catalog:

In[15]:=
ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "Columns" -> {"RA_ICRS", "DE_ICRS"}]
Out[15]=

Filter (4) 

Data in tables can be filtered using the operator form of Select. For example, apply a filter in the "Plx" column of the table "I/350/gaiaedr3":

In[16]:=
query1 = ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "Filter" -> Select[.5 < #Plx < 1 &], MaxItems -> 1000]
Out[16]=

Test the filter:

In[17]:=
query1[1, All /* MinMax, "Plx"]
Out[17]=

Select the rows with non-missing value in the column "RVDR2":

In[18]:=
ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "Filter" -> Select[#RVDR2 =!= Missing[] &], "Columns" -> {"RVDR2"}]
Out[18]=

Apply a filter in several columns at a time:

In[19]:=
query2 = ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "Filter" -> Select[.5 <= #Plx <= 1 && Slot["e_Plx"] <= 0.3 &], MaxItems -> 1000]
Out[19]=

Test the filter:

In[20]:=
query2[1, All /* MinMax, "Plx"]
Out[20]=
In[21]:=
query2[1, All /* Max, "e_Plx"]
Out[21]=

Apply a filter on string values:

In[22]:=
ResourceFunction["VizierCatalogData"]["I/345/ssoorb", "Filter" -> Select[#Name === "europa" &]]
Out[22]=

AstroCenter (1) 

Get the objects of the table "I/350/gaiaedr3" within a circle centered at the position of and a radius :

In[23]:=
ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "AstroCenter" -> Entity["Star", "HIP5054"], "AstroRange" -> Quantity[20, "ArcMinutes"], MaxItems -> 1000]
Out[23]=

AstroRange (2) 

Get the objects of the table "I/350/gaiaedr3" within an annulus centered at the origin of the equatorial coordinates with inner radius of and outer radius of :

In[24]:=
ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "AstroCenter" -> {0, 0}, "AstroRange" -> {Quantity[10, "ArcMinutes"], Quantity[20, "ArcMinutes"]}, MaxItems -> 1000]
Out[24]=

Get the objects of the table "I/350/gaiaedr3" inside a rectangle with limits in right ascension {,} and {,} in declination:

In[25]:=
ResourceFunction["VizierCatalogData"]["I/350/gaiaedr3", "AstroRange" -> {{Quantity["AngularDegrees"], 2}, {Quantity[0, "ArcMinutes"], Quantity[-30, "ArcMinutes"]}}, MaxItems -> 1000]
Out[25]=

Properties & Relations (2) 

Get the Hipparcos number of Rigel star:

In[26]:=
hipNumber = Entity["Star", "Rigel"]["HipparcosNumber"]
Out[26]=

Get information of this star in the original Hipparcos Main Catalog:

In[27]:=
ResourceFunction["VizierCatalogData"]["I/239/hip_main", "Filter" -> Select[#HIP == hipNumber &]]
Out[27]=

Possible Issues (2) 

When no catalog is found, an empty Dataset is returned:

In[28]:=
ResourceFunction["VizierCatalogData"]["invalid123"]
Out[28]=

Only certain Select functions can be translated to VizieR filters. An error message will be returned if the structure of the filter is not supported:

In[29]:=
ResourceFunction["VizierCatalogData", ResourceVersion->"3.0.0"]["I/345/gaia2", "Data", "Dataset", "Filter" -> Select[Slot["RA_ICRS"] > 20 || Slot["DE_ICRS"] > 40 &]]
Out[29]=

Neat Examples (3) 

Get the Cartesian position of the galaxies in the table "J/ApJ/799/95/table8":

In[30]:=
table = ResourceFunction["VizierCatalogData"]["J/ApJ/799/95/table8", "Columns" -> {"X", "Y", "Z"}, MaxItems -> All]
Out[30]=

Transform the redshift units to Mpc in the small redshift approximation:

In[31]:=
convertionFactor = Normal @@ UnitConvert[Quantity[1, ("SpeedOfLight")/("HubbleParameter")], "Megaparsecs"]
Out[31]=
In[32]:=
physicalPositions = table[1, All /* Function[coord, coord*convertionFactor]]
Out[32]=
In[33]:=
xextremes = Normal@physicalPositions[All /* MinMax, "X"]
Out[33]=
In[34]:=
yextremes = Normal@physicalPositions[All /* MinMax, "Y"]
Out[34]=
In[35]:=
zextremes = Normal@physicalPositions[All /* MinMax, "Z"]
Out[35]=

Plot the positions of the galaxies:

In[36]:=
Quiet@ListPointPlot3D[Values@Normal[physicalPositions], BoxRatios -> {1, 1, 1}, AspectRatio -> 1, DataRange -> {{xextremes[[1]], xextremes[[2]]}, {yextremes[[1]], yextremes[[2]]}, {zextremes[[1]], zextremes[[2]]}}, Boxed -> False, Axes -> False]
Out[36]=

Publisher

Truman Tapia

Version History

  • 3.0.1 – 09 June 2023
  • 3.0.0 – 04 October 2021
  • 2.0.0 – 09 February 2021
  • 1.0.0 – 24 November 2020

Source Metadata

Related Resources

License Information