NAPISD
PAHdb website C++ backend
Loading...
Searching...
No Matches
FileInput.h
1#ifndef FILEINPUT_H_
2#define FILEINPUT_H_
3
4#include "Exception.h"
5#include <CCfits/CCfits>
6#include <fstream>
7#include <memory>
8#include <string>
9#include <string_view>
10#include <tinyxml2.h>
11#include <tuple>
12#include <vector>
13
14class FileInput {
15
16public:
17 enum class Filetype : char { ASCII, YAAAR, VOTABLE, GUESS };
18
19 FileInput(std::string_view filename);
20
21 void setFilename(std::string_view filename);
22
23 std::string_view getFilename() const;
24
25 std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
26 readFileFromDisk(Filetype filetype = Filetype::GUESS);
27
28 std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
29 readASCIIFileFromDisk();
30
31 std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
32 readYAAARFileFromDisk();
33
34 std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
35 readVOTableFileFromDisk();
36
37 std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
38 readGuessedFileFromDisk();
39
40private:
41 std::string _filename;
42};
43
44inline void FileInput::setFilename(const std::string_view filename) {
45 _filename = filename;
46}
47
48inline std::string_view FileInput::getFilename() const { return (_filename); }
49
50#endif /* FILEINPUT_H_ */

Since FY2019 the NASA Ames PAH IR Spectroscopic Database is being supported through a directed Work Package at NASA Ames titled: "Laboratory Astrophysics - The NASA Ames PAH IR Spectroscopic Database".
Since FY2023 the NASA Ames PAH IR Spectroscopic Database is being supported through the Laboratory Astrophysics Rd 2 directed Work Package at NASA Ames.
© Copyright 2021-2025, Christiaan Boersma