CARMA C++
carma::observertools Namespace Reference

The observertools subsystem is comprised of the project database manager, which stores all relevant meta data used to plan, carry out observations of, and track the progress of projects as they are observed by the array. More...

Classes

struct  Calibrator
 Calibrator data. More...
 
struct  Correlator
 Correlator setup. More...
 
struct  Investigator
 Investigator data. More...
 
struct  ItemValue
 Item name and its value. More...
 
struct  Obsblock
 Obsblock data. More...
 
struct  Project
 Project data. More...
 
exception  ProjectDatabaseException
 An exception for an error in the database Usage example: More...
 
interface  ProjectDatabaseManager
 The interface to the CARMA Project Database Manager. More...
 
struct  ProjectId
 Structure containing a project obsblock, subobsblock strings and trial number. More...
 
struct  Source
 Source data structure. More...
 
struct  SubObsblock
 Sub-obsblock data. More...
 
struct  Target
 Target Molecule Data. More...
 
struct  Trial
 Trial data. More...
 
struct  Window
 Correlator Spectral Window Data. More...
 

Typedefs

typedef sequence< CalibratorCalibratorSequence
 Sequence of calibrators. More...
 
typedef sequence< CorrelatorCorrelatorSequence
 Sequence of Correalator setups. More...
 
typedef sequence< double > doubleSequence
 Sequence of doubles. More...
 
typedef std::map< int,
std::string > 
EnumStringMap
 
typedef sequence< InvestigatorInvestigatorSequence
 Sequence of investigators. More...
 
typedef sequence< ItemValueItemValueSequence
 Sequence of an Item name and value pairs. More...
 
typedef sequence< ObsblockObsblockSequence
 Sequence of obsblocks. More...
 
typedef boost::shared_ptr
< PDB_Monitor > 
PDB_Monitor_Ptr
 
typedef sequence< ProjectProjectSequence
 Sequence of projects. More...
 
typedef sequence< short > shortSequence
 Sequence of shorts. More...
 
typedef sequence< SourceSourceSequence
 Sequence of sources. More...
 
typedef std::map< std::string,
int > 
StringEnumMap
 
typedef sequence< string > StringSequence
 Sequence of strings. More...
 
typedef sequence< SubObsblockSubObsblockSequence
 Sequence of subobsblocks. More...
 
typedef sequence< TargetTargetSequence
 Sequence of targets. More...
 
typedef sequence< TrialTrialSequence
 Sequence of trials. More...
 
typedef sequence< WindowWindowSequence
 Sequence of windows. More...
 

Enumerations

enum  EditStatus {
  ESTATUS_EDIT, ESTATUS_ADD, ESTATUS_DELETE, ESTATUS_REPLICATE,
  ESTATUS_RENAME, ESTATUS_APPEND, ESTATUS_REPLACE
}
 Various enumeration constants. More...
 
enum  ObsCategory {
  CATEGORY_GALACTIC, CATEGORY_COMET, CATEGORY_PLANET, CATEGORY_SOLAR,
  CATEGORY_EXTRAGALACTIC, CATEGORY_OTHER, CATEGORY_STELLAR, CATEGORY_HIGH_MASS_STAR_FORM,
  CATEGORY_LOW_MASS_STAR_FORM, CATEGORY_CHEMISTRY_ISM, CATEGORY_GALAXY_DETECTION, CATEGORY_GALAXY_MAPPING,
  CATEGORY_COSMOLOGY, CATEGORY_OTHER_GALACTIC, CATEGORY_OTHER_EXTRAGALACTIC
}
 Enum for observation category. More...
 
enum  ObsLikelihood { LIKELIHOOD_A, LIKELIHOOD_B, LIKELIHOOD_C, LIKELIHOOD_NONE }
 Enum for observation likelihood. More...
 
enum  ObsType {
  TYPE_SINGLEPOL, TYPE_CARMA23, TYPE_DUALPOL, TYPE_FULLPOL,
  TYPE_CARMA15, TYPE_CARMA8, TYPE_PACS, TYPE_MAXSENS_DUALPOL,
  TYPE_MAXSENS_CARMA23, TYPE_MAXSENS_LL, TYPE_NONE, TYPE_PACS_DUALPOL,
  TYPE_PACS_FULLPOL
}
 Enum for observation type. More...
 
enum  ProjectStatus { PSTATUS_COMPLETE, PSTATUS_INCOMPLETE, PSTATUS_RUNNING, PSTATUS_OTHER }
 Enum for project status. More...
 

Functions

void addDatabaseIndexes (const PDB_DB_Params &db)
 
unsigned int checkEntireDatabase (const PDB_DB_Params &db)
 
void checkObsblockObject (const mongo::BSONObj &obj)
 
void checkProjectObject (const mongo::BSONObj &obj)
 
void checkScriptObject (const mongo::BSONObj &obj)
 
void checkSubobsblockObject (const mongo::BSONObj &obj)
 
void checkTrialObject (const mongo::BSONObj &obj)
 
std::vector< ObsblockconvertBSONObsblocks (const std::vector< mongo::BSONObj > &objects)
 
std::vector< ProjectconvertBSONProjects (const std::vector< mongo::BSONObj > &objects)
 
std::vector< SubObsblockconvertBSONSubObsblocks (const std::vector< mongo::BSONObj > &objects)
 
std::vector< TrialconvertBSONTrials (const std::vector< mongo::BSONObj > &objects)
 
std::vector< mongo::BSONObj > convertCORBAObsblocks (const std::vector< Obsblock > &objects)
 
std::vector< mongo::BSONObj > convertCORBAProjects (const std::vector< Project > &objects)
 
std::vector< mongo::BSONObj > convertCORBASubObsblocks (const std::vector< SubObsblock > &objects)
 
std::vector< mongo::BSONObj > convertCORBATrials (const std::vector< Trial > &objects)
 
float convertLetterGradeToNumeric (const std::string &letter)
 Convert a string grade (A+, A, A-, B+, etc.) to a numeric grade (0-100) More...
 
std::string convertNumericGradeToLetter (const float grade)
 Convert a numeric grade (0-100) to a string grade (A+, A, A-, B+, etc.) More...
 
std::string convertXmlToJson (const std::string &xmlContents)
 
void convertXmlToJson (const std::string &xmlContents, const bool pretty, PDB_JSON_Results &results)
 
double decConvert (const std::string &dec)
 
bool documentExists (const DBClientConnectionPtr conn, const std::string &collection, const mongo::BSONObj &query)
 
std::string editStatusToString (const EditStatus action)
 
std::string enumToString (const int value, const EnumStringMap &m)
 
std::string enumToString (const int value, const StringEnumMap &m)
 
mongo::BSONObj generateQueryFromBSONObject (const mongo::BSONObj &obj)
 
std::vector< std::string > getArrayConfigurationVec ()
 
std::vector< std::string > getEnumNames (const StringEnumMap &m)
 
std::vector< std::string > getImgVsSnrVec ()
 
std::string getObjectName (const mongo::BSONObj &obj)
 
StringEnumMap getObsCategoryMap ()
 
StringEnumMap getObsLikelihoodMap ()
 
StringEnumMap getObsTypeMap ()
 
StringEnumMap getProjectStatusMap ()
 
std::vector< std::string > getReceiverBandVec ()
 
EnumStringMap getReverseMap (const StringEnumMap &m)
 
bool identifierIsNone (const std::string &identifier)
 
bool identifierIsNoneOrEmpty (const std::string &identifier)
 
void initializeDatabaseClientDriver ()
 
void itemValueError (const std::string &msg, const ItemValue &iv)
 
std::string itemValueSequenceToString (const ItemValueSequence &seq)
 
std::string itemValueToString (const ItemValue &iv)
 
std::string itemValueVectorToString (const std::vector< ItemValue > &vec)
 
std::string jsonPrettyPrint (const std::string &json)
 
ItemValue makeItemValue (const std::string &n, const std::string &v)
 
std::vector< ProjectmergeCORBAObjects (const CORBA_Object_Merge &merge)
 
ProjectId obsblockIdToProjectId (const std::string &obsblockId)
 
std::string projectIdToObsblockId (const ProjectId &pid)
 
double raConvert (const std::string &ra)
 
std::string readFile (const std::string &filename)
 
void removeFromDatabase (const DBClientConnectionPtr conn, const std::string &collection, const mongo::Query &query)
 
CORBA_Object_Merge splitCORBAObjects (const std::vector< Project > &projects)
 
void writeToDatabase (const DBClientConnectionPtr conn, const std::string &collection, const mongo::Query &query, const mongo::BSONObj &obj)
 

Variables

const string PROJECT_DATABASE_MANAGER_NAME
 

Detailed Description

The observertools subsystem is comprised of the project database manager, which stores all relevant meta data used to plan, carry out observations of, and track the progress of projects as they are observed by the array.

The only class with publicly accessible interfaces is the ProjectDatabaseManager class. It contains methods to query the database, edit the projects in the database, and add and retrieve observing scripts.

See Also
http://www.mmarray.org/project/WP/ObserverTools

Typedef Documentation

Sequence of calibrators.

Definition at line 167 of file ProjectDatabaseManager.idl.

Sequence of Correalator setups.

Definition at line 213 of file ProjectDatabaseManager.idl.

typedef sequence<double> carma::observertools::doubleSequence

Sequence of doubles.

Definition at line 128 of file ProjectDatabaseManager.idl.

Sequence of investigators.

Definition at line 182 of file ProjectDatabaseManager.idl.

Sequence of an Item name and value pairs.

Definition at line 26 of file ItemValue.idl.

Sequence of obsblocks.

Definition at line 335 of file ProjectDatabaseManager.idl.

Sequence of projects.

Definition at line 363 of file ProjectDatabaseManager.idl.

typedef sequence<short> carma::observertools::shortSequence

Sequence of shorts.

Definition at line 123 of file ProjectDatabaseManager.idl.

Sequence of sources.

Definition at line 149 of file ProjectDatabaseManager.idl.

typedef sequence<string> carma::observertools::StringSequence

Sequence of strings.

Definition at line 41 of file ProjectDatabaseManager.idl.

Sequence of subobsblocks.

Definition at line 300 of file ProjectDatabaseManager.idl.

Sequence of targets.

Definition at line 226 of file ProjectDatabaseManager.idl.

Sequence of trials.

Definition at line 279 of file ProjectDatabaseManager.idl.

Sequence of windows.

Definition at line 199 of file ProjectDatabaseManager.idl.

Enumeration Type Documentation

Various enumeration constants.

Enum for editor

Enumerator
ESTATUS_EDIT 

edit the item(s)

ESTATUS_ADD 

add the item(s)

ESTATUS_DELETE 

delete the item(s)

ESTATUS_REPLICATE 

copy the item

ESTATUS_RENAME 

rename the item

ESTATUS_APPEND 

for observer comments only

ESTATUS_REPLACE 

replace

Definition at line 50 of file ProjectDatabaseManager.idl.

Enum for observation category.

Enumerator
CATEGORY_GALACTIC 

source is in the Galaxy

CATEGORY_COMET 

source is a comet

CATEGORY_PLANET 

source is a planet

CATEGORY_SOLAR 

source is the sun

CATEGORY_EXTRAGALACTIC 

source is extragalactic

CATEGORY_OTHER 

misc source

CATEGORY_STELLAR 

source is a star

CATEGORY_HIGH_MASS_STAR_FORM 

source is high mass star forming region

CATEGORY_LOW_MASS_STAR_FORM 

source is low mass star forming region

CATEGORY_CHEMISTRY_ISM 

source is chemistry related

CATEGORY_GALAXY_DETECTION 

source is a galaxy to be detected

CATEGORY_GALAXY_MAPPING 

source is a galaxy for mapping

CATEGORY_COSMOLOGY 

source is cosmological

CATEGORY_OTHER_GALACTIC 

source is misc galactic

CATEGORY_OTHER_EXTRAGALACTIC 

source is misc extragalactic

Definition at line 73 of file ProjectDatabaseManager.idl.

Enum for observation likelihood.

Enumerator
LIKELIHOOD_A 

highest likelihood

LIKELIHOOD_B 

observations possible

LIKELIHOOD_C 

observations not likely

LIKELIHOOD_NONE 

unknown

Definition at line 113 of file ProjectDatabaseManager.idl.

Enum for observation type.

Enumerator
TYPE_SINGLEPOL 

Single polarization observations.

TYPE_CARMA23 

CARMA 23 observations.

TYPE_DUALPOL 

dual polarization observations

TYPE_FULLPOL 

full polarization observations

TYPE_CARMA15 

CARMA 15 observations.

TYPE_CARMA8 

CARMA 8 observations.

TYPE_PACS 

PACS observations.

TYPE_MAXSENS_DUALPOL 

maximum sinsitivity observations

TYPE_MAXSENS_CARMA23 

maximum sinsitivity observations

TYPE_MAXSENS_LL 

maximum sinsitivity observations

Definition at line 94 of file ProjectDatabaseManager.idl.

Enum for project status.

Enumerator
PSTATUS_COMPLETE 

Project/obsblock/trial is done.

PSTATUS_INCOMPLETE 

Project/obsblock/trial still has observable time.

PSTATUS_RUNNING 

trial has been run/is running

Definition at line 63 of file ProjectDatabaseManager.idl.

Function Documentation

float carma::observertools::convertLetterGradeToNumeric ( const std::string &  letter)

Convert a string grade (A+, A, A-, B+, etc.) to a numeric grade (0-100)

Parameters
letterthe input string grade
std::string carma::observertools::convertNumericGradeToLetter ( const float  grade)

Convert a numeric grade (0-100) to a string grade (A+, A, A-, B+, etc.)

Parameters
gradethe input numeric grade
Exceptions
UserExceptionif grade < 0 || grade > 100
ProjectId carma::observertools::obsblockIdToProjectId ( const std::string &  obsblockId)
Returns
ProjectId structure containing info from input obsblockID
Parameters
validobsblockId in form project.obsblock[.subobsblock].trial
std::string carma::observertools::projectIdToObsblockId ( const ProjectId &  pid)
Returns
obsblockId string from ProjectId structure

Variable Documentation

const string carma::observertools::PROJECT_DATABASE_MANAGER_NAME
Initial value:
=
"carma.projectDatabaseManager.projectDatabaseManagerControl"

Definition at line 20 of file ProjectDatabaseManager.idl.