GithubHelp home page GithubHelp logo

scedc.jl's People

Contributors

tclements avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

scedc.jl's Issues

eventstream fails when day of year > 31

eventstream fails when the day of year requested is greater than 31 due to Dates.format not accepting day of years.

using SCEDC, Dates, AWSCore
aws = aws_config(region="us-west-2")
eventstream(aws,starttime=Date(2020,9,15)-Day(10),endtime=now(),minmagnitude=3.5)
ERROR: ArgumentError: Day: 250 out of range (1:31)
Stacktrace:
 [1] Date(::Int64, ::Int64, ::Int64) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/types.jl:223
 [2] parse at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/parse.jl:285 [inlined]
 [3] Date at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/io.jl:503 [inlined]
 [4] _broadcast_getindex_evalf at ./broadcast.jl:648 [inlined]
 [5] _broadcast_getindex at ./broadcast.jl:621 [inlined]
 [6] getindex at ./broadcast.jl:575 [inlined]
 [7] macro expansion at ./broadcast.jl:932 [inlined]
 [8] macro expansion at ./simdloop.jl:77 [inlined]
 [9] copyto! at ./broadcast.jl:931 [inlined]
 [10] copyto! at ./broadcast.jl:886 [inlined]
 [11] copy at ./broadcast.jl:862 [inlined]
 [12] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,Type{Date},Tuple{Array{String,1},Base.RefValue{DateFormat{:yyyy_ddd,Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'d'}}}}}}) at ./broadcast.jl:837
 [13] eventstream(::Dict{Symbol,Any}; starttime::Date, endtime::DateTime, minlatitude::Int64, maxlatitude::Int64, minlongitude::Int64, maxlongitude::Int64, minmagnitude::Float64, maxmagnitude::Int64, mindepth::Int64, maxdepth::Int64, eventtype::String) at /Users/thc/.julia/dev/SCEDC/src/events.jl:101
 [14] top-level scope at REPL[73]:1
 [15] include_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1088

Fix is to write function to accept string in yyyy_ddd format.

read_catalog with seconds = 60

catalogquery fails if the event time has 60 seconds, e.g. 1999/10/28 15:48:60.99 due to DateTime not being able to handle > 59 seconds.

using SCEDC, Dates, AWSCore
aws = aws_config(region="us-west-2")
df = catalogquery(aws,starttime = Date(1999,10,16),endtime=Date(1999,10,17),minmagnitude=7.)
ERROR: ArgumentError: Second: 60 out of range (0:59)
Stacktrace:
 [1] DateTime at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/types.jl:192 [inlined]
 [2] parse(::Type{DateTime}, ::String, ::DateFormat{Symbol("y/m/dTH:M:S.s"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/parse.jl:285
 [3] DateTime at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/io.jl:482 [inlined]
 [4] _broadcast_getindex_evalf at ./broadcast.jl:648 [inlined]
 [5] _broadcast_getindex at ./broadcast.jl:621 [inlined]
 [6] getindex at ./broadcast.jl:575 [inlined]
 [7] macro expansion at ./broadcast.jl:932 [inlined]
 [8] macro expansion at ./simdloop.jl:77 [inlined]
 [9] copyto! at ./broadcast.jl:931 [inlined]
 [10] copyto! at ./broadcast.jl:886 [inlined]
 [11] copy at ./broadcast.jl:862 [inlined]
 [12] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,Type{DateTime},Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(*),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(*),Tuple{Array{String,1},Base.RefValue{String}}},Array{String,1}}},Base.RefValue{DateFormat{Symbol("y/m/dTH:M:S.s"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'}}}}}}) at ./broadcast.jl:837
 [13] read_catalog(::Array{UInt8,1}) at /Users/thc/.julia/dev/SCEDC/src/catalog.jl:58
 [14] catalogquery(::Dict{Symbol,Any}; starttime::Date, endtime::Date, minlatitude::Int64, maxlatitude::Int64, minlongitude::Int64, maxlongitude::Int64, minmagnitude::Float64, maxmagnitude::Int64, mindepth::Int64, maxdepth::Int64, eventtype::String) at /Users/thc/.julia/dev/SCEDC/src/catalog.jl:115
 [15] top-level scope at REPL[32]:1
 [16] include_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1088

Fix will require parsing event times in each DataFrame.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.