private void btnOK_Click(object sender, EventArgs e) { SelectedExportMags = ExportedMags.None; if (cbxExpostSyntheticMags.Checked) { if (cb_B.Checked) { SelectedExportMags |= ExportedMags.Johnson_B; } if (cb_V.Checked) { SelectedExportMags |= ExportedMags.Johnson_V; } if (cb_R.Checked) { SelectedExportMags |= ExportedMags.Johnson_R; } if (cb_Sloan_g.Checked) { SelectedExportMags |= ExportedMags.Sloan_g; } if (cb_Sloan_r.Checked) { SelectedExportMags |= ExportedMags.Sloan_r; } if (cb_Sloan_i.Checked) { SelectedExportMags |= ExportedMags.Sloan_i; } } DialogResult = DialogResult.OK; Close(); }
internal void ExportMagnitudes(ExportedMags mags, List <AbsFluxSpectra> spectra, List <AbsFluxSpectra> standardSpectras, StringBuilder output) { if ((mags & ExportedMags.Johnson_B) == ExportedMags.Johnson_B) { ExportMagnitudes(FilterResponseDatabase.Instance.Johnson_B, spectra, standardSpectras, output); } if ((mags & ExportedMags.Johnson_V) == ExportedMags.Johnson_V) { ExportMagnitudes(FilterResponseDatabase.Instance.Johnson_V, spectra, standardSpectras, output); } if ((mags & ExportedMags.Johnson_R) == ExportedMags.Johnson_R) { ExportMagnitudes(FilterResponseDatabase.Instance.Johnson_R, spectra, standardSpectras, output); } if ((mags & ExportedMags.Sloan_g) == ExportedMags.Sloan_g) { ExportMagnitudes(FilterResponseDatabase.Instance.SLOAN_g, spectra, standardSpectras, output); } if ((mags & ExportedMags.Sloan_r) == ExportedMags.Sloan_r) { ExportMagnitudes(FilterResponseDatabase.Instance.SLOAN_r, spectra, standardSpectras, output); } if ((mags & ExportedMags.Sloan_i) == ExportedMags.Sloan_i) { ExportMagnitudes(FilterResponseDatabase.Instance.SLOAN_i, spectra, standardSpectras, output); } }
private void btnOK_Click(object sender, EventArgs e) { SelectedExportMags = ExportedMags.None; if (cbxExpostSyntheticMags.Checked) { if (cb_B.Checked) SelectedExportMags |= ExportedMags.Johnson_B; if (cb_V.Checked) SelectedExportMags |= ExportedMags.Johnson_V; if (cb_R.Checked) SelectedExportMags |= ExportedMags.Johnson_R; if (cb_Sloan_g.Checked) SelectedExportMags |= ExportedMags.Sloan_g; if (cb_Sloan_r.Checked) SelectedExportMags |= ExportedMags.Sloan_r; if (cb_Sloan_i.Checked) SelectedExportMags |= ExportedMags.Sloan_i; } DialogResult = DialogResult.OK; Close(); }
internal void ExportMagnitudes(ExportedMags mags, List<AbsFluxSpectra> spectra, List<AbsFluxSpectra> standardSpectras, StringBuilder output) { if ((mags & ExportedMags.Johnson_B) == ExportedMags.Johnson_B) ExportMagnitudes(FilterResponseDatabase.Instance.Johnson_B, spectra, standardSpectras, output); if ((mags & ExportedMags.Johnson_V) == ExportedMags.Johnson_V) ExportMagnitudes(FilterResponseDatabase.Instance.Johnson_V, spectra, standardSpectras, output); if ((mags & ExportedMags.Johnson_R) == ExportedMags.Johnson_R) ExportMagnitudes(FilterResponseDatabase.Instance.Johnson_R, spectra, standardSpectras, output); if ((mags & ExportedMags.Sloan_g) == ExportedMags.Sloan_g) ExportMagnitudes(FilterResponseDatabase.Instance.SLOAN_g, spectra, standardSpectras, output); if ((mags & ExportedMags.Sloan_r) == ExportedMags.Sloan_r) ExportMagnitudes(FilterResponseDatabase.Instance.SLOAN_r, spectra, standardSpectras, output); if ((mags & ExportedMags.Sloan_i) == ExportedMags.Sloan_i) ExportMagnitudes(FilterResponseDatabase.Instance.SLOAN_i, spectra, standardSpectras, output); }
public void ExportProgramStarsData(string fileName, ExportedMags exportedMags) { if (IsCalibrated) { var output = new StringBuilder(); var programSpectras = m_SpectraList.Where(x => x.m_CalSpecStar == null).ToList(); var standardSpectras = m_SpectraList.Where(x => x.m_CalSpecStar != null).ToList(); output.Append("Wavelength"); for (int j = 0; j < programSpectras.Count; j++) { output.Append(","); output.Append(programSpectras[j].ToString()); } output.AppendLine(); if (exportedMags != ExportedMags.None) { var syntheticMagnitudeProducer = new SyntheticMagnitudeProducer(); syntheticMagnitudeProducer.ExportMagnitudes(exportedMags, programSpectras, standardSpectras, output); } for (int i = 0; i < m_SpectraList[0].ResolvedWavelengths.Count; i++) { double w = m_SpectraList[0].ResolvedWavelengths[i]; output.Append(w.ToString()); for (int j = 0; j < programSpectras.Count; j++) { output.Append(","); output.Append(programSpectras[j].AbsoluteFluxes[i].ToString()); } output.AppendLine(); } File.WriteAllText(fileName, output.ToString()); } }
public void ExportProgramStarsData(string fileName, ExportedMags exportedMags) { if (IsCalibrated) { var output = new StringBuilder(); var programSpectras = m_SpectraList.Where(x => x.m_CalSpecStar == null).ToList(); var standardSpectras = m_SpectraList.Where(x => x.m_CalSpecStar != null).ToList(); output.Append("Wavelength"); for (int j = 0; j < programSpectras.Count; j++) { output.Append(","); output.Append(programSpectras[j].ToString()); } output.AppendLine(); if (exportedMags != ExportedMags.None) { var syntheticMagnitudeProducer = new SyntheticMagnitudeProducer(); syntheticMagnitudeProducer.ExportMagnitudes(exportedMags, programSpectras, standardSpectras, output); } for (int i = 0; i < m_SpectraList[0].ResolvedWavelengths.Count; i++) { double w = m_SpectraList[0].ResolvedWavelengths[i]; output.Append(w.ToString()); for (int j = 0; j < programSpectras.Count; j++) { output.Append(","); output.Append(programSpectras[j].AbsoluteFluxes[i].ToString()); } output.AppendLine(); } File.WriteAllText(fileName, output.ToString()); } }