;---------;---------;---------;---------;---------;---------;---------;--------: ;Function to read a single data field and return it FUNCTION readField, fileId, fieldName NCDF_VARGET, fileId, fieldName, temp att = NCDF_VARINQ(fileId, fieldName) IF att.DataType EQ 'SHORT' THEN BEGIN NCDF_ATTGET, fileId, fieldName, "scale_factor", scale ;assumes scales equal temp = temp*scale ENDIF RETURN, temp END ;---------;---------;---------;---------;---------;---------;---------;--------: ;Procedure to read a single complex data field and return it FUNCTION readFieldCmplx, fileId, fieldNameReal, fieldNameImag NCDF_VARGET, fileId, fieldNameReal, real NCDF_VARGET, fileId, fieldNameImag, imag field = COMPLEX(real, imag) RETURN, field END ;---------;---------;---------;---------;---------;---------;---------;--------: ;Procedure to read all the data fields PRO readAllData, fileId, data ; assume mode 170 data for now data[*].c0 = readField(fileId, "c0") data[*].p0 = readField(fileId, "p0") data[*].z0 = readField(fileId, "z0") data[*].ve = readField(fileId, "ve") data[*].cve = readField(fileId, "cve") END ;---------;---------;---------;---------;---------;---------;---------;--------: ;Procedure to read one beam of mode 103 data fields ;nBeam starts at 0 PRO readBeam103, fileId, ts, nTrigs, nCells, nBeam NCDF_VARGET, fileId,"Em_re",real,COUNT=[nTrigs,nCells,1],OFFSET=[0,0,nBeam] NCDF_VARGET, fileId,"Em_im",imag,COUNT=[nTrigs,nCells,1],OFFSET=[0,0,nBeam] EmTemp = COMPLEX(real, imag) NCDF_ATTGET, fileId, "Em_re", "scale_factor", scale ;assumes scales equal ts.Em = EmTemp[*,*,0]*scale NCDF_VARGET, fileId,"Ec_re",real,COUNT=[nTrigs,nCells,1],OFFSET=[0,0,nBeam] NCDF_VARGET, fileId,"Ec_im",imag,COUNT=[nTrigs,nCells,1],OFFSET=[0,0,nBeam] EcTemp = COMPLEX(real, imag) ts.Ec = EcTemp[*,*,0]*scale END ;---------;---------;---------;---------;---------;---------;---------;--------: ;---------;---------;---------;---------;---------;---------;---------;--------: