Ejemplo n.º 1
0
        public override object Create(Stream fileStream, BinaryReader binaryReader, int offset, int endOffset)
        {
            GeographLocationInfoFor1BD gInfo = new GeographLocationInfoFor1BD();

            fileStream.Seek(offset - 1, SeekOrigin.Begin);
            gInfo.ReferenceEllipse = ToLocalEndian_Core.ReadString(binaryReader.ReadChars(8));
            if (_isBigEndian)
            {
                gInfo.EarthLocationGap = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2)) / 10f;
            }
            else
            {
                gInfo.EarthLocationGap = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2)) / 10f;
            }
            base.Create(fileStream, binaryReader, offset, endOffset);
            return(gInfo);
        }
Ejemplo n.º 2
0
        public override object Create(Stream fileStream, BinaryReader binaryReader, int offset, int endOffset)
        {
            ScaleInfoFor1BD sInfo = new ScaleInfoFor1BD();

            fileStream.Seek(188, SeekOrigin.Begin);
            if (_isBigEndian)
            {
                sInfo.NearSunCHScaleYear = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                sInfo.NearSunChScaleDay  = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
            }
            else
            {
                sInfo.NearSunCHScaleYear = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                sInfo.NearSunChScaleDay  = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
            }
            base.Create(fileStream, binaryReader, offset, endOffset);
            return(sInfo);
        }
Ejemplo n.º 3
0
        public override object Create(Stream fileStream, BinaryReader binaryReader, int offset, int endOffset)
        {
            CommonInfoFor1BD commInfo = new CommonInfoFor1BD();

            fileStream.Seek(offset, SeekOrigin.Begin);
            if (_isBigEndian)
            {
                commInfo.FileGenPlace       = ToLocalEndian_Core.ReadString(binaryReader.ReadChars(3));
                commInfo.ASCIIBank          = binaryReader.ReadChar();
                commInfo.Version            = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.VersionYear        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.VersionDay         = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.LogicalRecordLen   = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.RecordBlockLen     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.HeaderRecordCount  = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.FillFlag17_22      = new UInt16[] { ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2)), ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2)), ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2)) };
                commInfo.DatasetName        = ToLocalEndian_Core.ReadString2(binaryReader.ReadChars(42));
                commInfo.HandleBlockFlag    = ToLocalEndian_Core.ReadString2(binaryReader.ReadChars(8));
                commInfo.SatelliteIdentify  = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.SensorIdentify     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.DataType           = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.TIPCode            = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.BeginDayFrom1950   = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                commInfo.DataBeginYear      = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.DataBeginDayOfYear = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.DataBeginUTC       = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                commInfo.EndDayFrom1950     = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                commInfo.DataEndYear        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.DataEndDayOfYear   = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                commInfo.DataEndUTC         = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                binaryReader.ReadBytes(21924);
                UInt16 is3A_int = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                string is3A_str = Convert.ToString(is3A_int, 2).PadLeft(16, '0');
                commInfo.Current3A       = is3A_str[0] == '0' ? true : false;
                commInfo.CurrentRise     = is3A_str[15] == '0' ? true : false;
                commInfo.SatelliteName   = commInfo.SatelliteIdentify == 3 ? "NOAA16" : commInfo.SatelliteIdentify == 11 ? "NOAA17" : (commInfo.SatelliteIdentify == 13 || commInfo.SatelliteIdentify == 7) ? "NOAA18" : "";
                commInfo.SensorName      = commInfo.SensorIdentify == 0 ? "AVHRR" : "";
                commInfo.FullRecordCount = new FileInfo((fileStream as FileStream).Name).Length / _cstRecordBlockLen - 1;
                commInfo.OrbitBeginTime  = DateTime.Parse(commInfo.DataBeginYear.ToString() + "-01-01").AddDays(commInfo.DataBeginDayOfYear - 1).AddMilliseconds(commInfo.DataBeginUTC);
            }
            else
            {
                commInfo.FileGenPlace      = ToLocalEndian_Core.ReadString(binaryReader.ReadChars(3));
                commInfo.ASCIIBank         = binaryReader.ReadChar();
                commInfo.Version           = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.VersionYear       = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.VersionDay        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.LogicalRecordLen  = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.RecordBlockLen    = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.HeaderRecordCount = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.FillFlag17_22     = new UInt16[] { ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2)),
                                                            ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2)),
                                                            ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2)) };
                commInfo.DatasetName        = ToLocalEndian_Core.ReadString2(binaryReader.ReadChars(42));
                commInfo.HandleBlockFlag    = ToLocalEndian_Core.ReadString2(binaryReader.ReadChars(8));
                commInfo.SatelliteIdentify  = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.SensorIdentify     = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.DataType           = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.TIPCode            = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.BeginDayFrom1950   = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                commInfo.DataBeginYear      = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.DataBeginDayOfYear = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.DataBeginUTC       = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                commInfo.EndDayFrom1950     = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                commInfo.DataEndYear        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.DataEndDayOfYear   = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                commInfo.DataEndUTC         = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                binaryReader.ReadBytes(21924);
                UInt16 is3A_int = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                string is3A_str = Convert.ToString(is3A_int, 2).PadLeft(16, '0');
                commInfo.Current3A       = is3A_str[0] == '0' ? true : false;
                commInfo.CurrentRise     = is3A_str[15] == '0' ? true : false;
                commInfo.SatelliteName   = commInfo.SatelliteIdentify == 3 ? "NOAA16" : commInfo.SatelliteIdentify == 11 ? "NOAA17" : (commInfo.SatelliteIdentify == 13 || commInfo.SatelliteIdentify == 7) ? "NOAA18" : "";
                commInfo.SensorName      = commInfo.SensorIdentify == 0 ? "AVHRR" : "";
                commInfo.FullRecordCount = new FileInfo((fileStream as FileStream).Name).Length / _cstRecordBlockLen - 1;
                commInfo.OrbitBeginTime  = DateTime.Parse(commInfo.DataBeginYear.ToString() + "-01-01").AddDays(commInfo.DataBeginDayOfYear - 1).AddMilliseconds(commInfo.DataBeginUTC);
            }
            base.Create(fileStream, binaryReader, offset, endOffset);
            return(commInfo);
        }
Ejemplo n.º 4
0
        public override object Create(Stream fileStream, BinaryReader binaryReader, int offset, int endOffset)
        {
            QualityCheckInfoFor1BD qInfo = new QualityCheckInfoFor1BD();

            fileStream.Seek(116, SeekOrigin.Begin);
            if (_isBigEndian)
            {
                UInt32 yqState_Int = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                string yqState_Str = Convert.ToString(yqState_Int, 2).PadLeft(32, '0');
                qInfo.PatchControl      = yqState_Str[1] == '0' ? false : true;
                qInfo.EarthShadow       = yqState_Str[2] == '0' ? false : true;
                qInfo.RemotesensingLock = yqState_Str[3] == '0' ? false : true;
                qInfo.ScanMotor         = yqState_Str[4] == '0' ? false : true;
                qInfo.CoolerHot         = yqState_Str[5] == '0' ? false : true;
                qInfo.VStandard         = yqState_Str[6] == '0' ? false : true;
                qInfo.Used3AOr3B        = yqState_Str[7] == '0' ? false : true;
                qInfo.EnableChannel5    = yqState_Str[8] == '0' ? false : true;
                qInfo.EnableChannel4    = yqState_Str[9] == '0' ? false : true;
                qInfo.EnableChannel3B   = yqState_Str[10] == '0' ? false : true;
                qInfo.EnableChannel3A   = yqState_Str[11] == '0' ? false : true;
                qInfo.EnableChannel2    = yqState_Str[12] == '0' ? false : true;
                qInfo.EnableChannel1    = yqState_Str[13] == '0' ? false : true;
                qInfo.UsedElectron      = yqState_Str[14] == '0' ? false : true;
                qInfo.UsedMotor         = yqState_Str[15] == '0' ? false : true;
                fileStream.Seek(2, SeekOrigin.Current);
                qInfo.StateChangeCount       = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.SecondYQState          = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                qInfo.RecordCount            = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.MarkRecordCount        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.LostRecordCount        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.DataKXCount            = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorFrameCount        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorTIPCount          = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorAssistCount       = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrder         = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrderCode     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.UpdateSOCC             = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocation     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocationCode = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                int    statePACS_Int = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                string statePACS_Str = Convert.ToString(statePACS_Int, 2).PadLeft(16, '0');
                qInfo.DataMode      = statePACS_Str[0] == '0' ? false : true;
                qInfo.TapeDirection = statePACS_Str[1] == '0' ? false : true;
                qInfo.PseudoNoise   = statePACS_Str[2] == '0' ? false : true;
                qInfo.PACSource     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
            }
            else
            {
                UInt32 yqState_Int = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                string yqState_Str = Convert.ToString(yqState_Int, 2).PadLeft(32, '0');
                qInfo.PatchControl      = yqState_Str[1] == '0' ? false : true;
                qInfo.EarthShadow       = yqState_Str[2] == '0' ? false : true;
                qInfo.RemotesensingLock = yqState_Str[3] == '0' ? false : true;
                qInfo.ScanMotor         = yqState_Str[4] == '0' ? false : true;
                qInfo.CoolerHot         = yqState_Str[5] == '0' ? false : true;
                qInfo.VStandard         = yqState_Str[6] == '0' ? false : true;
                qInfo.Used3AOr3B        = yqState_Str[7] == '0' ? false : true;
                qInfo.EnableChannel5    = yqState_Str[8] == '0' ? false : true;
                qInfo.EnableChannel4    = yqState_Str[9] == '0' ? false : true;
                qInfo.EnableChannel3B   = yqState_Str[10] == '0' ? false : true;
                qInfo.EnableChannel3A   = yqState_Str[11] == '0' ? false : true;
                qInfo.EnableChannel2    = yqState_Str[12] == '0' ? false : true;
                qInfo.EnableChannel1    = yqState_Str[13] == '0' ? false : true;
                qInfo.UsedElectron      = yqState_Str[14] == '0' ? false : true;
                qInfo.UsedMotor         = yqState_Str[15] == '0' ? false : true;
                fileStream.Seek(2, SeekOrigin.Current);
                qInfo.StateChangeCount       = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.SecondYQState          = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                qInfo.RecordCount            = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.MarkRecordCount        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.LostRecordCount        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.DataKXCount            = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorFrameCount        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorTIPCount          = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorAssistCount       = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrder         = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrderCode     = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.UpdateSOCC             = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocation     = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocationCode = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                int    statePACS_Int = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                string statePACS_Str = Convert.ToString(statePACS_Int, 2).PadLeft(16, '0');
                qInfo.DataMode      = statePACS_Str[0] == '0' ? false : true;
                qInfo.TapeDirection = statePACS_Str[1] == '0' ? false : true;
                qInfo.PseudoNoise   = statePACS_Str[2] == '0' ? false : true;
                qInfo.PACSource     = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
            }
            base.Create(fileStream, binaryReader, offset, endOffset);
            return(qInfo);
        }