Ejemplo n.º 1
0
def apWave(chip, ext=2, dr=None):
    """
    NAME:
       apWave
    PURPOSE:
       open an apWave file
    INPUT:
       chip - chip 'a', 'b', or 'c'
       ext= (2) extension to read
       dr= return the path corresponding to this data release      
    OUTPUT:
       contents of HDU ext
    HISTORY:
       2015-02-27 - Written - Bovy (IAS)
    """
    filePath = path.apWavePath(chip, dr=dr)
    if not os.path.exists(filePath):
        download.apWave(chip, dr=dr)
    data = fitsio.read(filePath, ext)
    return data
Ejemplo n.º 2
0
def apWave(chip,ext=2,dr=None):
    """
    NAME:
       apWave
    PURPOSE:
       open an apWave file
    INPUT:
       chip - chip 'a', 'b', or 'c'
       ext= (2) extension to read
       dr= return the path corresponding to this data release      
    OUTPUT:
       contents of HDU ext
    HISTORY:
       2015-02-27 - Written - Bovy (IAS)
    """
    filePath= path.apWavePath(chip,dr=dr)
    if not os.path.exists(filePath):
        download.apWave(chip,dr=dr)
    data= fitsio.read(filePath,ext)
    return data
Ejemplo n.º 3
0
def apWave(chip, dr=None):
    """
    NAME:
       apWave
    PURPOSE:
       download an apWave file
    INPUT:
       chip - chip 'a', 'b', or 'c'
       dr= return the path corresponding to this data release      
    OUTPUT:
       (none; just downloads)
    HISTORY:
       2015-02-27 - Written - Bovy (IAS)
    """
    if dr is None: dr = path._default_dr()
    # First make sure the file doesn't exist
    filePath = path.apWavePath(chip, dr=dr)
    if os.path.exists(filePath): return None
    # Create the file path
    downloadPath = filePath.replace(
        os.path.join(path._APOGEE_DATA, _dr_string(dr)), _base_url(dr=dr))
    _download_file(downloadPath, filePath, dr)
    return None
Ejemplo n.º 4
0
def apWave(chip,dr=None):
    """
    NAME:
       apWave
    PURPOSE:
       download an apWave file
    INPUT:
       chip - chip 'a', 'b', or 'c'
       dr= return the path corresponding to this data release      
    OUTPUT:
       (none; just downloads)
    HISTORY:
       2015-02-27 - Written - Bovy (IAS)
    """
    if dr is None: dr= path._default_dr()
    # First make sure the file doesn't exist
    filePath= path.apWavePath(chip,dr=dr)
    if os.path.exists(filePath): return None
    # Create the file path    
    downloadPath= filePath.replace(os.path.join(path._APOGEE_DATA,
                                                _dr_string(dr)),
                                   _base_url(dr=dr))
    _download_file(downloadPath,filePath,dr)
    return None