SourceRow.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef SourceRow_CLASS
00035 #define SourceRow_CLASS
00036
00037 #include <vector>
00038 #include <string>
00039 #include <set>
00040
00041 #ifndef WITHOUT_ACS
00042 #include <asdmIDLC.h>
00043 #endif
00044
00045
00046
00047
00048
00049
00050
00051 #include <ArrayTime.h>
00052
00053
00054
00055 #include <AngularRate.h>
00056
00057
00058
00059 #include <Angle.h>
00060
00061
00062
00063 #include <Speed.h>
00064
00065
00066
00067 #include <Flux.h>
00068
00069
00070
00071 #include <Tag.h>
00072
00073
00074
00075 #include <Length.h>
00076
00077
00078
00079 #include <Frequency.h>
00080
00081
00082
00083 #include <ArrayTimeInterval.h>
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102 #include "CDirectionReferenceCode.h"
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 #include "CSourceModel.h"
00127
00128
00129
00130 #include "CFrequencyReferenceCode.h"
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 #include "CStokesParameter.h"
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 #include "CRadialVelocityReferenceCode.h"
00159
00160
00161
00162
00163 #include <ConversionException.h>
00164 #include <NoSuchRow.h>
00165 #include <IllegalAccessException.h>
00166
00167 #include <RowTransformer.h>
00168
00169
00170
00171
00172
00173
00174 namespace asdm {
00175
00176
00177
00178
00179
00180 class SpectralWindowRow;
00181
00182
00183 class SourceRow;
00184 typedef void (SourceRow::*SourceAttributeFromBin) (EndianIStream& eis);
00185 typedef void (SourceRow::*SourceAttributeFromText) (const string& s);
00186
00193 class SourceRow {
00194 friend class asdm::SourceTable;
00195 friend class asdm::RowTransformer<SourceRow>;
00196
00197
00198 public:
00199
00200 virtual ~SourceRow();
00201
00205 SourceTable &getTable() const;
00206
00211 bool isAdded() const;
00212
00214
00216
00217
00218
00219
00220
00221
00222
00223
00228 int getSourceId() const;
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00248 ArrayTimeInterval getTimeInterval() const;
00249
00250
00251
00252
00262 void setTimeInterval (ArrayTimeInterval timeInterval);
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00280 string getCode() const;
00281
00282
00283
00284
00292 void setCode (string code);
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00310 vector<Angle > getDirection() const;
00311
00312
00313
00314
00322 void setDirection (vector<Angle > direction);
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00340 vector<AngularRate > getProperMotion() const;
00341
00342
00343
00344
00352 void setProperMotion (vector<AngularRate > properMotion);
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00370 string getSourceName() const;
00371
00372
00373
00374
00382 void setSourceName (string sourceName);
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00398 bool isDirectionCodeExists() const;
00399
00400
00401
00407 DirectionReferenceCodeMod::DirectionReferenceCode getDirectionCode() const;
00408
00409
00410
00411
00418 void setDirectionCode (DirectionReferenceCodeMod::DirectionReferenceCode directionCode);
00419
00420
00421
00422
00426 void clearDirectionCode ();
00427
00428
00429
00430
00431
00432
00433
00434
00439 bool isDirectionEquinoxExists() const;
00440
00441
00442
00448 ArrayTime getDirectionEquinox() const;
00449
00450
00451
00452
00459 void setDirectionEquinox (ArrayTime directionEquinox);
00460
00461
00462
00463
00467 void clearDirectionEquinox ();
00468
00469
00470
00471
00472
00473
00474
00475
00480 bool isCalibrationGroupExists() const;
00481
00482
00483
00489 int getCalibrationGroup() const;
00490
00491
00492
00493
00500 void setCalibrationGroup (int calibrationGroup);
00501
00502
00503
00504
00508 void clearCalibrationGroup ();
00509
00510
00511
00512
00513
00514
00515
00516
00521 bool isCatalogExists() const;
00522
00523
00524
00530 string getCatalog() const;
00531
00532
00533
00534
00541 void setCatalog (string catalog);
00542
00543
00544
00545
00549 void clearCatalog ();
00550
00551
00552
00553
00554
00555
00556
00557
00562 bool isDeltaVelExists() const;
00563
00564
00565
00571 Speed getDeltaVel() const;
00572
00573
00574
00575
00582 void setDeltaVel (Speed deltaVel);
00583
00584
00585
00586
00590 void clearDeltaVel ();
00591
00592
00593
00594
00595
00596
00597
00598
00603 bool isPositionExists() const;
00604
00605
00606
00612 vector<Length > getPosition() const;
00613
00614
00615
00616
00623 void setPosition (vector<Length > position);
00624
00625
00626
00627
00631 void clearPosition ();
00632
00633
00634
00635
00636
00637
00638
00639
00644 bool isNumLinesExists() const;
00645
00646
00647
00653 int getNumLines() const;
00654
00655
00656
00657
00664 void setNumLines (int numLines);
00665
00666
00667
00668
00672 void clearNumLines ();
00673
00674
00675
00676
00677
00678
00679
00680
00685 bool isTransitionExists() const;
00686
00687
00688
00694 vector<string > getTransition() const;
00695
00696
00697
00698
00705 void setTransition (vector<string > transition);
00706
00707
00708
00709
00713 void clearTransition ();
00714
00715
00716
00717
00718
00719
00720
00721
00726 bool isRestFrequencyExists() const;
00727
00728
00729
00735 vector<Frequency > getRestFrequency() const;
00736
00737
00738
00739
00746 void setRestFrequency (vector<Frequency > restFrequency);
00747
00748
00749
00750
00754 void clearRestFrequency ();
00755
00756
00757
00758
00759
00760
00761
00762
00767 bool isSysVelExists() const;
00768
00769
00770
00776 vector<Speed > getSysVel() const;
00777
00778
00779
00780
00787 void setSysVel (vector<Speed > sysVel);
00788
00789
00790
00791
00795 void clearSysVel ();
00796
00797
00798
00799
00800
00801
00802
00803
00808 bool isRangeVelExists() const;
00809
00810
00811
00817 vector<Speed > getRangeVel() const;
00818
00819
00820
00821
00828 void setRangeVel (vector<Speed > rangeVel);
00829
00830
00831
00832
00836 void clearRangeVel ();
00837
00838
00839
00840
00841
00842
00843
00844
00849 bool isSourceModelExists() const;
00850
00851
00852
00858 SourceModelMod::SourceModel getSourceModel() const;
00859
00860
00861
00862
00869 void setSourceModel (SourceModelMod::SourceModel sourceModel);
00870
00871
00872
00873
00877 void clearSourceModel ();
00878
00879
00880
00881
00882
00883
00884
00885
00890 bool isFrequencyRefCodeExists() const;
00891
00892
00893
00899 FrequencyReferenceCodeMod::FrequencyReferenceCode getFrequencyRefCode() const;
00900
00901
00902
00903
00910 void setFrequencyRefCode (FrequencyReferenceCodeMod::FrequencyReferenceCode frequencyRefCode);
00911
00912
00913
00914
00918 void clearFrequencyRefCode ();
00919
00920
00921
00922
00923
00924
00925
00926
00931 bool isNumFreqExists() const;
00932
00933
00934
00940 int getNumFreq() const;
00941
00942
00943
00944
00951 void setNumFreq (int numFreq);
00952
00953
00954
00955
00959 void clearNumFreq ();
00960
00961
00962
00963
00964
00965
00966
00967
00972 bool isNumStokesExists() const;
00973
00974
00975
00981 int getNumStokes() const;
00982
00983
00984
00985
00992 void setNumStokes (int numStokes);
00993
00994
00995
00996
01000 void clearNumStokes ();
01001
01002
01003
01004
01005
01006
01007
01008
01013 bool isFrequencyExists() const;
01014
01015
01016
01022 vector<Frequency > getFrequency() const;
01023
01024
01025
01026
01033 void setFrequency (vector<Frequency > frequency);
01034
01035
01036
01037
01041 void clearFrequency ();
01042
01043
01044
01045
01046
01047
01048
01049
01054 bool isFrequencyIntervalExists() const;
01055
01056
01057
01063 vector<Frequency > getFrequencyInterval() const;
01064
01065
01066
01067
01074 void setFrequencyInterval (vector<Frequency > frequencyInterval);
01075
01076
01077
01078
01082 void clearFrequencyInterval ();
01083
01084
01085
01086
01087
01088
01089
01090
01095 bool isStokesParameterExists() const;
01096
01097
01098
01104 vector<StokesParameterMod::StokesParameter > getStokesParameter() const;
01105
01106
01107
01108
01115 void setStokesParameter (vector<StokesParameterMod::StokesParameter > stokesParameter);
01116
01117
01118
01119
01123 void clearStokesParameter ();
01124
01125
01126
01127
01128
01129
01130
01131
01136 bool isFluxExists() const;
01137
01138
01139
01145 vector<vector<Flux > > getFlux() const;
01146
01147
01148
01149
01156 void setFlux (vector<vector<Flux > > flux);
01157
01158
01159
01160
01164 void clearFlux ();
01165
01166
01167
01168
01169
01170
01171
01172
01177 bool isFluxErrExists() const;
01178
01179
01180
01186 vector<vector<Flux > > getFluxErr() const;
01187
01188
01189
01190
01197 void setFluxErr (vector<vector<Flux > > fluxErr);
01198
01199
01200
01201
01205 void clearFluxErr ();
01206
01207
01208
01209
01210
01211
01212
01213
01218 bool isPositionAngleExists() const;
01219
01220
01221
01227 vector<Angle > getPositionAngle() const;
01228
01229
01230
01231
01238 void setPositionAngle (vector<Angle > positionAngle);
01239
01240
01241
01242
01246 void clearPositionAngle ();
01247
01248
01249
01250
01251
01252
01253
01254
01259 bool isPositionAngleErrExists() const;
01260
01261
01262
01268 vector<Angle > getPositionAngleErr() const;
01269
01270
01271
01272
01279 void setPositionAngleErr (vector<Angle > positionAngleErr);
01280
01281
01282
01283
01287 void clearPositionAngleErr ();
01288
01289
01290
01291
01292
01293
01294
01295
01300 bool isSizeExists() const;
01301
01302
01303
01309 vector<vector<Angle > > getSize() const;
01310
01311
01312
01313
01320 void setSize (vector<vector<Angle > > size);
01321
01322
01323
01324
01328 void clearSize ();
01329
01330
01331
01332
01333
01334
01335
01336
01341 bool isSizeErrExists() const;
01342
01343
01344
01350 vector<vector<Angle > > getSizeErr() const;
01351
01352
01353
01354
01361 void setSizeErr (vector<vector<Angle > > sizeErr);
01362
01363
01364
01365
01369 void clearSizeErr ();
01370
01371
01372
01373
01374
01375
01376
01377
01382 bool isVelRefCodeExists() const;
01383
01384
01385
01391 RadialVelocityReferenceCodeMod::RadialVelocityReferenceCode getVelRefCode() const;
01392
01393
01394
01395
01402 void setVelRefCode (RadialVelocityReferenceCodeMod::RadialVelocityReferenceCode velRefCode);
01403
01404
01405
01406
01410 void clearVelRefCode ();
01411
01412
01413
01415
01417
01418
01419
01420
01421
01422
01423
01424
01429 Tag getSpectralWindowId() const;
01430
01431
01432
01433
01443 void setSpectralWindowId (Tag spectralWindowId);
01444
01445
01446
01447
01448
01449
01451
01453
01454
01455
01456
01457
01464 SpectralWindowRow* getSpectralWindowUsingSpectralWindowId();
01465
01466
01467
01468
01469
01470
01471
01489 bool compareNoAutoInc(ArrayTimeInterval timeInterval, Tag spectralWindowId, string code, vector<Angle > direction, vector<AngularRate > properMotion, string sourceName);
01490
01491
01492
01493
01507 bool compareRequiredValue(string code, vector<Angle > direction, vector<AngularRate > properMotion, string sourceName);
01508
01509
01518 bool equalByRequiredValue(SourceRow* x) ;
01519
01520 #ifndef WITHOUT_ACS
01521
01525 asdmIDL::SourceRowIDL *toIDL() const;
01526
01534 void toIDL(asdmIDL::SourceRowIDL& x) const;
01535 #endif
01536
01537 #ifndef WITHOUT_ACS
01538
01543 void setFromIDL (asdmIDL::SourceRowIDL x) ;
01544 #endif
01545
01550 std::string toXML() const;
01551
01558 void setFromXML (std::string rowDoc) ;
01559
01562
01564
01565 std::map<std::string, SourceAttributeFromBin> fromBinMethods;
01566 void sourceIdFromBin( EndianIStream& eis);
01567 void timeIntervalFromBin( EndianIStream& eis);
01568 void spectralWindowIdFromBin( EndianIStream& eis);
01569 void codeFromBin( EndianIStream& eis);
01570 void directionFromBin( EndianIStream& eis);
01571 void properMotionFromBin( EndianIStream& eis);
01572 void sourceNameFromBin( EndianIStream& eis);
01573
01574 void directionCodeFromBin( EndianIStream& eis);
01575 void directionEquinoxFromBin( EndianIStream& eis);
01576 void calibrationGroupFromBin( EndianIStream& eis);
01577 void catalogFromBin( EndianIStream& eis);
01578 void deltaVelFromBin( EndianIStream& eis);
01579 void positionFromBin( EndianIStream& eis);
01580 void numLinesFromBin( EndianIStream& eis);
01581 void transitionFromBin( EndianIStream& eis);
01582 void restFrequencyFromBin( EndianIStream& eis);
01583 void sysVelFromBin( EndianIStream& eis);
01584 void rangeVelFromBin( EndianIStream& eis);
01585 void sourceModelFromBin( EndianIStream& eis);
01586 void frequencyRefCodeFromBin( EndianIStream& eis);
01587 void numFreqFromBin( EndianIStream& eis);
01588 void numStokesFromBin( EndianIStream& eis);
01589 void frequencyFromBin( EndianIStream& eis);
01590 void frequencyIntervalFromBin( EndianIStream& eis);
01591 void stokesParameterFromBin( EndianIStream& eis);
01592 void fluxFromBin( EndianIStream& eis);
01593 void fluxErrFromBin( EndianIStream& eis);
01594 void positionAngleFromBin( EndianIStream& eis);
01595 void positionAngleErrFromBin( EndianIStream& eis);
01596 void sizeFromBin( EndianIStream& eis);
01597 void sizeErrFromBin( EndianIStream& eis);
01598 void velRefCodeFromBin( EndianIStream& eis);
01599
01600
01608 static SourceRow* fromBin(EndianIStream& eis, SourceTable& table, const std::vector<std::string>& attributesSeq);
01609
01616 void fromText(const std::string& attributeName, const std::string& t);
01618
01619 private:
01623 SourceTable &table;
01627 bool hasBeenAdded;
01628
01629
01630 void isAdded(bool added);
01631
01632
01641 SourceRow (SourceTable &table);
01642
01660 SourceRow (SourceTable &table, SourceRow &row);
01661
01663
01665
01666
01667
01668
01669
01670
01671 int sourceId;
01672
01673
01674
01675
01685 void setSourceId (int sourceId);
01686
01687
01688
01689
01690
01691
01692
01693
01694 ArrayTimeInterval timeInterval;
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705 string code;
01706
01707
01708
01709
01710
01711
01712
01713
01714
01715
01716 vector<Angle > direction;
01717
01718
01719
01720
01721
01722
01723
01724
01725
01726
01727 vector<AngularRate > properMotion;
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738 string sourceName;
01739
01740
01741
01742
01743
01744
01745
01746
01747
01748 bool directionCodeExists;
01749
01750
01751 DirectionReferenceCodeMod::DirectionReferenceCode directionCode;
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761 bool directionEquinoxExists;
01762
01763
01764 ArrayTime directionEquinox;
01765
01766
01767
01768
01769
01770
01771
01772
01773
01774 bool calibrationGroupExists;
01775
01776
01777 int calibrationGroup;
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787 bool catalogExists;
01788
01789
01790 string catalog;
01791
01792
01793
01794
01795
01796
01797
01798
01799
01800 bool deltaVelExists;
01801
01802
01803 Speed deltaVel;
01804
01805
01806
01807
01808
01809
01810
01811
01812
01813 bool positionExists;
01814
01815
01816 vector<Length > position;
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826 bool numLinesExists;
01827
01828
01829 int numLines;
01830
01831
01832
01833
01834
01835
01836
01837
01838
01839 bool transitionExists;
01840
01841
01842 vector<string > transition;
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852 bool restFrequencyExists;
01853
01854
01855 vector<Frequency > restFrequency;
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865 bool sysVelExists;
01866
01867
01868 vector<Speed > sysVel;
01869
01870
01871
01872
01873
01874
01875
01876
01877
01878 bool rangeVelExists;
01879
01880
01881 vector<Speed > rangeVel;
01882
01883
01884
01885
01886
01887
01888
01889
01890
01891 bool sourceModelExists;
01892
01893
01894 SourceModelMod::SourceModel sourceModel;
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904 bool frequencyRefCodeExists;
01905
01906
01907 FrequencyReferenceCodeMod::FrequencyReferenceCode frequencyRefCode;
01908
01909
01910
01911
01912
01913
01914
01915
01916
01917 bool numFreqExists;
01918
01919
01920 int numFreq;
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930 bool numStokesExists;
01931
01932
01933 int numStokes;
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943 bool frequencyExists;
01944
01945
01946 vector<Frequency > frequency;
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956 bool frequencyIntervalExists;
01957
01958
01959 vector<Frequency > frequencyInterval;
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969 bool stokesParameterExists;
01970
01971
01972 vector<StokesParameterMod::StokesParameter > stokesParameter;
01973
01974
01975
01976
01977
01978
01979
01980
01981
01982 bool fluxExists;
01983
01984
01985 vector<vector<Flux > > flux;
01986
01987
01988
01989
01990
01991
01992
01993
01994
01995 bool fluxErrExists;
01996
01997
01998 vector<vector<Flux > > fluxErr;
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008 bool positionAngleExists;
02009
02010
02011 vector<Angle > positionAngle;
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021 bool positionAngleErrExists;
02022
02023
02024 vector<Angle > positionAngleErr;
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034 bool sizeExists;
02035
02036
02037 vector<vector<Angle > > size;
02038
02039
02040
02041
02042
02043
02044
02045
02046
02047 bool sizeErrExists;
02048
02049
02050 vector<vector<Angle > > sizeErr;
02051
02052
02053
02054
02055
02056
02057
02058
02059
02060 bool velRefCodeExists;
02061
02062
02063 RadialVelocityReferenceCodeMod::RadialVelocityReferenceCode velRefCode;
02064
02065
02066
02067
02068
02070
02072
02073
02074
02075
02076
02077
02078 Tag spectralWindowId;
02079
02080
02081
02082
02083
02085
02087
02088
02089
02090
02091
02092
02093
02094
02095
02096
02098
02100
02101
02102
02103
02104
02105
02106
02107
02108
02109
02110
02111
02112
02113
02114
02115
02116
02117
02118
02119
02120
02121
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132
02133
02134
02135
02136
02138
02140 std::map<std::string, SourceAttributeFromText> fromTextMethods;
02141
02142 void sourceIdFromText (const string & s);
02143
02144
02145 void timeIntervalFromText (const string & s);
02146
02147
02148 void spectralWindowIdFromText (const string & s);
02149
02150
02151 void codeFromText (const string & s);
02152
02153
02154 void directionFromText (const string & s);
02155
02156
02157 void properMotionFromText (const string & s);
02158
02159
02160 void sourceNameFromText (const string & s);
02161
02162
02163
02164 void directionCodeFromText (const string & s);
02165
02166
02167 void directionEquinoxFromText (const string & s);
02168
02169
02170 void calibrationGroupFromText (const string & s);
02171
02172
02173 void catalogFromText (const string & s);
02174
02175
02176 void deltaVelFromText (const string & s);
02177
02178
02179 void positionFromText (const string & s);
02180
02181
02182 void numLinesFromText (const string & s);
02183
02184
02185 void transitionFromText (const string & s);
02186
02187
02188 void restFrequencyFromText (const string & s);
02189
02190
02191 void sysVelFromText (const string & s);
02192
02193
02194 void rangeVelFromText (const string & s);
02195
02196
02197 void sourceModelFromText (const string & s);
02198
02199
02200 void frequencyRefCodeFromText (const string & s);
02201
02202
02203 void numFreqFromText (const string & s);
02204
02205
02206 void numStokesFromText (const string & s);
02207
02208
02209 void frequencyFromText (const string & s);
02210
02211
02212 void frequencyIntervalFromText (const string & s);
02213
02214
02215 void stokesParameterFromText (const string & s);
02216
02217
02218 void fluxFromText (const string & s);
02219
02220
02221 void fluxErrFromText (const string & s);
02222
02223
02224 void positionAngleFromText (const string & s);
02225
02226
02227 void positionAngleErrFromText (const string & s);
02228
02229
02230 void sizeFromText (const string & s);
02231
02232
02233 void sizeErrFromText (const string & s);
02234
02235
02236 void velRefCodeFromText (const string & s);
02237
02238
02239
02244 void toBin(EndianOSStream& eoss);
02245
02255 };
02256
02257 }
02258
02259 #endif