Skip to content

Commit

Permalink
Merge pull request #2326 from andrewwstephens/feature/REL-4637
Browse files Browse the repository at this point in the history
REL-4637 Fix IGRINS-2 ITC reporting of Fowler Samples when requesting time to achive a S/N
  • Loading branch information
cquiroz authored Jan 31, 2025
2 parents 4e65009 + f2b9028 commit b97dd01
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ private void writeSpectroscopyOutput(final UUID id, final SpectroscopyResult[] r
final CalculationMethod calcMethod = p.observation().calculationMethod();
final SpectroscopyResult result = results[0];
final double iqAtSource = result.iqCalc().getImageQuality();
double exposureTime = recipe.getExposureTime();
numberExposures = recipe.getNumberExposures();
String str;

_println("");

_println(String.format("Read noise: %.2f e- in %s and %.2f e- in %s using %d Fowler samples.",
results[0].instrument().getReadNoise(), ((Igrins2) results[0].instrument()).getWaveBand(),
results[1].instrument().getReadNoise(), ((Igrins2) results[1].instrument()).getWaveBand(),
((Igrins2) results[0].instrument()).getFowlerSamples()));
_println(String.format("Read noise: %.2f e- in %s, and %.2f e- in %s, using %d Fowler samples.",
((Igrins2) results[0].instrument()).getReadNoise(exposureTime), ((Igrins2) results[0].instrument()).getWaveBand(),
((Igrins2) results[1].instrument()).getReadNoise(exposureTime), ((Igrins2) results[1].instrument()).getWaveBand(),
((Igrins2) results[0].instrument()).getFowlerSamples(exposureTime)));

_println(String.format("Dark current: %.4f e-/s/pix in %s and %.4f e-/s/pix in %s.",
results[0].instrument().getDarkCurrent(), ((Igrins2) results[0].instrument()).getWaveBand(),
Expand All @@ -64,14 +66,12 @@ private void writeSpectroscopyOutput(final UUID id, final SpectroscopyResult[] r
if (result.aoSystem().isDefined()) { _println(HtmlPrinter.printSummary((Altair) result.aoSystem().get())); }

_printSoftwareAperture(result, 1 / mainInstrument.getSlitWidth());
_println(String.format("Derived image size(FWHM) for a point source = %.2f arcsec", iqAtSource));
_println(String.format("Derived image size (FWHM) for a point source = %.2f arcsec.", iqAtSource));
_println("");

if (calcMethod instanceof SpectroscopyInt) {
double exposureTime = recipe.getExposureTime();
numberExposures = recipe.getNumberExposures();
if (exposureTime < 5.0) {
str = "Total integration time = %.1f seconds (%d x %.1f s), of which %.1f seconds is on source.";
if (exposureTime < 10) {
str = "Total integration time = %.1f seconds (%d x %.2f s), of which %.1f seconds is on source.";
} else {
str = "Total integration time = %.0f seconds (%d x %.0f s), of which %.0f seconds is on source.";
}
Expand Down
2 changes: 1 addition & 1 deletion bundle/edu.gemini.itc.web/src/main/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ <h1>Integration Time Calculator Test Page</h1>
<br>
Plots of data files: <a href='../itcdocs/plots/index.html'>../itcdocs/plots/</a>
<hr>
<footer>Last updated 2025-Jan-24</footer>
<footer>Last updated 2025-Jan-30</footer>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,22 @@ public Igrins2(final Igrins2Parameters igp, final ObservationDetails odp, Igrins
@Override
public double getReadNoise() { return _readNoise; } // (electrons)

public double getReadNoise(double exposureTime) {
return Igrins2$.MODULE$.readNoise(exposureTime, _arm.getMagnitudeBand()); // (electrons)
}

public double getMinExposureTime() { return Igrins2$.MODULE$.MinExposureTime().toSeconds(); }

public double getMaxExposureTime() { return Igrins2$.MODULE$.MaxExposureTime().toSeconds(); }

public double getDefaultExposureTime() { return Igrins2$.MODULE$.DefaultExposureTime().toSeconds(); }

public int getFowlerSamples() { return _fowlerSamples; }

public int getFowlerSamples(double exposureTime) {
return Igrins2$.MODULE$.fowlerSamples(exposureTime);
}

public String getDirectory() { return ITCConstants.LIB + "/" + INSTR_DIR; } // the directory with the data files

public double getWavelengthStart() { return _arm.getWavelengthStart(); } // (nanometers)
Expand Down
Loading

0 comments on commit b97dd01

Please sign in to comment.