My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::NedReader Class Reference
Inheritance diagram for gcp::util::NedReader:
gcp::util::PtSrcReader

Classes

struct  Catalog
 
struct  Obj
 

Public Types

enum  { ANY, ALL, NOT, NON }
 
enum  { CLASSIFIED_EXTRAGALACTIC = 0x1, UNCLASSIFIED_EXTRAGALACTIC = 0x2, GALAXY_COMPONENT = 0x4, TYPE_ALL = CLASSIFIED_EXTRAGALACTIC | UNCLASSIFIED_EXTRAGALACTIC | GALAXY_COMPONENT }
 
enum  {
  OBJ_NONE = 0x0, OBJ_ALL = 0xFFFFFFFF, GALAXY = 0x1, GALAXY_PAIR = 0x2,
  GALAXY_TRIPLET = 0x4, GALAXY_GROUP = 0x8, GALAXY_CLUSTER = 0x10, QSO = 0x20,
  QSO_GROUP = 0x40, GRAV_LENS = 0x80, DAMPED_LYMAN_ALPHA = 0x100, ABSORB_LINE_SYSTEM = 0x200,
  EMISSION_LINE_SRC = 0x400, RADIO_SRC = 0x800, SUBMM_SRC = 0x1000, IR_SRC = 0x2000,
  VISUAL_SRC = 0x4000, UV_EXCESS_SRC = 0x8000, XRAY_SRC = 0x10000, GAMMARAY_SRC = 0x20000,
  SUPERNOVA = 0x40000, HII_REGION = 0x80000, PLANETARY_NEBULA = 0x100000, SUPERNOVA_REMNANT = 0x200000
}
 
enum  { CAT_ONE = 0x1, CAT_TWO = 0x2, CAT_THREE = 0x4, CAT_FOUR = 0x8 }
 
enum  {
  CAT_NONE = 0x0, CAT_ALL = 0xFFFFFFFF, CAT_ABELL = 0x1, CAT_NGC = 0x2,
  CAT_3C = 0x4, CAT_4C = 0x8, CAT_5C = 0x10, CAT_6C = 0x20,
  CAT_7C = 0x40, CAT_8C = 0x80, CAT_9C = 0x100, CAT_87GB = 0x200,
  CAT_XMM = 0x400, CAT_WARP = 0x800, CAT_WMAP = 0x1000, CAT_MG = 0x2000,
  CAT_MG1 = 0x4000, CAT_MG2 = 0x8000, CAT_MG4 = 0x10000, CAT_MG3 = 0x20000,
  CAT_MESSIER = 0x40000, CAT_MACS = 0x80000, CAT_SCUBA =0x100000
}
 
enum  { ERROR_ARGS = 1, ERROR_CURL_INIT = 2 }
 
enum  { OPTION_FALSE = 0, OPTION_TRUE = 1 }
 
enum  { FLAG_DEFAULT = 0 }
 

Public Member Functions

void initializeResponseParse ()
 
bool atEndOfResponse ()
 
PtSrcReader::Source readNextSourceFromResponse ()
 
void openCatalogFile ()
 
void closeCatalogFile ()
 
PtSrcReader::Source readNextEntry ()
 
bool eof ()
 
void applyCorrections (PtSrcReader::Source &src)
 
void setRaRange (HourAngle &ra, Declination &dec, Angle &radius)
 
 NedReader ()
 
virtual ~NedReader ()
 
void getUrl (std::string url)
 
unsigned short objIdToNedId (unsigned short id)
 
unsigned short catIdToNedId (unsigned short id)
 
void constructNearPositionSearchUrl (std::ostringstream &os, HourAngle ra, Declination dec, Angle radius, unsigned objIncMask, unsigned objExcMask, unsigned catMask, unsigned objSel, unsigned catSel)
 
void maskObject (std::string name, unsigned &mask)
 
void includeObjects (std::ostringstream &os, unsigned mask)
 
void excludeObjects (std::ostringstream &os, unsigned mask)
 
void addToObjectIncludeMask (unsigned mask)
 
void addToObjectExcludeMask (unsigned mask)
 
void setObjectIncludeMask (unsigned mask)
 
void setObjectExcludeMask (unsigned mask)
 
void clearObjectIncludeMask ()
 
void clearObjectExcludeMask ()
 
void matchAny (std::ostringstream &os)
 
void matchAll (std::ostringstream &os)
 
void maskCatalog (std::string name, unsigned &mask)
 
void selectCatalogs (std::ostringstream &os, unsigned mask)
 
void addToCatalogMask (unsigned mask)
 
void setCatalogMask (unsigned mask)
 
void clearCatalogMask ()
 
void setObjectSelection (unsigned type)
 
void setCatalogSelection (unsigned type)
 
PtSrcReader::Source parseSource (std::string line)
 
