-
Notifications
You must be signed in to change notification settings - Fork 26
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
Solar Terminator #404
base: master
Are you sure you want to change the base?
Solar Terminator #404
Conversation
const char *CDPPSolarTerminator::getId() { return "solarterminator"; } | ||
|
||
#define SIZE 255 | ||
void CDPPSolarTerminator::print_trace() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is print_trace still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think this is a very old copy/paste thing. I assumed it was a standard post processor thing and didn't look twice at it. Will remove!
adagucserverEC/CDataPostProcessors/CDataPostProcessor_SolarTerminator.h
Outdated
Show resolved
Hide resolved
f7bac5d
to
b58596c
Compare
@@ -0,0 +1,27 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the new option to https://github.com/KNMI/adaguc-server/blob/master/doc/configuration/Layer.md ?
Can you also write a tutorial in https://github.com/KNMI/adaguc-server/blob/master/doc/tutorials/Readme.md? E.g. copy this dataset configuration to the right place. And then looking at it in the viewer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good idea! Regarding Layer.md, I should probably add it under LiveUpdate, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have a not-so-good update. Basically the legend of the solar terminator is now broken (I noticed while making a screen capture for the documentation). If I make the GetLegendGraphic call it works fine (I have added a test for that), but when running Adaguc locally and accessing the dataset from the viewer, no styles are listed.
I think this is related to the metadata db setup (readFromDb is set to false). Maybe related to the variable/dimension check? There is a comment saying If variable name equals dimension name, values are stored in the database.
Any clues how to fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In adagucserverEC/utils/XMLGenUtils.cpp, line 751, you need to add ||
metadataLayer->dataSource->dLayerType == CConfigReaderLayerTypeLiveUpdate
Not sure what other consequences this has.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
This MR introduces the CDataPostProcessor that calculates the Solar Terminator, which will assign one of five standard categories to a pixel (day, night, astronomical twilight, nautical twilight, and civil twilight) based on the solar zenith angle. Three test cases have been added.
The solar terminator algorithm itself is based on a book (Astronomical Algorithms, by Jean Meeus) that provides an approximation. An old scan of the book is available here, if you're interested.
More considerations:
liveupdate
with no post processors, it will go the pre-existing route, creating an image with the timestamp.CDataWriter::addData
, so I have discarded this idea (for now). So for now, and empty netCDF file is used. Another problem is that the units in the legend depend on this and I could not find the way of overwriting this in the data post processor.