Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Logez Maxime
IIR
Commits
87abb253
Commit
87abb253
authored
Jun 21, 2017
by
Logez Maxime
Browse files
Calcul des temperatures decennales pour IIR
parents
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
87abb253
.Rproj.user
.Rhistory
.RData
.Ruserdata
/data
\ No newline at end of file
IIR.Rproj
0 → 100644
View file @
87abb253
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: knitr
LaTeX: pdfLaTeX
calcul_donnes_Tmp_iir.R
0 → 100644
View file @
87abb253
setwd
(
"D:/IIR/temperatures/IIR"
)
require
(
fastmatch
)
camp
<-
read.table
(
"./data/camp_2017_06_21.txt"
,
sep
=
"\t"
,
header
=
TRUE
,
stringsAsFactor
=
FALSE
)
wd
<-
"D:/Data/SAFRAN/"
temps
<-
matrix
(
numeric
(),
nrow
(
camp
),
3
)
colnames
(
temps
)
<-
c
(
"TMOY"
,
"TMAX"
,
"TAMP"
)
auxiJul
<-
seq
(
7
,
10
*
12
,
12
)
auxiJan
<-
seq
(
1
,
120
,
12
)
for
(
i
in
1
:
nrow
(
camp
))
{
if
(
grepl
(
"NA"
,
u
<-
camp
$
gridcode
[
i
]))
temps
[
i
,]
<-
NA
else
{
temp
<-
read.table
(
sprintf
(
"%s%s_month_tmp.txt"
,
wd
,
u
),
sep
=
";"
,
header
=
TRUE
,
colClasses
=
c
(
"character"
,
"numeric"
))
annee
<-
as.integer
(
substr
(
camp
$
Date
[
i
],
7
,
10
))
-1
d1
<-
expand.grid
(
Annee
=
(
annee
-9
)
:
annee
,
Mois
=
sprintf
(
"%02d"
,
1
:
12
))
d1
<-
do.call
(
paste0
,
d1
[
do.call
(
order
,
d1
),])
temp
<-
temp
$
Tmp
[
fmatch
(
d1
,
temp
$
Date
)]
tmean
<-
sum
(
temp
)
/
120
tjul
<-
sum
(
temp
[
auxiJul
])
/
12
tjan
<-
sum
(
temp
[
auxiJan
])
/
12
tamp
<-
tjul
-
tjan
temps
[
i
,]
<-
c
(
tmean
,
tjul
,
tamp
)
}
}
camp
$
deltaT
<-
with
(
camp
,
(
Altitude
-
AltitudePla
)
*
0.65
/
100
)
temps
<-
temps
+
camp
$
deltaT
camp
<-
cbind
(
camp
,
temps
)
write.table
(
camp
,
file
=
"./data/camp_temp_2017_06_21.txt"
,
sep
=
"\t"
,
row.names
=
FALSE
,
quote
=
TRUE
)
SPt
<-
SpatialPoints
(
coords
=
camp
[,
c
(
"X"
,
"Y"
)],
proj4string
=
CRS
(
"+init=epsg:2154"
))
FR_ctr_L93
<-
rgdal
::
spTransform
(
FR_ctr_L2E
,
)
FR_ctr_W84
<-
rgdal
::
spTransform
(
FR_ctr_L2E
,
CRS
(
"+init=epsg:4326"
))
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment