I used "ReadSMDFile.tcl" to get ---.g3 file from the PEER Strong Motion Database (http://peer.berkeley.edu/smcat/) record ---.at2 file
When the main code is executed, the interpretation returns with the warning, and the warning appears as follows.
################################################
Number of Stories in Y: 2 Number of bays in X: 2 Number of bays in Z: 2
goGravity
Model Built
Cannot open ../GMfiles/H-E01140.at2 for reading
WARNING - PathSeries::PathSeries() - could not open file ../GMfiles/H-E01140.g3
WARNING -- PathSeries::getDuration() on empty Vector
Cannot open ../GMfiles/H-E12140.at2 for reading
WARNING - PathSeries::PathSeries() - could not open file ../GMfiles/H-E12140.g3
WARNING -- PathSeries::getDuration() on empty Vector
Ground Motion Done. End Time: 10.000000
################################################
And the ----.g3 file is not created in the GM files path.
Is it right ---.g3 file not appear in the form of a file and interpretation proceed?
here is the "ReadSMDFile.tcl" code
###################################
###########################################################################
# ReadSMDFile $inFilename $outFilename $dt #
###########################################################################
# read gm input format
#
# Written: MHS
# Date: July 2000
#
# A procedure which parses a ground motion record from the PEER
# strong motion database by finding dt in the record header, then
# echoing data values to the output file.
#
# Formal arguments
# inFilename -- file which contains PEER strong motion record
# outFilename -- file to be written in format G3 can read
# dt -- time step determined from file header
#
# Assumptions
# The header in the PEER record is, e.g., formatted as follows:
# PACIFIC ENGINEERING AND ANALYSIS STRONG-MOTION DATA
# IMPERIAL VALLEY 10/15/79 2319, EL CENTRO ARRAY 6, 230
# ACCELERATION TIME HISTORY IN UNITS OF G
# NPTS= 3930, DT= .00500 SEC
set GMdir "../GMfiles";
set inFile $GMdir/H-E01140.at2;
set outFile $GMdir/H-E01140.g3;
proc ReadSMDFile {inFilename outFilename dt} {
# read gm input format
# Pass dt by reference
upvar $dt DT
# Open the input file and catch the error if it can't be read
if [catch {open $inFilename r} inFileID] {
puts stderr "Cannot open $inFilename for reading"
} else {
# Open output file for writing
set outFileID [open $outFilename w]
# Flag indicating dt is found and that ground motion
# values should be read -- ASSUMES dt is on last line
# of header!!!
set flag 0
# Look at each line in the file
foreach line [split [read $inFileID] \n] {
if {[llength $line] == 0} {
# Blank line --> do nothing
continue
} elseif {$flag == 1} {
# Echo ground motion values to output file
puts $outFileID $line
} else {
# Search header lines for dt
foreach word [split $line] {
# Read in the time step
if {$flag == 1} {
set DT $word
break
}
# Find the desired token and set the flag
if {[string match $word "DT="] == 1} {set flag 1}
}
}
}
# Close the output file
close $outFileID
# Close the input file
close $inFileID
}
}; #
###########################################################################
How do I proceed to resolve this warning?
https://drive.google.com/file/d/1QuSFpz ... sp=sharing
The graph looks very strange in the beginning when the main code is interpreted. I don't know if this is related to this problem. If it's related, I'm going to ask additional questions later.
could not open file
Moderators: silvia, selimgunay, Moderators
-
- Posts: 917
- Joined: Mon Sep 09, 2013 8:50 pm
- Location: University of California, Berkeley
Re: could not open file
It may be that you don't have the at2 ground motion file in the correct folder.