Documentation
¶
Overview ¶
package sitelog handles a GNSS site with its antenna, receiver etc. including the history.
Index ¶
- func DecodeLatitudeDMS(input string) (float64, error)
- func DecodeLongitudeDMS(input string) (float64, error)
- func EncodeLatitudeDMS(lat float64) string
- func EncodeLongitudeDMS(lon float64) string
- func EncodeSitelog(w io.Writer, s *Site) error
- func IDByFilename(filename string) string
- func ParseSystemString(s string) (gnss.System, error)
- func ParseSystems(s string) (gnss.Systems, error)
- type Address
- type ApproximatePosition
- type CartesianPosition
- type Collocation
- type Contact
- type ContactInfo
- type DeltaXYZ
- type EffectiveDates
- type EnhancedValidationResult
- type FormInformation
- type FrequencyStandard
- type GeodeticPosition
- type HumiditySensor
- type IGSComplianceResult
- type IGSRequirement
- type Identification
- type Links
- type LocalEpisodicEffect
- type LocalTies
- type Location
- type MetadataCustodian
- type MoreInformation
- type MultipathSource
- type OtherInstrumentation
- type Party
- type Phone
- type PressureSensor
- type RadioInterference
- type ResponsibleAgency
- type Role
- type Self
- type SignalObstruction
- type Site
- func (s *Site) GetResponsibleAgency() (Party, error)
- func (s *Site) StationInfo() ([]StationInfo, error)
- func (s *Site) ValidateAndClean(force bool) error
- func (site *Site) ValidateEnhanced() *EnhancedValidationResult
- func (site *Site) ValidateIGSCompliance() *IGSComplianceResult
- func (site *Site) ValidateWithIGSCompliance() (*EnhancedValidationResult, *IGSComplianceResult)
- func (s *Site) ValidateWithUserFriendlyErrors() error
- type SiteLog
- type Sites
- type Standard
- type StationInfo
- type TemperatureSensor
- type ValidationError
- type ValidationErrors
- type WaterVaporSensor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeLatitudeDMS ¶ added in v0.18.13
DecodeLatitudeDMS parses a string representing latitude in the format +/-DDMMSS.SS (e.g., +402646.00 or -051210.5) into decimal degrees. '+' indicates North, '-' indicates South. DD must be 00-90. MM must be 00-59. SS.SS must be 00.00-59.99... Returns the latitude in decimal degrees and an error if the input is invalid.
func DecodeLongitudeDMS ¶ added in v0.18.13
DecodeLongitudeDMS parses a string representing longitude in the format +/-DDDMMSS.SS into decimal degrees using regex for strict format validation.
func EncodeLatitudeDMS ¶ added in v0.18.13
EncodeLatitudeDMS converts decimal latitude (-90 to +90) to a DMS string format +/-DDMMSS.SS. Rounds seconds to 2 decimal places.
func EncodeLongitudeDMS ¶ added in v0.18.13
EncodeLongitudeDMS converts decimal longitude (-180 to +180) to a DMS string format +/-DDDMMSS.SS. Rounds seconds to 2 decimal places.
func EncodeSitelog ¶
EncodeSitelog writes the Site s to the writer w in IGS sitelog format.
func IDByFilename ¶
IDByFilename extracts the siteID (usually nineCharID) from a IGS sitelog filename. The returned value is upper case. On failure an empty string is returned. The filename must comply to the IGS conventions, that means e.g. "wtzr00deu_20231030.log" or the deprecated short name "wtzr_20231030.log".
func ParseSystemString ¶
ParseSystemString parses a string representing a GNSS system.
Types ¶
type Address ¶
type Address struct {
PostalCode string `json:"postalCode"`
City string `json:"city"`
Country string `json:"country"`
AdministrativeArea string `json:"administrativeArea"` // Bundesland
DeliveryPoints []string `json:"deliveryPoints"` // Postfach?
EmailAddresses []string `json:"electronicMailAddresses" validate:"dive,email"`
Standard Standard `json:"standard"` // ?
Modifiable bool `json:"modifiable"` // ?
Interface string `json:"interface"` // "org.opengis.metadata.citation.ResponsibleParty"
}
Address stores an address. It's not possible to parse that information from a sitelog.
type ApproximatePosition ¶
type ApproximatePosition struct {
CartesianPosition CartesianPosition `json:"cartesianPosition"`
GeodeticPosition GeodeticPosition `json:"geodeticPosition"`
}
ApproximatePosition stores the approximate position of the site.
type CartesianPosition ¶
type CartesianPosition struct {
Type string `json:"type"` // "Point"
Coordinates [3]float64 `json:"coordinates"` // The XYZ-coordinates in meters.
}
CartesianPosition is a point specified by its XYZ-coordinates.
func NewCartesianPosition ¶
func NewCartesianPosition() CartesianPosition
NewCartesianPosition inits a Cartesian Point Position.
type Collocation ¶
type Collocation struct {
InstrumentType string `json:"instrumentType"` // GPS/GLONASS/DORIS/PRARE/SLR/VLBI/TIME/etc
Status string `json:"status"` // PERMANENT/MOBILE
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
Collocation describes collocation instruments.
type ContactInfo ¶
type ContactInfo struct {
ContactInstructions string `json:"contactInstructions"`
HoursOfService string `json:"hoursOfService"`
OnLineResource string `json:"onLineResource"`
Address Address `json:"address"`
Phone Phone `json:"phone"`
Standard Standard `json:"standard"`
Modifiable bool `json:"modifiable"`
Interface string `json:"interface"` // "org.opengis.metadata.citation.Contact"
}
ContactInfo stores the address, phones etc. of an party/organisation.
type EffectiveDates ¶
EffectiveDates holds a start- and enddate.
type EnhancedValidationResult ¶ added in v0.24.0
type EnhancedValidationResult struct {
IsValid bool `json:"isValid"`
Errors []ValidationError `json:"errors,omitempty"`
Warnings []string `json:"warnings,omitempty"`
Suggestions []string `json:"suggestions,omitempty"`
}
EnhancedValidationResult contains detailed validation results
type FormInformation ¶
type FormInformation struct {
PreparedBy string `json:"preparedBy"`
DatePrepared time.Time `json:"datePrepared" validate:"required"`
ReportType string `json:"reportType"` // NEW/UPDATE
}
FormInformation stores sitelog metdadata.
type FrequencyStandard ¶
type FrequencyStandard struct {
Type string `json:"type"` // INTERNAL or EXTERNAL H-MASER/CESIUM/etc.
InputFrequency string `json:"inputFrequency"` // if external
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
FrequencyStandard describes the internal or external frequency input.
type GeodeticPosition ¶
type GeodeticPosition struct {
Type string `json:"type"` // "Point"
Coordinates [3]float64 `json:"coordinates"` // The latitude, longitude and ellipsoid height in degrees and meters.
}
GeodeticPosition is a point specified by lat,lon and ellipsoid height.
func NewGeodeticPosition ¶
func NewGeodeticPosition() GeodeticPosition
NewGeodeticPosition inits a Geodetic Point Position.
type HumiditySensor ¶
type HumiditySensor struct {
Type string `json:"type"` // Humidity Sensor Model
Manufacturer string `json:"manufacturer"`
SerialNumber string `json:"serialNumber"`
DataSamplingInterval *float64 `json:"dataSamplingInterval"` // in secs
Accuracy *float64 `json:"accuracyPercentRelativeHumidity"` // in % relative humidity
Aspiration string `json:"aspiration"` // UNASPIRATED, NATURAL, FAN etc.
HeightDiffToAntenna *float64 `json:"heightDiffToAntenna"` // in meter
CalibrationDate time.Time `json:"calibrationDate"`
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
HumiditySensor specifies a humidity sensor.
type IGSComplianceResult ¶ added in v0.24.0
type IGSComplianceResult struct {
IsCompliant bool `json:"isCompliant"`
Errors []ValidationError `json:"errors,omitempty"`
Warnings []string `json:"warnings,omitempty"`
Suggestions []string `json:"suggestions,omitempty"`
IGSRequirements []IGSRequirement `json:"igsRequirements,omitempty"`
}
IGSComplianceResult contains IGS-specific compliance validation results
type IGSRequirement ¶ added in v0.24.0
type IGSRequirement struct {
Section string `json:"section"`
Requirement string `json:"requirement"`
Status string `json:"status"` // "compliant", "warning", "error", "missing"
Details string `json:"details,omitempty"`
}
IGSRequirement represents a specific IGS requirement check
type Identification ¶
type Identification struct {
Name string `json:"siteName" validate:"required"` // City or nearest town
FourCharacterID string `json:"fourCharacterId"` // Deprecated: use NineCharacterID
NineCharacterID string `json:"nineCharacterId" validate:"omitempty,alphanum,len=9"` // or store singel fields? ID
MonumentInscription string `json:"monumentInscription"` //
DOMESNumber string `json:"iersDOMESNumber"` // IERS Domes number, A9
CDPNumber string `json:"cdpNumber"` // From NASA Crustal Dynamics Project (CDP), see https://cddis.nasa.gov/Programs/Historical_Programs.html.
MonumentDescription string `json:"monumentDescription"` // PILLAR/BRASS PLATE/STEEL MAST/etc
HeightOfMonument *float64 `json:"heightOfMonument"` // in meter?
MonumentFoundation string `json:"monumentFoundation"` // STEEL RODS, CONCRETE BLOCK, ROOF, etc
FoundationDepth *float64 `json:"foundationDepth"` // in meter
MarkerDescription string `json:"markerDescription"` // CHISELLED CROSS/DIVOT/BRASS NAIL/etc
DateInstalled time.Time `json:"dateInstalled"` //
GeologicCharacteristic string `json:"geologicCharacteristic"` // BEDROCK/CLAY/CONGLOMERATE/GRAVEL/SAND/etc
BedrockType string `json:"bedrockType"` // IGNEOUS/METAMORPHIC/SEDIMENTARY -> new type BedrockType
BedrockCondition string `json:"bedrockCondition"` // FRESH/JOINTED/WEATHERED
FractureSpacing string `json:"fractureSpacing"` // 1-10 cm/11-50 cm/51-200 cm/over 200 cm
FaultZonesNearby string `json:"faultZonesNearby"` // YES/NO/Name of the zone
DistanceActivity string `json:"distanceActivity"`
Notes string `json:"notes"`
}
Identification holds common fields about this site.
type LocalEpisodicEffect ¶
type LocalEpisodicEffect struct {
EffectiveDates EffectiveDates `json:"effectiveDates"`
Event string `json:"event"` // TREE CLEARING/CONSTRUCTION/etc
}
LocalEpisodicEffect is a local episodic effect that possibly affects data quality, defined in 10.
type LocalTies ¶
type LocalTies struct {
MarkerName string `json:"tiedMarkerName"`
MarkerUsage string `json:"tiedMarkerUsage"` // SLR/VLBI/LOCAL CONTROL/FOOTPRINT/etc
MarkerCDPNumber string `json:"tiedMarkerCdpNumber"` // A4
MarkerDomesNumber string `json:"tiedMarkerDomesNumber"` // A9
DifferentialFromMarker DeltaXYZ `json:"differentialFromMarker"` // in meter
Accuracy *float64 `json:"localSiteTieAccuracy"` // in mm
SurveyMethod string `json:"surveyMethod"` // GPS CAMPAIGN/TRILATERATION/TRIANGULATION/etc
DateMeasured time.Time `json:"dateMeasured"`
Notes string `json:"notes"`
}
LocalTies stores the surveyed local ties from one measurement.
type Location ¶
type Location struct {
City string `json:"city"`
State string `json:"state"`
Country string `json:"country"` // The 3-char country code is prefered.
TectonicPlate string `json:"tectonicPlate"`
ApproximatePosition ApproximatePosition `json:"approximatePosition" validate:"required"` // ITRF
Notes string `json:"notes"`
}
Location holds information about the location.
type MetadataCustodian ¶
type MetadataCustodian struct {
ContactTypeID int `json:"contactTypeId"`
Party Party `json:"party"`
}
The MetadataCustodian is responsible for the sites' metadata.
type MoreInformation ¶
type MoreInformation struct {
PrimaryDataCenter string `json:"primaryDataCenter"`
SecondaryDataCenter string `json:"secondaryDataCenter"`
URLForMoreInformation string `json:"urlForMoreInformation"`
SiteMap string `json:"siteMap"`
SiteDiagram string `json:"siteDiagram"`
HorizonMask string `json:"horizonMask"`
MonumentDescription string `json:"monumentDescription"`
SitePictures string `json:"sitePictures"`
Notes string `json:"notes"`
AntennaGraphicsWithDimensions string `json:"antennaGraphicsWithDimensions"`
InsertTextGraphicFromAntenna string `json:"insertTextGraphicFromAntenna"`
Doi string `json:"doi"`
}
MoreInformation about data centers, pictures etc., sitelog block 13
type MultipathSource ¶ added in v0.19.2
type MultipathSource struct {
Type string `json:"type"` // METAL ROOF/DOME/VLBI ANTENNA/etc
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
type OtherInstrumentation ¶ added in v0.19.2
type OtherInstrumentation struct {
Notes string `json:"notes"`
}
type Party ¶
type Party struct {
IndividualName string `json:"individualName"`
OrganisationName string `json:"organisationName"` // abbreviation
Abbreviation string `json:"abbreviation"` // additional field added by wiese
PositionName string `json:"positionName"` // ?
ContactInfo ContactInfo `json:"contactInfo"`
Role Role `json:"role"`
Standard Standard `json:"standard"`
Modifiable bool `json:"modifiable"`
Interface string `json:"interface"`
}
Party describes an organisation with contacts, addresses included.
type PressureSensor ¶
type PressureSensor struct {
Type string `json:"type"` // Pressure Sensor Model
Manufacturer string `json:"manufacturer"`
SerialNumber string `json:"serialNumber"`
DataSamplingInterval *float64 `json:"dataSamplingInterval"` // in secs
Accuracy *float64 `json:"accuracyHPa"` // in hPa
HeightDiffToAntenna *float64 `json:"heightDiffToAntenna"` // in meter
CalibrationDate time.Time `json:"calibrationDate"`
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
PressureSensor specifies a pressure sensor.
type RadioInterference ¶ added in v0.19.2
type RadioInterference struct {
Type string `json:"type"` // TV/CELL PHONE ANTENNA/RADAR/etc
ObservedDegradations string `json:"observedDegradations"`
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
type ResponsibleAgency ¶
type ResponsibleAgency struct {
ContactTypeID int `json:"contactTypeId"`
Party Party `json:"party"`
}
ResponsibleAgency is the responsible agency.
type SignalObstruction ¶ added in v0.19.2
type SignalObstruction struct {
Type string `json:"type"` // TREES/BUILDINGS/etc
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
type Site ¶
type Site struct {
ID string `json:"id"` // Station ID, EarthScope Datasource Identifier (EDID)
EntryDate time.Time `json:"entryDate"`
LastModifiedDate time.Time `json:"lastModifiedDate"`
FormInfo FormInformation `json:"formInformation"`
Ident Identification `json:"siteIdentification"`
Location Location `json:"siteLocation"`
Receivers []*metadata.Receiver `json:"gnssReceivers" validate:"required,min=1,dive,required"`
Antennas []*metadata.Antenna `json:"gnssAntennas" validate:"required,min=1,dive,required"`
LocalTies []LocalTies `json:"surveyedLocalTies"`
FrequencyStandards []FrequencyStandard `json:"frequencyStandards"`
Collocations []Collocation `json:"collocationInformation"`
HumiditySensors []HumiditySensor `json:"humiditySensors"`
PressureSensors []PressureSensor `json:"pressureSensors"`
TemperatureSensors []TemperatureSensor `json:"temperatureSensors"`
WaterVaporSensors []WaterVaporSensor `json:"waterVaporSensors"`
OtherInstrumentationLogItem []OtherInstrumentation `json:"otherInstrumentationLogItem"` // 8.5 Other Instrumentation
RadioInterferences []RadioInterference `json:"radioInterferences"` // 9.1
MultipathSourceLogItems []MultipathSource `json:"multipathSourceLogItems"` // 9.2
SignalObstructionLogItems []SignalObstruction `json:"signalObstructionLogItems"` // 9.3
LocalEpisodicEffectLogItems []LocalEpisodicEffect `json:"localEpisodicEffectLogItems"` // 10
Contacts []Contact `json:"siteContacts"` // 11. On-Site, Point of Contact Agency Information
ResponsibleAgencies []ResponsibleAgency `json:"responsibleParties"` // 12. Responsible Agency
MoreInformation MoreInformation `json:"moreInformation"` // 13
MetadataCustodians []MetadataCustodian `json:"siteMetadataCustodians"`
Warnings []error `json:"-"`
}
Site specifies a GNSS site.
func DecodeSitelog ¶
DecodeSitelog reads and parses the sitelog input stream and returns it as a site.
func FilterSubfieldsByTime ¶ added in v0.18.8
FilterSubfieldsByTime removes or retains only the subfields of a Site that are valid at the given time.
func (*Site) GetResponsibleAgency ¶
GetResponsibleAgency returns the responsible agency for questions about the operation of the site, regarding site log or RINEX errors etc. In the sitelog this is section "12. Responsible Agency" if available. If not available, return the "11. On-Site Point of Contact".
func (*Site) StationInfo ¶
func (s *Site) StationInfo() ([]StationInfo, error)
StationInfo returns the station information with all receiver and antenna changes since the installation of the site, as it is used for the bernese Station Information (STA file).
func (*Site) ValidateAndClean ¶
ValidateAndClean validates and cleans the site data. With input data often being lousy, the values are cleaned as much as possible before, missing fields e.g. dates are set if possible. With force being true, corrupt data will be cleaned with extra force as much as possible, e.g. adjust overlapping sensor dates, where it would otherwise return with an error.
func (*Site) ValidateEnhanced ¶ added in v0.24.0
func (site *Site) ValidateEnhanced() *EnhancedValidationResult
ValidateEnhanced performs comprehensive sitelog validation
func (*Site) ValidateIGSCompliance ¶ added in v0.24.0
func (site *Site) ValidateIGSCompliance() *IGSComplianceResult
ValidateIGSCompliance performs IGS-specific compliance validation
func (*Site) ValidateWithIGSCompliance ¶ added in v0.24.0
func (site *Site) ValidateWithIGSCompliance() (*EnhancedValidationResult, *IGSComplianceResult)
ValidateWithIGSCompliance performs both standard and IGS compliance validation
func (*Site) ValidateWithUserFriendlyErrors ¶ added in v0.24.0
ValidateWithUserFriendlyErrors validates a sitelog and returns user-friendly error messages
type StationInfo ¶
type StationInfo struct {
Name string // The 9-char or 4-char station name.
Description string // usually the city or town
DOMESNumber string
Flag string // "001"
From, To time.Time
Recv *metadata.Receiver
Ant *metadata.Antenna
Remark string // could be the Recv.Firmware if not otherwise used
}
StationInfo represents the receiver and antenna state for a time range.
func (*StationInfo) FourCharacterID ¶
func (sta *StationInfo) FourCharacterID() string
Returns the (old) short 4-char station name.
type TemperatureSensor ¶
type TemperatureSensor struct {
Type string `json:"type"` // Pressure Sensor Model
Manufacturer string `json:"manufacturer"`
SerialNumber string `json:"serialNumber"`
DataSamplingInterval *float64 `json:"dataSamplingInterval"` // in secs
Accuracy *float64 `json:"accuracyDegreesCelcius"` // in degrees
Aspiration string `json:"aspiration"` // UNASPIRATED, NATURAL, FAN etc.
HeightDiffToAntenna *float64 `json:"heightDiffToAntenna"` // in meter
CalibrationDate time.Time `json:"calibrationDate"`
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
TemperatureSensor specifies a temperature sensor.
type ValidationError ¶ added in v0.24.0
type ValidationError struct {
Field string `json:"field"`
Message string `json:"message"`
Value string `json:"value,omitempty"`
}
ValidationError represents a user-friendly validation error
type ValidationErrors ¶ added in v0.24.0
type ValidationErrors []ValidationError
ValidationErrors is a collection of validation errors
func (ValidationErrors) Error ¶ added in v0.24.0
func (ve ValidationErrors) Error() string
type WaterVaporSensor ¶
type WaterVaporSensor struct {
Type string `json:"type"`
Manufacturer string `json:"manufacturer"`
SerialNumber string `json:"serialNumber"`
DistanceToAntenna *float64 `json:"distanceToAntenna"`
HeightDiffToAntenna *float64 `json:"heightDiffToAntenna"`
CalibrationDate time.Time `json:"calibrationDate"`
EffectiveDates EffectiveDates `json:"effectiveDates"`
Notes string `json:"notes"`
}
WaterVaporSensor specifies a water-vapor sensor.