public class AuxFileService extends Object implements AuxiliaryService
AuxiliaryService
providing data from
the auxiliary files written by the telescopes data acquisition system.
Given the path to the aux folder, that is the folder containing all the auxiliary files for FACT.
This service will read the requested data and store them in a map of AuxPoint
.
Only aux files newer than 2012 are supported!
Simply provide the 'auxFolder' url to the basepath of the aux files e.g. '/fact/aux/'
Optionally you can also provide the path to the folder containing the aux data for that specific night e.g. '/fact/aux/2013/01/02/'
Because one might want read from multiple sources at once, and many streams are accessing this service at once, or one simply wants to access many different aux files the data from one file is cached into a guava cache. This saves us the overhead of keeping tracks of different files in some custom structure.
Created by kaibrugge on 07.10.14.
Modifier and Type | Field and Description |
---|---|
stream.io.SourceURL |
auxFolder |
Constructor and Description |
---|
AuxFileService() |
Modifier and Type | Method and Description |
---|---|
AuxPoint |
getAuxiliaryData(AuxiliaryServiceName serviceName,
ZonedDateTime eventTimeStamp,
AuxPointStrategy strategy)
This method returns an AuxPoint according to the strategy and the time stamp passed to this method.
|
SortedSet<AuxPoint> |
getAuxiliaryDataForWholeNight(AuxiliaryServiceName serviceName,
ZonedDateTime night)
This method returns all AuxPoints for the whole night given by the 'night' timestamp.
|
void |
reset() |
void |
setAuxFolder(stream.io.SourceURL auxFolder) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
unixTimeUTCToDateTime, unixTimeUTCToDateTime
@Parameter(required=true, description="The url pointing to the path containing a the auxilary data in FACTS canonical folder structure.") public stream.io.SourceURL auxFolder
public void setAuxFolder(stream.io.SourceURL auxFolder)
public AuxPoint getAuxiliaryData(AuxiliaryServiceName serviceName, ZonedDateTime eventTimeStamp, AuxPointStrategy strategy) throws IOException
AuxPoint trackingPoint = auxService.getAuxiliaryData(AuxiliaryServiceName.DRIVE_CONTROL_TRACKING_POSITION, timeStamp, closest); double ra = trackingPoint.getDouble("Ra");
getAuxiliaryData
in interface AuxiliaryService
serviceName
- The name of the service.eventTimeStamp
- The time stamp of the current raw data event.strategy
- One of the strategies provided.IOException
- when no auxpoint can be found for given timestamppublic SortedSet<AuxPoint> getAuxiliaryDataForWholeNight(AuxiliaryServiceName serviceName, ZonedDateTime night) throws IOException
IOException
- when no auxpoint can be found for the given nightCopyright © 2019. All rights reserved.