This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
First, this was written back when I wrote Python a bit more like C - I know it needs some work! But for setting delimiters, | |
you can do the following: | |
my_dataset = data_file(r"path_to_data") | |
my_dataset.delim_open # gives you the opening delimeter | |
my_dataset.delim_close # gives you the closing delimeter | |
""" | |
import logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Allows you to pass in a list of environments to get the values of, then pass it back in to reset. | |
Usage: | |
original_envs = store_environments(["workspace","mask"]) # gives back a dict with current environment values for workspace and mask | |
arcpy.env.workspace = my_workspace | |
arcpy.env.mask = my_raster | |
# some more code here to do some work with those environments | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def copy_field_attributes_to_new_field(source_table, current_field, target_table, target_field): | |
""" | |
Copies the attributes of a field (data type, precision, scale, length, isNullable, required, domain) to a new field on a new table. | |
Correctly maps data types pulled from Describe tool to data types needed for field creation. | |
:param source_table: The table containing the existing field | |
:param current_field: The field to copy attributes from | |
:param target_table: The field to create the new field on | |
:param target_field: The name of the new field to create with the attributes from current_field | |
:return: | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def permanent_join(target_table, target_attribute, source_table, source_attribute, attribute_to_attach, rename_attribute=None): | |
""" | |
Provides a way to permanently attach a field to another table, as in a one to one join, but without performing a | |
join then exporting a new dataset. Operates in place by creating a new field on the existing dataset. | |
Or, in other words, Attaches a field to a dataset in place in ArcGIS - instead of the alternative of doing an | |
actual join and then saving out a new dataset. Only works as a one to one join. | |
:param target_table: the table to attach the joined attribute to | |
:param target_attribute: the attribute in the table to base the join on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Author: Fraser McCrossan | |
Tested on G9, should work on most cameras. | |
Modified by Nick Santos for use in synchronizing two cameras. | |
Designed for A495 and adapted from previous code - Works so long as the interval time is set to a number that divides evenly into 60 and that is longer than the time it. Creative Commons Attribution licensed - please cite both authors above. | |
An accurate intervalometer script, with pre-focus and screen power off options. | |
Features: |
NewerOlder