-
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
adagucserverEC/CDataPostProcessors/CDataPostProcessor_SolarTerminator.cpp
Outdated
Show resolved
Hide resolved
adagucserverEC/CDataPostProcessors/CDataPostProcessor_SolarTerminator.h
Outdated
Show resolved
Hide resolved
f7bac5d
to
b58596c
Compare
adagucserverEC/CRequest.cpp
Outdated
printf("%s%c%c\n", "Content-Type:image/png", 13, 10); | ||
image.printImagePng8(true); | ||
CDBDebug("in special liveupdate case with timesteps %d", dataSources[j]->getNumTimeSteps()); | ||
if (dataSources[j]->cfgLayer->DataPostProc.empty()) { |
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 place this code inside layerTypeLiveUpdateRenderIntoDrawImage? We are trying to make CRequest.cpp a bit smaller
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.
Yes, I added some aux functions within the LayerTypeLiveUpdate to deal with the case of the Solar Terminator
@@ -289,7 +289,9 @@ int storeLayerStyleListIntoMetadataDb(MetadataLayer *metadataLayer) { | |||
} | |||
|
|||
int loadLayerStyleListFromMetadataDb(MetadataLayer *metadataLayer) { | |||
if (metadataLayer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded || metadataLayer->dataSource->dLayerType == CConfigReaderLayerTypeLiveUpdate) { | |||
CDBWarning("loadLayerStyleListFromMetadataDb start"); |
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.
This should be removed
@@ -215,7 +215,8 @@ int CXMLGen::getWMS_1_1_1_Capabilities(CT::string *XMLDoc, std::vector<MetadataL | |||
addErrorInXMLForMisconfiguredLayer(XMLDoc, layer); | |||
} | |||
if (layer->hasError == 0) { | |||
XMLDoc->printconcat("<Layer queryable=\"%d\" opaque=\"1\" cascaded=\"%d\">\n", layer->layerMetadata.isQueryable, layer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded ? 1 : 0); | |||
XMLDoc->printconcat("<Layer queryable=\"%d\" opaque=\"1\" cascaded=\"%d\">\n", layer->layerMetadata.isQueryable, |
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.
Would it be possible to derive isQueryable in the layerMetadata section? Then other code can rely on the same checks too.
</Style> | ||
|
||
<Configuration> | ||
<Layer type="liveupdate"> |
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.
A layer should have a Name element
</Style> | ||
|
||
<Layer type="liveupdate"> | ||
<FilePath filter="" gfi_openall="true">{ADAGUC_PATH}data/datasets/solt.nc</FilePath> |
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.
Should have a Name element
|
||
</Style> | ||
|
||
<Layer type="liveupdate"> |
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.
Should have a Name element
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.