sur2x3p.file: Convert a read in .sur file to x3p format and write the file.

Description Usage Arguments Details Value References Examples

View source: R/sur2x3p.file.R

Description

Convert a read in .sur file to x3p format

Usage

1
2
sur2x3p.file(surf.info, extra.file.info.list, comment.list, fname,
  move.to.directory)

Arguments

surf.info

information read in by read.digital.surf.file

extra.file.info.list

extra information required by the standard

comment.list

a list of user comments.

fname

desired .x3p file name

move.to.directory

desired place to put the .x3p file

Details

It's necessary at this point to open the .sur file so that point's can be converted to floats (or doubles), which as far as I can tell is required by the NanoFocus x3p library

Value

a x3p file is written to disk.

References

http://open-gps.sourceforge.net/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
file.path <- system.file("extdata", "glock.sur", package="x3pr")
glock.sur.info <- read.digital.surf.file(file.path)

extra.header.info <- list(
  x.axis.type = "I",
  x.data.type = "F",
  x.offset =    0.0,
  y.axis.type = "I",
  y.data.type = "F",
  y.offset    = 0.0,
  z.axis.type = "A",
  z.data.type = "F",
  z.offset    = 0.0,
  who.wrote.file = "abe[-at-]potus.gov ",
  manufacturer   = "Leitz",
  model = "Model-A",
  sn = "8675309",
  vers = "Version: 2010-C.E.",
  cal.dte = "2013-08-15T08:00:00-03:00",
  probe.type = "NonContacting",
  probe.id = "Interferometer",
  z.format = 1)

 comment.block<-list(
  paste("Surface is from: "," an object, ",sep=""),
  paste("Surface category: ","It was the left chunk, ",sep=""),
  paste("Surface sample#: ",3,", ",sep=""),
  paste("Droupouts/Outliers filled with ..., ",sep=""),
  paste("Estimated Resolution x (meters) ", glock.sur.info[[1]]$x.inc/1000, ", ",sep=""),
  paste("Estimated Resolution y (meters) ", glock.sur.info[[1]]$y.inc/1000, ", ",sep=""),
  paste("Estimated Resolution z (meters) ", glock.sur.info[[1]]$z.inc/1000, ", ",sep=""),
  paste("Form removed?: ", "YesOrNo, ",sep=""),
  paste("Filter ", "Type: None/", "Cutoffs: None, ",sep=""),
  paste("Microscope Objective: ", "50x/","0.8NA, ",sep=""),
  paste("Invalid Pixel Value: ", NaN,sep=""))

 sur2x3p.file(glock.sur.info, extra.header.info, comment.block, fname="testfile.x3p", move.to.directory=getwd())

npetraco/x3pr documentation built on May 23, 2019, 9:33 p.m.