Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SurfaceBlackbody method #321

Merged
merged 4 commits into from
Mar 25, 2021
Merged

Conversation

Smpljack
Copy link
Contributor

@Smpljack Smpljack commented Mar 8, 2021

Add SurfaceBlackbody method, which calculates surface emission and surface emission jacobian for a blackbody surface.
I use this method for retrieving the surface temperature in the infrared (IASI).
Implementation is based on SurfaceTessem and SurfaceFastem.

functions similiarly to SurfaceFastem, but instead of applying
the Fastem surface model to derive surface jacobians, it simply
assumes that the surface is a blackbody and the surface temperature
jacobian is the derivative of the Planck function.
Lines for numerical calculation of surface temperature jacobian
are replaced by function call.
@Smpljack Smpljack changed the title Add surface retrieval Add SurfaceBlackbody method Mar 8, 2021
@olemke
Copy link
Member

olemke commented Mar 9, 2021

Looks good. It would be nice to have a simple test case that actually calls the function and compares results against reference values. It could be either an ARTS controlfile or a Python script. Would be great if you could add one.

@erikssonpatrick
Copy link
Contributor

Got 5 min free and took a look as I was curious. Great that you calculate the derivative with dplanck_dt, as it gives an analytical value. But as far as I can see, the code starting on line 2707:
const Numeric dd = 0.01;
Matrix surface_los2;
surfaceBlackbody(surface_los2,
dsurface_rmatrix_dx[irq],
dsurface_emission_dx[irq],
atmosphere_dim,
f_grid,
stokes_dim,
rtp_pos,
rtp_los,
skin_t[0] + dd,
verbosity);
has no effect and can be removed.

If you have the energy, before you remove the code, check that
(dsurface_emission_dx[irq]-surface_emission)/dd
is close to what dplanck_dt gives. If not we have a problem somewhere.

@Smpljack
Copy link
Contributor Author

Thanks for taking a look, Patrick, good catch! The lines you pointed out were indeed of no purpose anymore, but just a leftover of the previous numerical calculation. I did the comparison of analytical and numerical dsurface_emission_dx calculations for the testcase of SurfaceBlackbody that is part of this PR (includes 10 frequencies at 183 GHz). The methods are very close, with absolute values of both on order 1e-17 and the absolute differences of `numerical-analytical' on order 1e-26, being positive for all frequencies.

@olemke olemke merged commit 5c3fb27 into atmtools:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants