SVOFilters
SVOFilters provides a Julia interface for the Spanish Virtual Observatory's Filter Profile Service (SVO FPS).
API
SVOFilters.get_filter_list
— Functionget_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 NumbersWavelengthMean
: Tuple of NumbersWavelengthEff
: Tuple of NumbersWavelengthMin
: Tuple of NumbersWavelengthMax
: Tuple of NumbersWidthEff
: Tuple of NumbersFWHM
: Tuple of NumbersInstrument
: StringFacility
: StringPhotSystem
: 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 withUnitful
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
SVOFilters.get_transmission_data
— Functionget_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 withUnitful
units, which is the case for theWavelength
file=nothing
: file to which the downloaded transmission data fromdownload_filter_data_file
should be saved, or if the file already exists, can be directly read from it without downloading the file againoverwrite=false
: iftrue
, the file is downloaded regardless of whetherisfile(file)
is truemagsys=:AB
: magnitude system passed todownload_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")
SVOFilters.get_filter_data
— Functionget_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 withUnitful
unitsfile=nothing
: file to which the downloaded filter data fromdownload_filter_data_file
should be saved, or if the file already exists, can be directly read from it without downloading the file againoverwrite=false
: iftrue
, the file is downloaded regardless of whetherisfile(file)
is truemagsys=:AB
: magnitude system passed todownload_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 theVERB
parameter passed todownload_filter_data_file
. Ifnothing
, it is set to 2 ifmagsys=:AB
and otherwise to 0.verb=0
won't include the transmission curve or parameter descriptions,verb=1
does include the descriptions, andverb=2
includes the descriptions and the transmission curve.descriptions=true
: whether to include the description keys (assumingverb
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"
SVOFilters.download_filter_data_file
— Functiondownload_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 theVERB
parameter. Ifnothing
, it is set to 2 ifmagsys=:AB
and otherwise to 0.verb=0
won't include the transmission curve or parameter descriptions,verb=1
does include the descriptions, andverb=2
includes the descriptions and the transmission curve.file=nothing
: file path to save the downloaded file to. Ifnothing
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.
SVOFilters.get_metadata
— Functionget_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 usingget_filter_list
unit
:Unitful
unit of the parameterdatatype
:Type
of the parameterdescription
: description of the parametervalues
: 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.