Ejemplo n.º 1
0
        internal frmPSFFits(LightCurveContext context, LCFile lcFile, TangraConfig.LightCurvesDisplaySettings displaySettings)
        {
            InitializeComponent();

            m_Context         = context;
            m_LCFile          = lcFile;
            m_DisplaySettings = displaySettings;

            picTarget1PSF.Image = new Bitmap(picTarget1PSF.Width, picTarget1PSF.Height);
            picTarget2PSF.Image = new Bitmap(picTarget2PSF.Width, picTarget2PSF.Height);
            picTarget3PSF.Image = new Bitmap(picTarget3PSF.Width, picTarget3PSF.Height);
            picTarget4PSF.Image = new Bitmap(picTarget4PSF.Width, picTarget4PSF.Height);

            m_TargetBoxes = new PictureBox[] { picTarget1PSF, picTarget2PSF, picTarget3PSF, picTarget4PSF };
        }
Ejemplo n.º 2
0
        internal frmBackgroundHistograms(LightCurveContext context, LCFile lcFile, TangraConfig.LightCurvesDisplaySettings displaySettings)
        {
            InitializeComponent();

            m_Context         = context;
            m_LCFile          = lcFile;
            m_DisplaySettings = displaySettings;

            picTarget1Hist.Image = new Bitmap(picTarget1Hist.Width, picTarget1Hist.Height);
            picTarget2Hist.Image = new Bitmap(picTarget2Hist.Width, picTarget2Hist.Height);
            picTarget3Hist.Image = new Bitmap(picTarget3Hist.Width, picTarget3Hist.Height);
            picTarget4Hist.Image = new Bitmap(picTarget4Hist.Width, picTarget4Hist.Height);

            m_TargetBoxes = new PictureBox[] { picTarget1Hist, picTarget2Hist, picTarget3Hist, picTarget4Hist };
        }
Ejemplo n.º 3
0
        internal void SetCurrentMeasurements(LCMeasurement[] measurements, LightCurveContext context, int occultedStarIndex)
        {
            m_Context           = context;
            m_OccultedStarIndex = occultedStarIndex;

            m_AllTargetColors = new Color[]
            {
                TangraConfig.Settings.Color.Target1,
                TangraConfig.Settings.Color.Target2,
                TangraConfig.Settings.Color.Target3,
                TangraConfig.Settings.Color.Target4
            };

            pb1.BackColor = m_AllTargetColors[0];
            pb2.BackColor = m_AllTargetColors[1];
            pb3.BackColor = m_AllTargetColors[2];
            pb4.BackColor = m_AllTargetColors[3];

            pnl1.Visible = false;
            pnl2.Visible = false;
            pnl3.Visible = false;
            pnl4.Visible = false;

            if (measurements == null || measurements.Length == 0)
            {
                int numFramesMedian = Math.Min(context.AllReadings[1].Count, TangraConfig.Settings.Photometry.SNFrameWindow);

                // If there is current selection then use the first reading from the LC file
                m_Intensities    = new int[context.ObjectCount];
                m_Intensities[0] = context.AllReadings[0].Take(numFramesMedian).Select(x => x.AdjustedReading).ToList().Median();
                if (context.ObjectCount > 1)
                {
                    m_Intensities[1] = context.AllReadings[1].Take(numFramesMedian).Select(x => x.AdjustedReading).ToList().Median();
                }
                if (context.ObjectCount > 2)
                {
                    m_Intensities[2] = context.AllReadings[2].Take(numFramesMedian).Select(x => x.AdjustedReading).ToList().Median();
                }
                if (context.ObjectCount > 3)
                {
                    m_Intensities[3] = context.AllReadings[3].Take(numFramesMedian).Select(x => x.AdjustedReading).ToList().Median();
                }
            }
        }
        internal frmConfigureReprocessing(
            LCMeasurementHeader header,
            LCMeasurementFooter footer,
            LightCurveContext context,
            Color[] allColors,
            Brush[] allBrushes,
            Pen[] allPens)
        {
            InitializeComponent();

            m_Context    = context;
            m_Header     = header;
            m_Footer     = footer;
            m_AllColors  = allColors;
            m_AllBrushes = allBrushes;
            m_AllPens    = allPens;

            SetComboboxIndexFromBackgroundMethod(m_Context.BackgroundMethod);
            SetComboboxIndexFromPhotometryReductionMethod(m_Context.SignalMethod);
            SetComboboxIndexFromPsfQuadratureMethod(m_Context.PsfQuadratureMethod);
            cbxDigitalFilter.SelectedIndex = (int)m_Context.Filter;
            nudGamma.Value = (decimal)m_Context.EncodingGamma;
            cbxKnownResponse.SetCBXIndex((int)m_Context.ReverseCameraResponse);

            int maxApertureSize = m_Footer.ReductionContext.GetMaxApertureSize();

            nudAperture1.Maximum = maxApertureSize;
            nudAperture2.Maximum = maxApertureSize;
            nudAperture3.Maximum = maxApertureSize;
            nudAperture4.Maximum = maxApertureSize;

            m_Saturation = TangraConfig.Settings.Photometry.Saturation.GetSaturationForBpp(context.BitPix, context.MaxPixelValue);

            if (TangraContext.Current.CanProcessLightCurvePixels)
            {
                SetupControls();
            }
        }
Ejemplo n.º 5
0
        internal frmZoomedPixels(LightCurveContext context, LCFile lcFile, TangraConfig.LightCurvesDisplaySettings displaySettings, LightCurveController lightcurveController)
        {
            InitializeComponent();

            m_Context              = context;
            m_LCFile               = lcFile;
            m_DisplaySettings      = displaySettings;
            m_LightcurveController = lightcurveController;

            m_Saturation = TangraConfig.Settings.Photometry.Saturation.GetSaturationForBpp(context.BitPix, context.MaxPixelValue);

            picTarget1Pixels.Image = new Bitmap(picTarget1Pixels.Width, picTarget1Pixels.Height);
            picTarget2Pixels.Image = new Bitmap(picTarget2Pixels.Width, picTarget2Pixels.Height);
            picTarget3Pixels.Image = new Bitmap(picTarget3Pixels.Width, picTarget3Pixels.Height);
            picTarget4Pixels.Image = new Bitmap(picTarget4Pixels.Width, picTarget4Pixels.Height);

            m_AllObjectsPeak = 0;

            if (lcFile.Footer.ReductionContext.BitPix <= 8)
            {
                lblDisplayBandTitle.Text = "Displayed Band:";
                lblDisplayedBand.Text    = lcFile.Footer.ReductionContext.ColourChannel.ToString();
            }
            else
            {
                lblDisplayBandTitle.Text = "Digital Video";
                lblDisplayedBand.Text    = "";
            }

            m_TargetBoxes = new PictureBox[] { picTarget1Pixels, picTarget2Pixels, picTarget3Pixels, picTarget4Pixels };

            for (int i = 0; i < m_TargetBoxes.Length; i++)
            {
                warningProvider.SetIconAlignment(m_TargetBoxes[i], ErrorIconAlignment.TopLeft);
                warningProvider.SetIconPadding(m_TargetBoxes[i], -17 - 16);

                infoProvider.SetIconAlignment(m_TargetBoxes[i], ErrorIconAlignment.TopLeft);
                infoProvider.SetIconPadding(m_TargetBoxes[i], -17);
            }

            for (int i = 0; i < m_LCFile.Footer.TrackedObjects.Count; i++)
            {
                TrackedObjectConfig cfg = m_LCFile.Footer.TrackedObjects[i];

                m_ObjectinGroup[i] = cfg.GroupId >= 0 && m_LCFile.Footer.TrackedObjects.Count(x => x.GroupId == cfg.GroupId) > 1;

                switch (cfg.TrackingType)
                {
                case TrackingType.OccultedStar:
                    m_ObjectTitles.Add(i, "Occulted");
                    break;

                case TrackingType.GuidingStar:
                    m_ObjectTitles.Add(i, "Guiding");
                    break;

                case TrackingType.ComparisonStar:
                    m_ObjectTitles.Add(i, "No Guiding");
                    break;
                }
            }
        }