SVOFilters

SVOFilters provides a Julia interface for the Spanish Virtual Observatory's Filter Profile Service (SVO FPS).

API

SVOFilters.get_filter_listFunction
get_filter_list(; unitful=false, queries...)

Queries the available filters with search parameters and returns the results table of the filters found.

The available search parameters can be found with get_metadata. The following should be available in general:

  • WavelengthRef: Tuple of Numbers
  • WavelengthMean: Tuple of Numbers
  • WavelengthEff: Tuple of Numbers
  • WavelengthMin: Tuple of Numbers
  • WavelengthMax: Tuple of Numbers
  • WidthEff: Tuple of Numbers
  • FWHM: Tuple of Numbers
  • Instrument: String
  • Facility: String
  • PhotSystem: String

The returned table is a DataFrame from the DataFrames package with all the columns of the response VOTable.

The filter information and transmission data can be obtained with get_filter_data and get_transmission_data with the ID obtained from the filterID column.

Keyword Arguments

  • unitful=false: whether to return the values with Unitful units

Examples

df = get_filter_list(; Instrument="BUSCA", WavelengthEff=(1000, 5000))
id = df.filterID[1]
get_transmission_data(id)

# other examples for querying
get_filter_list(; Facility="SLOAN") # all filters from a given facility
get_filter_list(; Instrument="BUSCA", WavelengthEff=(1000u"angstrom", 5000u"angstrom")) # unitful wavelengths
source
SVOFilters.get_transmission_dataFunction
get_transmission_data(id::AbstractString; unitful=false, file=nothing, overwrite=false, magsys=:AB)

Returns a table with the transmission data for the filter with the given id.

The returned table is a DataFrame from the DataFrames package with the columns of the response VOTable, which should be Wavelength and Transmission.

Keyword Arguments

  • unitful=false: whether to return the values with Unitful units, which is the case for the Wavelength
  • file=nothing: file to which the downloaded transmission data from download_filter_data_file should be saved, or if the file already exists, can be directly read from it without downloading the file again
  • overwrite=false: if true, the file is downloaded regardless of whether isfile(file) is true
  • magsys=:AB: magnitude system passed to download_filter_data_file if the file has to be downloaded again, one of :AB, :Vega, or :ST

Examples

df = get_transmission_data("2MASS/2MASS.H")
df.Wavelength
df.Transmission

df = get_transmission_data("2MASS/2MASS.H"; unitful=true, file="/path/to/file/2MASS_H_Vega.xml")
source
SVOFilters.get_filter_dataFunction
get_filter_data(id::AbstractString; unitful=false, file=nothing, overwrite=false, magsys=:AB, verb=nothing, descriptions=true)

Returns an AbstractDict with the data of the filter with the given id.

The keys of the dictionary are taken from the returned VOTable, and descriptions are included under the respective key with a question mark after it.

Keyword Arguments

  • unitful=false: whether to return the values with Unitful units
  • file=nothing: file to which the downloaded filter data from download_filter_data_file should be saved, or if the file already exists, can be directly read from it without downloading the file again
  • overwrite=false: if true, the file is downloaded regardless of whether isfile(file) is true
  • magsys=:AB: magnitude system passed to download_filter_data_file if the file has to be downloaded again, one of :AB, :Vega, or :ST
  • verb=nothing: integer between 0 and 2 for the VERB parameter passed to download_filter_data_file. If nothing, it is set to 2 if magsys=:AB and otherwise to 0. verb=0 won't include the transmission curve or parameter descriptions, verb=1 does include the descriptions, and verb=2 includes the descriptions and the transmission curve.
  • descriptions=true: whether to include the description keys (assuming verb is not 0, in which case descriptions are never returned as they are not included in the file itself)

Examples

d = get_filter_data("2MASS/2MASS.H")
d["WavelengthEff"] == 16620.0
d["WavelengthEff?"] # the description
d["ZeroPoint"] == 3631.0

using Unitful, UnitfulAstro
d = get_filter_data("2MASS/2MASS.H"; unitful=true, file="/path/to/file/2MASS_H_Vega.xml")
d["WavelengthEff"] == 16620.0u"angstrom"
d["ZeroPoint"] == 3631.0u"Jy"
source
SVOFilters.download_filter_data_fileFunction
download_filter_data_file(id::AbstractString; magsys=:AB, verb=nothing, file=nothing)

Downloads the filter data file with the given id and returns the file path.

Downloads the file at http://svo2.cab.inta-csic.es/theory/fps/fps.php?PhotCalID=$id/$magsys.

Keyword Arguments

  • magsys=:AB: magnitude system, one of :AB, :Vega, or :ST
  • verb=nothing: integer between 0 and 2 for the VERB parameter. If nothing, it is set to 2 if magsys=:AB and otherwise to 0. verb=0 won't include the transmission curve or parameter descriptions, verb=1 does include the descriptions, and verb=2 includes the descriptions and the transmission curve.
  • file=nothing: file path to save the downloaded file to. If nothing it is saved to a temporary file.

Examples

file = SVOFilters.download_filter_data_file("2MASS/2MASS.H")

file = SVOFilters.download_filter_data_file("2MASS/2MASS.H"; magsys=:Vega, file="/file/path/2MASS_H_Vega.xml")

This is not exported.

source
SVOFilters.get_metadataFunction
get_metadata(; file=nothing)

Returns a table of the available parameters that can be used to query the SVO filter service.

Downloads the FORMAT=metadata VOTable and saves it to file if provided, or to a temporary file if file=nothing. If file already exists, it is overwritten.

The table is a DataFrame from the DataFrames package with the following columns:

  • parameter: parameter name that can be used for queries using get_filter_list
  • unit: Unitful unit of the parameter
  • datatype: Type of the parameter
  • description: description of the parameter
  • values: vector of the possible values that the respective parameter can take on (e.g. for Instrument), or a vector of the minimum and maximum values that the parameter can assume (e.g. for WavelengthEff)

Example

df = SVOFilters.get_metadata()

# get the vector of available facilities
df[findfirst(==("Facility"), df.parameter), :].values

This is not exported.

source