Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

fed: Difference between fdsnws-station text and xml #40

Open
damb opened this issue Jul 30, 2018 · 7 comments
Open

fed: Difference between fdsnws-station text and xml #40

damb opened this issue Jul 30, 2018 · 7 comments

Comments

@damb
Copy link
Contributor

damb commented Jul 30, 2018

Continued discussion from [email protected].


Dear All,

At RESIF we are testing eida-federator, we are doing manual and automatic tests.

For our automatic tests we are using one script in Python and we will share it next week. For now it seems working well however we have strange things between text format and xml format

For example with net=Z3 eida-federator provides two different results:

federator-testing.ethz.ch/fdsnws/station/1/query?level=network&network=Z3&format=text

#Network|Description|StartTime|EndTime|TotalStations
Z3|AlpArray Seismic Network (AASN) temporary
component|2015-01-01T00:00:00|2020-07-01T00:00:00|29
Z3|AlpArray Seismic Network (AASN) temporary
component|2015-01-01T00:00:00|2020-07-01T00:00:00|66
Z3|AlpArray DSEBRA|1980-01-01T00:00:00||92
Z3|AlpArray Seismic Network (AASN) temporary
component|2015-01-01T00:00:00|2020-07-01T00:00:00|51
Z3|Egelados project, RUB Bochum,
Germany|2005-06-05T00:00:00|2007-04-30T00:00:00|56
Z3|AlpArray backbone temporary
stations|2015-07-01T00:00:00|2020-07-31T00:00:00|68
federator-testing.ethz.ch/fdsnws/station/1/query?level=network&network=Z3&format=xml

<FDSNStationXML schemaVersion="1.0">
<Source>EIDA</Source>
<Created>2018-07-27T10:11:57.586061</Created>
<Network code="Z3"
alternateCode="ALPARRAY"
startDate="2015-07-01T00:00:00.000000"
endDate="2020-07-31T00:00:00.000000"
restrictedStatus="closed">
<Description>AlpArray backbone temporary stations</Description>
<Comment>
<Value>DOI:http://dx.doi.org/10.12686/alparray/z3_2015</Value>
<BeginEffectiveTime>2015-07-01T00:00:00.000000</BeginEffectiveTime>
<EndEffectiveTime>2020-07-31T00:00:00.000000</EndEffectiveTime>
<Author><Name>Resif Information System</Name>
<Agency>Réseau Sismologique et géodésique Français (RESIF)</Agency>
<Email>[email protected]</Email></Author>
</Comment>
<TotalNumberStations>68</TotalNumberStations>
<SelectedNumberStations>306</SelectedNumberStations>
</Network>
</FDSNStationXML>

Best,
Gregory

@damb damb added the bug label Jul 30, 2018
@damb damb added this to the Federator streaming milestone Jul 30, 2018
@damb damb self-assigned this Jul 30, 2018
@Jollyfant
Copy link
Contributor

Is that because the network in the StationXML is being combined to a single entity? It is pretty tricky to combine "identical" networks if their descriptions are even slightly different.

@damb
Copy link
Contributor Author

damb commented Jul 30, 2018

Hi Gregory,

in general fdsnws-station text and xml is handled completely separately.

However, there is a bug in https://github.com/EIDA/mediatorws/blob/master/eidangservices/federator/server/task.py#L314-L317. It exclusively occurs for fdsnws-station-xml and level=network in case the client requests a network which is distributed over multiple EIDA nodes (e.g. net=Z3).

I'm going to provide a fix.

cheers

@damb
Copy link
Contributor Author

damb commented Jul 30, 2018

fdsnws-station-xml and level=station|channel|response also seems to be affected for net=Z3 (i.e. a distributed network). Correct, @Jollyfant, unfortunately I did not take <Description></Description> into account while merging.

@Jollyfant
Copy link
Contributor

Yeah but we should probably agree within EIDA to describe Z3 in am identical way, so for users it becomes clear that it is one network.

@damb
Copy link
Contributor Author

damb commented Jul 30, 2018 via email

damb pushed a commit that referenced this issue Jul 31, 2018
  - `StationXMLNetworkCombinerTask handles mutliple network epochs i.e.
  either from a single EIDA node or from multiple EIDA nodes
  - Since we are merging epochs for `fdsnws-station-xml` we produce
  automatically inconsitencies when comparing
  `fdsnws-station?format=xml&level=network` and
  `fdsnws-station?format=text&level=network`. That is why we should
  consider implementing `StationTextRequestOrocessor` with merging
  facilities when used with `level=network`
  - While merging `<Channel></Channel>` epoch elements they are always
  appended to already existing `<Station></Station>` epoch elements.
  Hence, no *real* merging is performed.

commit c7fd068edc32985db92955958e34d8ea02c8075b
Author: Daniel Armbruster <[email protected]>
Date:   Tue Jul 31 16:10:54 2018 +0200

    fed: remove comment

commit 12f21b6bbaafe68fd8df2286c2521113934276b7
Author: Daniel Armbruster <[email protected]>
Date:   Tue Jul 31 15:57:17 2018 +0200

    fed: proceeding: bugfix (#40)

      - compute sizes correctly

commit 52e812949e737d30ea50082e5dc0f39bc30dcb92
Author: Daniel Armbruster <[email protected]>
Date:   Tue Jul 31 15:20:15 2018 +0200

    fed: proceeding: bugfix (#40)

      - implementation for `fdsnws-station-xml?level=channel` ready

commit 788ba112c4188a0ddcd41b1a87768f1c448b98aa
Author: Daniel Armbruster <[email protected]>
Date:   Tue Jul 31 14:24:06 2018 +0200

    fed: proceeding: bugfix (#40) - unittests

commit f795630f3422263435253c1b06965dcd6e243fa1
Author: Daniel Armbruster <[email protected]>
Date:   Tue Jul 31 14:22:54 2018 +0200

     fed: proceeding: bugfix (#40)

      - implementation for `fdsnws-station-xml?level=station` working

commit fd9ccdcb4dba3e5342bc7300d292e002997c3096
Author: Daniel Armbruster <[email protected]>
Date:   Mon Jul 30 16:49:48 2018 +0200

    fed: proceeding: bugfix (#40)

      - implementation for `fdsnws-station-xml?level=network` working

commit 068fe26320d2166b48573bff59ab956421635121
Author: Daniel Armbruster <[email protected]>
Date:   Mon Jul 30 15:04:20 2018 +0200

    fed: `StationXMLDownloadTask` obsolete.
@damb
Copy link
Contributor Author

damb commented Jul 31, 2018

Pushed new image to DockerHub containing the latest changes from next.

Note:
For fdsnws-station/format=text currently no merging is performed. Hence, the results are different when comparing with fdsnws-station/format=xml:

fdsnws/station/1/query?level=network&net=Z3&format=text

Z3|AlpArray Seismic Network (AASN) temporary component|2015-01-01T00:00:00|2020-07-01T00:00:00|29
Z3|AlpArray DSEBRA|1980-01-01T00:00:00||93
Z3|AlpArray Seismic Network (AASN) temporary component|2015-01-01T00:00:00|2020-07-01T00:00:00|66
Z3|AlpArray backbone temporary stations|2015-07-01T00:00:00|2020-07-31T00:00:00|68
Z3|Egelados project, RUB Bochum, Germany|2005-06-05T00:00:00|2007-04-30T00:00:00|56
fdsnws/station/1/query?level=network&net=Z3&format=xml

<FDSNStationXML schemaVersion="1.0"><Source>EIDA</Source><Created>2018-07-31T15:07:00.076980</Created>
<Network code="Z3" startDate="2015-01-01T00:00:00" endDate="2020-07-01T00:00:00" restrictedStatus="closed"><Description>AlpArray Seismic Network (AASN) temporary component</Description></Network>
<Network code="Z3" startDate="2005-06-05T00:00:00" endDate="2007-04-30T00:00:00" restrictedStatus="open"><Description>Egelados project, RUB Bochum, Germany</Description></Network>
<Network code="Z3" startDate="1980-01-01T00:00:00" restrictedStatus="closed"><Description>AlpArray DSEBRA</Description></Network>
<Network code="Z3" alternateCode="ALPARRAY" startDate="2015-07-01T00:00:00.000000" endDate="2020-07-31T00:00:00.000000" restrictedStatus="closed"><Comment><Value>DOI:http://dx.doi.org/10.12686/alparray/z3_2015</Value><BeginEffectiveTime>2015-07-01T00:00:00.000000</BeginEffectiveTime><EndEffectiveTime>2020-07-31T00:00:00.000000</EndEffectiveTime><Author><Name>Resif Information System</Name><Agency>Réseau Sismologique et géodésique Français (RESIF)</Agency><Email>[email protected]</Email></Author></Comment><Description>AlpArray backbone temporary stations</Description><SelectedNumberStations>306</SelectedNumberStations><TotalNumberStations>68</TotalNumberStations></Network>
</FDSNStationXML>

However, it only seems to make a difference when level=network.

@damb
Copy link
Contributor Author

damb commented Aug 2, 2018

fdsnws/station/1/query?level=network&net=Z3&format=text

Z3|AlpArray Seismic Network (AASN) temporary component|2015-01-01T00:00:00|2020-07-01T00:00:00|29
Z3|AlpArray Seismic Network (AASN) temporary component|2015-01-01T00:00:00|2020-07-01T00:00:00|66
[...]

@kaestli:
I considered merging the response for fdsnws/station/1/query?level=network&format=text. Usually when having multiple network epochs IMO this seems to make sense. On the other side the number of TotalStations might differ which simply could be added. In case of net=Z3 this probably would work out properly.
For a more general implementation, however, this is not satisfying since always there might occur differences between federated fdsnws-station?format=text&level=network and fdsnws-station?format=xml&level=network results (fdsnws-station?format=xml provides merging under consideration of all <Network></Network> epoch properties (attributes and child elements)). Hence, merging fdsnws-station?format=text&level=network exclusively does make sense when having access to all <Network></Network> epoch properties.
In case of serving fdsnws-station?format=text&level=network directly using eida-stationlite both merging and keeping consistency with fdsnws-station?format=xml&level=network might be feasible (see: #28). Although, this would imply we'd have to harvest <Network></Network> epoch related information additionally.

@damb damb changed the title Federator: Difference between fdsnws-station text and xml fed: Difference between fdsnws-station text and xml Sep 21, 2018
@damb damb removed this from the Federator streaming milestone Sep 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants