Commit 2d128fe8 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

bytes

parent 7eb699f1
...@@ -28,7 +28,7 @@ class CatalogApi(object): ...@@ -28,7 +28,7 @@ class CatalogApi(object):
return: csst_dfs_common.models.Result return: csst_dfs_common.models.Result
''' '''
try: try:
datas = bytearray() datas = b''
totalCount = 0 totalCount = 0
for resp in self.stub.Gaia3Search(ephem_pb2.EphemSearchRequest( for resp in self.stub.Gaia3Search(ephem_pb2.EphemSearchRequest(
ra = ra, ra = ra,
...@@ -41,8 +41,7 @@ class CatalogApi(object): ...@@ -41,8 +41,7 @@ class CatalogApi(object):
),metadata = get_auth_headers()): ),metadata = get_auth_headers()):
if resp.success: if resp.success:
# data = from_proto_model_list(Gaia3Record, resp.records) # data = from_proto_model_list(Gaia3Record, resp.records)
data = resp.records datas = datas + resp.records
datas.extend(data)
totalCount = resp.totalCount totalCount = resp.totalCount
else: else:
return Result.error(message = str(resp.error.detail)) return Result.error(message = str(resp.error.detail))
...@@ -50,164 +49,164 @@ class CatalogApi(object): ...@@ -50,164 +49,164 @@ class CatalogApi(object):
records = pickle.loads(datas) records = pickle.loads(datas)
ret_records2 = [] ret_records2 = []
for r in records: for r in records:
rec = Gaia3Record( rec = Gaia3Record()
SolutionId = r[0], rec.SolutionId = r[0]
Designation = r[1], rec.Designation = r[1]
SourceId = r[2], rec.SourceId = r[2]
RandomIndex = r[3], rec.RandomIndex = r[3]
RefEpoch = r[4], rec.RefEpoch = r[4]
Ra = r[5], rec.Ra = r[5]
RaError = r[6], rec.RaError = r[6]
Dec = r[7], rec.Dec = r[7]
DecError = r[8], rec.DecError = r[8]
Parallax = r[9], rec.Parallax = r[9]
ParallaxError = r[10], rec.ParallaxError = r[10]
ParallaxOverError = r[11], rec.ParallaxOverError = r[11]
Pm = r[12], rec.Pm = r[12]
Pmra = r[13], rec.Pmra = r[13]
PmraError = r[14], rec.PmraError = r[14]
Pmdec = r[15], rec.Pmdec = r[15]
PmdecError = r[16], rec.PmdecError = r[16]
RaDecCorr = r[17], rec.RaDecCorr = r[17]
RaParallaxCorr = r[18], rec.RaParallaxCorr = r[18]
RaPmraCorr = r[19], rec.RaPmraCorr = r[19]
RaPmdecCorr = r[20], rec.RaPmdecCorr = r[20]
DecParallaxCorr = r[21], rec.DecParallaxCorr = r[21]
DecPmraCorr = r[22], rec.DecPmraCorr = r[22]
DecPmdecCorr = r[23], rec.DecPmdecCorr = r[23]
ParallaxPmraCorr = r[24], rec.ParallaxPmraCorr = r[24]
ParallaxPmdecCorr = r[25], rec.ParallaxPmdecCorr = r[25]
PmraPmdecCorr = r[26], rec.PmraPmdecCorr = r[26]
AstrometricNObsAl = r[27], rec.AstrometricNObsAl = r[27]
AstrometricNObsAc = r[28], rec.AstrometricNObsAc = r[28]
AstrometricNGoodObsAl = r[29], rec.AstrometricNGoodObsAl = r[29]
AstrometricNBadObsAl = r[30], rec.AstrometricNBadObsAl = r[30]
AstrometricGofAl = r[31], rec.AstrometricGofAl = r[31]
AstrometricChi2Al = r[32], rec.AstrometricChi2Al = r[32]
AstrometricExcessNoise = r[33], rec.AstrometricExcessNoise = r[33]
AstrometricExcessNoiseSig = r[34], rec.AstrometricExcessNoiseSig = r[34]
AstrometricParamsSolved = r[35], rec.AstrometricParamsSolved = r[35]
AstrometricPrimaryFlag = r[36], rec.AstrometricPrimaryFlag = r[36]
NuEffUsedInAstrometry = r[37], rec.NuEffUsedInAstrometry = r[37]
Pseudocolour = r[38], rec.Pseudocolour = r[38]
PseudocolourError = r[39], rec.PseudocolourError = r[39]
RaPseudocolourCorr = r[40], rec.RaPseudocolourCorr = r[40]
DecPseudocolourCorr = r[41], rec.DecPseudocolourCorr = r[41]
ParallaxPseudocolourCorr = r[42], rec.ParallaxPseudocolourCorr = r[42]
PmraPseudocolourCorr = r[43], rec.PmraPseudocolourCorr = r[43]
PmdecPseudocolourCorr = r[44], rec.PmdecPseudocolourCorr = r[44]
AstrometricMatchedTransits = r[45], rec.AstrometricMatchedTransits = r[45]
VisibilityPeriodsUsed = r[46], rec.VisibilityPeriodsUsed = r[46]
AstrometricSigma5dMax = r[47], rec.AstrometricSigma5dMax = r[47]
MatchedTransits = r[48], rec.MatchedTransits = r[48]
NewMatchedTransits = r[49], rec.NewMatchedTransits = r[49]
MatchedTransitsRemoved = r[50], rec.MatchedTransitsRemoved = r[50]
IpdGofHarmonicAmplitude = r[51], rec.IpdGofHarmonicAmplitude = r[51]
IpdGofHarmonicPhase = r[52], rec.IpdGofHarmonicPhase = r[52]
IpdFracMultiPeak = r[53], rec.IpdFracMultiPeak = r[53]
IpdFracOddWin = r[54], rec.IpdFracOddWin = r[54]
Ruwe = r[55], rec.Ruwe = r[55]
ScanDirectionStrengthK1 = r[56], rec.ScanDirectionStrengthK1 = r[56]
ScanDirectionStrengthK2 = r[57], rec.ScanDirectionStrengthK2 = r[57]
ScanDirectionStrengthK3 = r[58], rec.ScanDirectionStrengthK3 = r[58]
ScanDirectionStrengthK4 = r[59], rec.ScanDirectionStrengthK4 = r[59]
ScanDirectionMeanK1 = r[60], rec.ScanDirectionMeanK1 = r[60]
ScanDirectionMeanK2 = r[61], rec.ScanDirectionMeanK2 = r[61]
ScanDirectionMeanK3 = r[62], rec.ScanDirectionMeanK3 = r[62]
ScanDirectionMeanK4 = r[63], rec.ScanDirectionMeanK4 = r[63]
DuplicatedSource = r[64], rec.DuplicatedSource = r[64]
PhotGNObs = r[65], rec.PhotGNObs = r[65]
PhotGMeanFlux = r[66], rec.PhotGMeanFlux = r[66]
PhotGMeanFluxError = r[67], rec.PhotGMeanFluxError = r[67]
PhotGMeanFluxOverError = r[68], rec.PhotGMeanFluxOverError = r[68]
PhotGMeanMag = r[69], rec.PhotGMeanMag = r[69]
PhotBpNObs = r[70], rec.PhotBpNObs = r[70]
PhotBpMeanFlux = r[71], rec.PhotBpMeanFlux = r[71]
PhotBpMeanFluxError = r[72], rec.PhotBpMeanFluxError = r[72]
PhotBpMeanFluxOverError = r[73], rec.PhotBpMeanFluxOverError = r[73]
PhotBpMeanMag = r[74], rec.PhotBpMeanMag = r[74]
PhotRpNObs = r[75], rec.PhotRpNObs = r[75]
PhotRpMeanFlux = r[76], rec.PhotRpMeanFlux = r[76]
PhotRpMeanFluxError = r[77], rec.PhotRpMeanFluxError = r[77]
PhotRpMeanFluxOverError = r[78], rec.PhotRpMeanFluxOverError = r[78]
PhotRpMeanMag = r[79], rec.PhotRpMeanMag = r[79]
PhotBpRpExcessFactor = r[80], rec.PhotBpRpExcessFactor = r[80]
PhotBpNContaminatedTransits = r[81], rec.PhotBpNContaminatedTransits = r[81]
PhotBpNBlendedTransits = r[82], rec.PhotBpNBlendedTransits = r[82]
PhotRpNContaminatedTransits = r[83], rec.PhotRpNContaminatedTransits = r[83]
PhotRpNBlendedTransits = r[84], rec.PhotRpNBlendedTransits = r[84]
PhotProcMode = r[85], rec.PhotProcMode = r[85]
BpRp = r[86], rec.BpRp = r[86]
BpG = r[87], rec.BpG = r[87]
GRp = r[88], rec.GRp = r[88]
RadialVelocity = r[89], rec.RadialVelocity = r[89]
RadialVelocityError = r[90], rec.RadialVelocityError = r[90]
RvMethodUsed = r[91], rec.RvMethodUsed = r[91]
RvNbTransits = r[92], rec.RvNbTransits = r[92]
RvNbDeblendedTransits = r[93], rec.RvNbDeblendedTransits = r[93]
RvVisibilityPeriodsUsed = r[94], rec.RvVisibilityPeriodsUsed = r[94]
RvExpectedSigToNoise = r[95], rec.RvExpectedSigToNoise = r[95]
RvRenormalisedGof = r[96], rec.RvRenormalisedGof = r[96]
RvChisqPvalue = r[97], rec.RvChisqPvalue = r[97]
RvTimeDuration = r[98], rec.RvTimeDuration = r[98]
RvAmplitudeRobust = r[99], rec.RvAmplitudeRobust = r[99]
RvTemplateTeff = r[100], rec.RvTemplateTeff = r[100]
RvTemplateLogg = r[101], rec.RvTemplateLogg = r[101]
RvTemplateFeH = r[102], rec.RvTemplateFeH = r[102]
RvAtmParamOrigin = r[103], rec.RvAtmParamOrigin = r[103]
Vbroad = r[104], rec.Vbroad = r[104]
VbroadError = r[105], rec.VbroadError = r[105]
VbroadNbTransits = r[106], rec.VbroadNbTransits = r[106]
GrvsMag = r[107], rec.GrvsMag = r[107]
GrvsMagError = r[108], rec.GrvsMagError = r[108]
GrvsMagNbTransits = r[109], rec.GrvsMagNbTransits = r[109]
RvsSpecSigToNoise = r[110], rec.RvsSpecSigToNoise = r[110]
PhotVariableFlag = r[111], rec.PhotVariableFlag = r[111]
L = r[112], rec.L = r[112]
B = r[113], rec.B = r[113]
EclLon = r[114], rec.EclLon = r[114]
EclLat = r[115], rec.EclLat = r[115]
InQsoCandidates = r[116], rec.InQsoCandidates = r[116]
InGalaxyCandidates = r[117], rec.InGalaxyCandidates = r[117]
NonSingleStar = r[118], rec.NonSingleStar = r[118]
HasXpContinuous = r[119], rec.HasXpContinuous = r[119]
HasXpSampled = r[120], rec.HasXpSampled = r[120]
HasRvs = r[121], rec.HasRvs = r[121]
HasEpochPhotometry = r[122], rec.HasEpochPhotometry = r[122]
HasEpochRv = r[123], rec.HasEpochRv = r[123]
HasMcmcGspphot = r[124], rec.HasMcmcGspphot = r[124]
HasMcmcMsc = r[125], rec.HasMcmcMsc = r[125]
InAndromedaSurvey = r[126], rec.InAndromedaSurvey = r[126]
ClassprobDscCombmodQuasar = r[127], rec.ClassprobDscCombmodQuasar = r[127]
ClassprobDscCombmodGalaxy = r[128], rec.ClassprobDscCombmodGalaxy = r[128]
ClassprobDscCombmodStar = r[129], rec.ClassprobDscCombmodStar = r[129]
TeffGspphot = r[130], rec.TeffGspphot = r[130]
TeffGspphotLower = r[131], rec.TeffGspphotLower = r[131]
TeffGspphotUpper = r[132], rec.TeffGspphotUpper = r[132]
LoggGspphot = r[133], rec.LoggGspphot = r[133]
LoggGspphotLower = r[134], rec.LoggGspphotLower = r[134]
LoggGspphotUpper = r[135], rec.LoggGspphotUpper = r[135]
MhGspphot = r[136], rec.MhGspphot = r[136]
MhGspphotLower = r[137], rec.MhGspphotLower = r[137]
MhGspphotUpper = r[138], rec.MhGspphotUpper = r[138]
DistanceGspphot = r[139], rec.DistanceGspphot = r[139]
DistanceGspphotLower = r[140], rec.DistanceGspphotLower = r[140]
DistanceGspphotUpper = r[141], rec.DistanceGspphotUpper = r[141]
AzeroGspphot = r[142], rec.AzeroGspphot = r[142]
AzeroGspphotLower = r[143], rec.AzeroGspphotLower = r[143]
AzeroGspphotUpper = r[144], rec.AzeroGspphotUpper = r[144]
AgGspphot = r[145], rec.AgGspphot = r[145]
AgGspphotLower = r[146], rec.AgGspphotLower = r[146]
AgGspphotUpper = r[147], rec.AgGspphotUpper = r[147]
EbpminrpGspphot = r[148], rec.EbpminrpGspphot = r[148]
EbpminrpGspphotLower = r[149], rec.EbpminrpGspphotLower = r[149]
EbpminrpGspphotUpper = r[150], rec.EbpminrpGspphotUpper = r[150]
LibnameGspphot = r[151], rec.LibnameGspphot = r[151]
NS8HIdx = r[152], rec.NS8HIdx = r[152]
NS16HIdx = r[153], rec.NS16HIdx = r[153]
NS32HIdx = r[154], rec.NS32HIdx = r[154]
NS64HIdx = r[155], rec.NS64HIdx = r[155]
FileIdx = r[156]) rec.FileIdx = r[156]
ret_records2.append(rec) ret_records2.append(rec)
return Result.ok_data(data = ret_records2).append("totalCount", totalCount) return Result.ok_data(data = ret_records2).append("totalCount", totalCount)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment