Skip to content
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

JSON to csv for SKATE #5

Open
aringler-usgs opened this issue Mar 8, 2019 · 7 comments
Open

JSON to csv for SKATE #5

aringler-usgs opened this issue Mar 8, 2019 · 7 comments

Comments

@aringler-usgs
Copy link

Hello, Andy suggested I put an issue here as someone might be able to help. A student intern at the Albuquerque Seismological Laboratory has been starting to work with your digitized files.

We are a bit confused about going from json files to the the assignment.csv file. Our question is: given the json files how do we produce the assignment.csv file? Thanks for any help you can provide.

@bennlich
Copy link
Collaborator

bennlich commented Mar 8, 2019

Hey @aringler-usgs. Could you add some context about what you are trying to achieve? I don't recall an "assignment.csv" file in particular, but might be able to help if you provide some more detail about what you're looking to do. Here's what comes to mind:

  1. You can download meanlines.json, roi.json, segments.json, and assignment.json with the "Download Data" button in the lower right corner of the editor:

screenshot from 2019-03-08 09-42-01

screenshot from https://seismo.redfish.com/#/edit/010171_1908_0028_04.png

I'm pretty sure the assignment.json file will only be included in this download if the segment assignment algorithm has been executed for this seismogram in the past (which is not the case for many seismograms).

  1. You can download a csv of all the centerline points with the "Download CSV" button (right below the "Download Data" button)

But I don't recall an "assignment.csv"...

@aringler-usgs
Copy link
Author

Hello @bennlich thanks for the reply. The assignment.csv we are talking about is the result from clicking on the download.csv button in the screenshot you took. I believe that is the button you are referring to in 2.

What we are ultimately trying to do is convert these digitized records into miniseed. I think we know how to do this with the .csv files, but we are a bit confused on how we might do this from the json files.

If you think there is a better approach or we are confused we would appreciate any help you could provide.

Thanks again!
Adam

@mariusnita
Copy link
Collaborator

For what it's worth, the code that produces the .csv is here but might not be trivial to understand, and you might come up with your own variation: https://github.com/retrievertech/seismogram-app/blob/master/client/src/edit/DataHandler.svc.js#L63-L157

It's a combination of segments, meanlines, and assignments:

  • segments.json is a geojson of segments (multilines) each with a unique ID
  • meanlines.json is a geojson of lines each with a unique ID
  • assignment.json assigns to each mean line ID a list of segment IDs

In the csv, for example the x0 and y0 columns represent the meanline with ID 0, and the data in those columns are x,y points derived from the segments (from segments.json) that are assigned to meanline 0 in assignments.json.

@bennlich
Copy link
Collaborator

bennlich commented Mar 9, 2019

What we are ultimately trying to do is convert these digitized records into miniseed. I think we know how to do this with the .csv files, but we are a bit confused on how we might do this from the json files.

Hey @aringler-usgs. I'm confused about why you are trying to create miniseeds from the json files if you are able to do it successfully with the csv.

Is it because there are some seismograms for which you are unable to download the csv? (If so, could you send a link?)

@aringler-usgs
Copy link
Author

Hello @bennlich we get the following error for some of the seismograms, when we try to download them. Attached is the screenshot. The error doesn't say much. It appears that this one no longer gives an error. Perhaps we did something wrong once?

error

We are not that familiar with this code. So it could be on our end. We will try to send more examples when we find them.

@mariusnita thanks for pointing out the relevant section of the code. Hopefully we can get all of the ncessary csv file, but this provides us another option.

Thanks,
Adam

@bennlich
Copy link
Collaborator

Hey @aringler-usgs that's definitely an odd screenshot. It's strange that some of the lines are in color and others are red. Usually the lines are all red if there is no assignment data, or all in color if there is assignment data.

Next time you see an error, try opening up the developer tools console and see if there's more information there.

Let us know how it goes!

@retrievertech
Copy link
Owner

retrievertech commented Mar 11, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants