| 1 | #include "HipRecord.h" | ||
| 2 | #include <iostream> | ||
| 3 | #include <cstdlib> | ||
| 4 | #include <cmath> | ||
| 5 | |||
| 6 | bool | ||
| 7 | 6 | HipRecord::ParseRecord(const std::string& line) { | |
| 8 | 6 | fLine = line; | |
| 9 | 12 | fCatalog = line.substr(0, 0); | |
| 10 | 6 | fHIP = (int)atoi(&line[8]); | |
| 11 | 6 | fProxy = line.substr(15, -15); | |
| 12 | 6 | fRAhms = line.substr(17, 11); | |
| 13 | 12 | fDEdms = line.substr(29, 11); | |
| 14 | 6 | fVmag = (float)atof(&line[41]); | |
| 15 | 6 | fVarFlag = (char)atoi(&line[47]); | |
| 16 | 12 | fr_Vmag = line.substr(49, -49); | |
| 17 | 6 | fRAdeg = (double)atof(&line[51]); | |
| 18 | 6 | fDEdeg = (double)atof(&line[64]); | |
| 19 | 12 | fAstroRef = line.substr(77, -77); | |
| 20 | 6 | fPlx = (float)atof(&line[79]); | |
| 21 | 6 | fpmRA = (double)atof(&line[87]); | |
| 22 | 6 | fpmDE = (double)atof(&line[96]); | |
| 23 | 6 | fe_RAdeg = (float)atof(&line[105]); | |
| 24 | 6 | fe_DEdeg = (float)atof(&line[112]); | |
| 25 | 6 | fe_Plx = (float)atof(&line[119]); | |
| 26 | 6 | fe_pmRA = (float)atof(&line[126]); | |
| 27 | 6 | fe_pmDE = (float)atof(&line[133]); | |
| 28 | 6 | fDE_RA = (float)atof(&line[140]); | |
| 29 | 6 | fPlx_RA = (float)atof(&line[146]); | |
| 30 | 6 | fPlx_DE = (float)atof(&line[152]); | |
| 31 | 6 | fpmRA_RA = (float)atof(&line[158]); | |
| 32 | 6 | fpmRA_DE = (float)atof(&line[164]); | |
| 33 | 6 | fpmRA_Plx = (float)atof(&line[170]); | |
| 34 | 6 | fpmDE_RA = (float)atof(&line[176]); | |
| 35 | 6 | fpmDE_DE = (float)atof(&line[182]); | |
| 36 | 6 | fpmDE_Plx = (float)atof(&line[188]); | |
| 37 | 6 | fpmDE_pmRA = (float)atof(&line[194]); | |
| 38 | 6 | fF1 = (short int)atoi(&line[200]); | |
| 39 | 6 | fF2 = (float)atof(&line[204]); | |
| 40 | 6 | fBTmag = (float)atof(&line[217]); | |
| 41 | 6 | fe_BTmag = (float)atof(&line[224]); | |
| 42 | 6 | fVTmag = (float)atof(&line[230]); | |
| 43 | 6 | fe_VTmag = (float)atof(&line[237]); | |
| 44 | 12 | fm_BTmag = line.substr(243, -243); | |
| 45 | 6 | fB_V = (float)atof(&line[245]); | |
| 46 | 6 | fe_B_V = (float)atof(&line[252]); | |
| 47 | 12 | fr_B_V = line.substr(258, -258); | |
| 48 | 6 | fV_I = (float)atof(&line[260]); | |
| 49 | 6 | fe_V_I = (float)atof(&line[265]); | |
| 50 | 6 | fr_V_I = line.substr(270, -270); | |
| 51 | 12 | fCombMag = line.substr(272, -272); | |
| 52 | 6 | fHpmag = (float)atof(&line[274]); | |
| 53 | 6 | fe_Hpmag = (float)atof(&line[282]); | |
| 54 | 6 | fHpscat = (float)atof(&line[289]); | |
| 55 | 6 | fo_Hpmag = (short int)atoi(&line[295]); | |
| 56 | 12 | fm_Hpmag = line.substr(299, -299); | |
| 57 | 6 | fHpmax = (float)atof(&line[301]); | |
| 58 | 6 | fHPmin = (float)atof(&line[307]); | |
| 59 | 6 | fPeriod = (float)atof(&line[313]); | |
| 60 | 6 | fHvarType = line.substr(321, -321); | |
| 61 | 6 | fmoreVar = line.substr(323, -323); | |
| 62 | 6 | fmorePhoto = line.substr(325, -325); | |
| 63 | 6 | fCCDM = line.substr(327, 10); | |
| 64 | 12 | fn_CCDM = line.substr(338, -338); | |
| 65 | 6 | fNsys = (char)atoi(&line[340]); | |
| 66 | 6 | fNcomp = (char)atoi(&line[343]); | |
| 67 | 6 | fMultFlag = line.substr(346, -346); | |
| 68 | 6 | fSource = line.substr(348, -348); | |
| 69 | 6 | fQual = line.substr(350, -350); | |
| 70 | 12 | fm_HIP = line.substr(352, 2); | |
| 71 | 6 | ftheta = (short int)atoi(&line[355]); | |
| 72 | 6 | frho = (float)atof(&line[359]); | |
| 73 | 6 | fe_rho = (float)atof(&line[367]); | |
| 74 | 6 | fdHp = (float)atof(&line[373]); | |
| 75 | 6 | fe_dHp = (float)atof(&line[379]); | |
| 76 | 6 | fSurvey = line.substr(384, -384); | |
| 77 | 6 | fChart = line.substr(386, -386); | |
| 78 | 12 | fNotes = line.substr(388, -388); | |
| 79 | 6 | fHD = (int)atoi(&line[390]); | |
| 80 | 6 | fBD = line.substr(397, 10); | |
| 81 | 6 | fCoD = line.substr(408, 10); | |
| 82 | 12 | fCPD = line.substr(419, 10); | |
| 83 | 6 | f_V_I_red = (float)atof(&line[430]); | |
| 84 | 6 | fSpType = line.substr(435, 12); | |
| 85 | 6 | fr_SpType = line.substr(448, -448); | |
| 86 | 6 | return true; | |
| 87 | } | ||
| 88 |