void removeDuplicates ()
 
void listSources ()
 
std::vector< std::string > listObjects (unsigned short id)
 
std::vector< std::string > listCatalogs ()
 
- Public Member Functions inherited from gcp::util::PtSrcReader
 PtSrcReader (std::string catalogFile)
 
 PtSrcReader ()
 
void initialize ()
 
virtual ~PtSrcReader ()
 
void setCatalogFile (std::string catalogFile)
 
std::vector< PtSrcReader::SourcefindSources (HourAngle ra, Declination dec, Angle radius, Flux fMin=minFlux_, Flux fMax=maxFlux_, bool doPrint=true)
 
unsigned countSources (HourAngle ra, Declination dec, Angle radius, Flux fMin=minFlux_, Flux fMax=maxFlux_)
 
void indexSources ()
 
bool checkAngle (PtSrcReader::Source &src, HourAngle &ra, Declination &dec, Angle &radius)
 
void printHeader (std::ostream &os)
 

Static Public Member Functions

static std::vector< ObjinitObjects ()
 
static std::vector< CataloginitCatalogs ()
 
static size_t handle_data (void *buffer, size_t size, size_t nmemb, void *userp)
 

Public Attributes

std::string::size_type start_
 
std::string::size_type stop_
 
std::ostringstream lastRead_
 
std::list< PtSrcReader::Sourcesrcs_
 
std::list< PtSrcReader::Source >
::iterator 
srcIter_
 
unsigned objIncMask_
 
unsigned objExcMask_
 
unsigned catMask_
 
unsigned objSel_
 
unsigned catSel_
 
- Public Attributes inherited from gcp::util::PtSrcReader
HourAngle raMin_
 
HourAngle raMax_
 

Static Public Attributes

static std::vector< Objobjects_ = NedReader::initObjects()
 
static std::vector< Catalogcatalogs_ = NedReader::initCatalogs()
 
- Static Public Attributes inherited from gcp::util::PtSrcReader
static Flux minFlux_
 
static Flux maxFlux_
 

Additional Inherited Members

- Protected Member Functions inherited from gcp::util::PtSrcReader
void throwCfitsioError (int status)
 
- Protected Attributes inherited from gcp::util::PtSrcReader
std::string catalogFile_
 
long sourceIndices_ [25]
 
unsigned nSrc_
 

Constructor & Destructor Documentation

NedReader::NedReader ( )

Constructor.

....................................................................... Constructor.

NedReader::~NedReader ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

void NedReader::constructNearPositionSearchUrl ( std::ostringstream &  os,
HourAngle  ra,
Declination  dec,
Angle  radius,
unsigned  objIncMask,
unsigned  objExcMask,
unsigned  catMask,
unsigned  objSel,
unsigned  catSel 
)

....................................................................... Construct a valid NED URL for searching near a specified position.

bool NedReader::eof ( )
virtual

....................................................................... Return true when we are at the end of the list of sources

Implements gcp::util::PtSrcReader.

void NedReader::excludeObjects ( std::ostringstream &  os,
unsigned  mask 
)

....................................................................... Exclude object types

void NedReader::getUrl ( std::string  url)

....................................................................... Get a URL

void NedReader::includeObjects ( std::ostringstream &  os,
unsigned  mask 
)

....................................................................... Add object types

std::vector< NedReader::Catalog > NedReader::initCatalogs ( )
static

....................................................................... Static member initialization

void NedReader::initializeResponseParse ( )

....................................................................... Methods for parsing the response from the NED database server

std::vector< NedReader::Obj > NedReader::initObjects ( )
static

....................................................................... Static member initialization

void NedReader::maskCatalog ( std::string  name,
unsigned &  mask 
)

....................................................................... Add an catalog to a mask

void NedReader::maskObject ( std::string  name,
unsigned &  mask 
)

....................................................................... Add an object to a mask

void NedReader::openCatalogFile ( )
virtual

....................................................................... Initialize the source iterator to the head of the list

Implements gcp::util::PtSrcReader.

PtSrcReader::Source NedReader::parseSource ( std::string  line)

....................................................................... Interpret source information from the tab-separated NED return format

PtSrcReader::Source NedReader::readNextEntry ( )
virtual

....................................................................... Parse the next source entry

Implements gcp::util::PtSrcReader.

PtSrcReader::Source NedReader::readNextSourceFromResponse ( )

....................................................................... Parse the next source entry

void NedReader::selectCatalogs ( std::ostringstream &  os,
unsigned  mask 
)

....................................................................... Add catalog types

void NedReader::setRaRange ( HourAngle ra,
Declination dec,
Angle totalRadius 
)
virtual

....................................................................... Calculate the minimal RA range we need to search

Reimplemented from gcp::util::PtSrcReader.


The documentation for this class was generated from the following files: