示例#1
0
        internal CSVExportOptions GetSelectedOptions()
        {
            var rv = new CSVExportOptions();

            if (rbTimeString.Checked)
            {
                rv.TimeFormat = TimeFormat.String;
            }
            else if (rbDecimalDays.Checked)
            {
                rv.TimeFormat = TimeFormat.DecimalDays;
            }
            else if (rbJulianDays.Checked)
            {
                rv.TimeFormat = TimeFormat.DecimalJulianDays;
            }

            rv.ExcelFriendly = cbExcelFriendly.Checked;

            if (rbFlux.Checked)
            {
                rv.PhotometricFormat = PhotometricFormat.RelativeFlux;
            }
            else if (rbMagnitude.Checked)
            {
                rv.PhotometricFormat = PhotometricFormat.Magnitudes;
            }

            rv.M0 = m_M0;

            rv.ExportAtmosphericExtinction = cbxAtmExtExport.Checked;
            rv.ExportObjectPosition        = cbxExportPositions.Checked;
            rv.ExportPsfParameters         = cbxExportFSPParameters.Checked;
            if (cbxAtmExtExport.Checked)
            {
                rv.RAHours      = m_RAHours;
                rv.DEDeg        = m_DEDeg;
                rv.LongitudeDeg = m_Longitude;
                rv.LatitudeDeg  = m_Latitude;
                rv.HeightKM     = m_HeightKm;
            }

            if (m_ConfirmedDate.HasValue)
            {
                rv.FistMeasurementDay       = m_ConfirmedDate;
                rv.FistMeasurementTimeStamp = LCFile.GetTimeForFrame(LCFile.Header.MinFrame);
            }

            rv.Spacing                    = cbxSpacingOptions.SelectedIndex + 1;
            rv.ExportStartingFrame        = (int)nudExportStartFromFrame.Value;
            rv.ForceSignalMinusBackground = this.OnlyExportSignalMunusBg || rbSeriesSmB.Checked;

            return(rv);
        }
示例#2
0
        public DateTime?ParseExposure(string fileName, Header header, out bool isMidPoint, out double?fitsExposure)
        {
            isMidPoint   = true;
            fitsExposure = null;
            if (m_FitsIndex == null)
            {
                return(null);
            }

            string lowerFileNameOnly = Path.GetFileName(fileName);

            if (string.IsNullOrWhiteSpace(lowerFileNameOnly))
            {
                return(null);
            }

            uint frameNo;

            if (m_FitsIndex.TryGetValue(lowerFileNameOnly, out frameNo) &&
                m_LCFile.CanDetermineFrameTimes)
            {
                string correctedForInstrumentalDelayMessage;
                return(m_LCFile.GetTimeForFrame(frameNo, out correctedForInstrumentalDelayMessage));
            }
            return(null);
        }
示例#3
0
        internal SingleMeasurement(LCMeasurement lcMeasurement, double frameNo, LCFile lcFile, bool dontIncludeTimes)
        {
            CurrFrameNo = (int)lcMeasurement.CurrFrameNo;
            TargetNo = lcMeasurement.TargetNo;
            Measurement = lcMeasurement.IsSuccessfulReading ? 1.0f * lcMeasurement.AdjustedReading : INVALID_MEASUREMENT_VALUE;
            Background = lcMeasurement.IsSuccessfulReading
                // NOTE: Make sure negative backgrounds are sent as negative values (not as the serialized UINTs)
                ? 1.0f * (int)lcMeasurement.TotalBackground
                : INVALID_MEASUREMENT_VALUE;
            string isCorrectedForInstrumentalDelay;

            if (dontIncludeTimes ||
                !lcFile.Footer.ReductionContext.HasEmbeddedTimeStamps /* If the times are entered by the user, only include the times for the frames enterred by the user*/)
            {
                Timestamp = DateTime.MinValue;
                isCorrectedForInstrumentalDelay = null;

                if ((int)frameNo == lcFile.Header.FirstTimedFrameNo)
                    Timestamp = lcFile.Header.FirstTimedFrameTime;
                else if ((int)frameNo == lcFile.Header.LastTimedFrameNo)
                    Timestamp = lcFile.Header.SecondTimedFrameTime;
            }
            else
            {
                Timestamp = lcFile.GetTimeForFrame(frameNo, out isCorrectedForInstrumentalDelay);
            }

            IsCorrectedForInstrumentalDelay = lcFile.Header.InstrumentalDelayCorrectionsNotRequired() || !string.IsNullOrEmpty(isCorrectedForInstrumentalDelay);
            IsSuccessful = lcMeasurement.IsSuccessfulReading;
        }
示例#4
0
        internal SingleMeasurement(LCMeasurement lcMeasurement, double frameNo, LCFile lcFile, bool dontIncludeTimes)
        {
            CurrFrameNo = (int)lcMeasurement.CurrFrameNo;
            TargetNo    = lcMeasurement.TargetNo;
            Measurement = lcMeasurement.IsSuccessfulReading ? 1.0f * lcMeasurement.AdjustedReading : INVALID_MEASUREMENT_VALUE;
            Background  = lcMeasurement.IsSuccessfulReading
                          // NOTE: Make sure negative backgrounds are sent as negative values (not as the serialized UINTs)
                                ? 1.0f * (int)lcMeasurement.TotalBackground
                                : INVALID_MEASUREMENT_VALUE;
            string isCorrectedForInstrumentalDelay;

            if (dontIncludeTimes ||
                !lcFile.Footer.ReductionContext.HasEmbeddedTimeStamps /* If the times are entered by the user, only include the times for the frames enterred by the user*/)
            {
                Timestamp = DateTime.MinValue;
                isCorrectedForInstrumentalDelay = null;

                if ((int)frameNo == lcFile.Header.FirstTimedFrameNo)
                {
                    Timestamp = lcFile.Header.FirstTimedFrameTime;
                }
                else if ((int)frameNo == lcFile.Header.LastTimedFrameNo)
                {
                    Timestamp = lcFile.Header.SecondTimedFrameTime;
                }
            }
            else
            {
                Timestamp = lcFile.GetTimeForFrame(frameNo, out isCorrectedForInstrumentalDelay);
            }

            IsCorrectedForInstrumentalDelay = lcFile.Header.InstrumentalDelayCorrectionsNotRequired() || !string.IsNullOrEmpty(isCorrectedForInstrumentalDelay);
            IsSuccessful = lcMeasurement.IsSuccessfulReading;
        }
示例#5
0
        internal SingleMeasurement(frmLightCurve.BinnedValue binnedMeasurement, int targetNo, double binMiddleFrameNo, LCFile lcFile, bool dontIncludeTimes, int totalBins)
        {
            CurrFrameNo = (int)binnedMeasurement.BinNo;
            TargetNo = (byte)targetNo;
            Measurement = binnedMeasurement.IsSuccessfulReading ? (float)binnedMeasurement.AdjustedValue : INVALID_MEASUREMENT_VALUE;
            Background = binnedMeasurement.IsSuccessfulReading ? (float)binnedMeasurement.BackgroundValue : INVALID_MEASUREMENT_VALUE;
            string isCorrectedForInstrumentalDelay;
            if (dontIncludeTimes ||
                /* If the times are entered by the user, only include the times for the first and last bin derived from the frame times enterred by the user*/
                (!lcFile.Footer.ReductionContext.HasEmbeddedTimeStamps && binnedMeasurement.BinNo != 1 && binnedMeasurement.BinNo != totalBins))
            {
                Timestamp = DateTime.MinValue;
                isCorrectedForInstrumentalDelay = null;
            }
            else
            {
                Timestamp = lcFile.GetTimeForFrame(binMiddleFrameNo, out isCorrectedForInstrumentalDelay);
            }

            IsCorrectedForInstrumentalDelay = lcFile.Header.InstrumentalDelayCorrectionsNotRequired() || !string.IsNullOrEmpty(isCorrectedForInstrumentalDelay);
            IsSuccessful = binnedMeasurement.IsSuccessfulReading;
        }
示例#6
0
        internal SingleMeasurement(frmLightCurve.BinnedValue binnedMeasurement, int targetNo, double binMiddleFrameNo, LCFile lcFile, bool dontIncludeTimes, int totalBins)
        {
            CurrFrameNo = (int)binnedMeasurement.BinNo;
            TargetNo    = (byte)targetNo;
            Measurement = binnedMeasurement.IsSuccessfulReading ? (float)binnedMeasurement.AdjustedValue : INVALID_MEASUREMENT_VALUE;
            Background  = binnedMeasurement.IsSuccessfulReading ? (float)binnedMeasurement.BackgroundValue : INVALID_MEASUREMENT_VALUE;
            string isCorrectedForInstrumentalDelay;

            if (dontIncludeTimes ||
                /* If the times are entered by the user, only include the times for the first and last bin derived from the frame times enterred by the user*/
                (!lcFile.Footer.ReductionContext.HasEmbeddedTimeStamps && binnedMeasurement.BinNo != 1 && binnedMeasurement.BinNo != totalBins))
            {
                Timestamp = DateTime.MinValue;
                isCorrectedForInstrumentalDelay = null;
            }
            else
            {
                Timestamp = lcFile.GetTimeForFrame(binMiddleFrameNo, out isCorrectedForInstrumentalDelay);
            }

            IsCorrectedForInstrumentalDelay = lcFile.Header.InstrumentalDelayCorrectionsNotRequired() || !string.IsNullOrEmpty(isCorrectedForInstrumentalDelay);
            IsSuccessful = binnedMeasurement.IsSuccessfulReading;
        }