Wednesday 8 August 2012

Checking and changing image DPI

When publishing to a journal, they always have specifications about the dots per inch (DPI) of your images, and every time I find myself thinking -how do I find out what DPI it's already at, and how do I change it if its not right?

So I am just going to post the link to the blog post I always go back to, which advocates use of freeware IrFanView which has easy ways of checking dpi and changing it, if you are not privvy to more expensive softwares such as photoshop.

Advice and directions can be found here.

http://susanwiggs.wordpress.com/2007/09/06/we-need-a-300dpi-photo/

Unlinking Field Codes in MS Word

Field codes are a pain when they decide they need to automatically update and then delete all your content. For example when you are submitting a manuscript for publication and end up having to put content after your references which have been inserted by a reference manager. If the reference manager is not present the references and everything after them can disappear.

So top tip everybody, if you want to unlink your text, and delete the field codes, all you have to do is press:
CTRL+Shift+F9

I think that this will delete all field codes in the document, so if you suffer from the above scenario and want to keep adding references, beware that this solution will require you to manually type in any changes/additions to references.If it doesn't remove all codes and you want it too you can obviously try CTRL+A to select all first.

I love this tip, it saved me A LOT of grief!



P.S. Added tip if you are still having trouble, skimmed from a comment on a different website:

"Sometimes you can't select all with Ctrl-A (in Word 2007). Then you have to go to the Developer tab>Protect Document> Restrict Formatting and Editing. Then in the side bar that appears, click "Stop Protection".

For some reason, you have to do this even though the document was not protected in the first place!

Then you can Ctrl-A and then Ctrl-Shift-F9."

Thursday 29 March 2012

Clear R Command Window

Ctrl+l

If you've ever used matlab this function does the same as clc. I've see a whole lot of function writing which I tried and couldn't get to work, then found a comment saying...
"doesn't ctrl+l do that for you?". Love it!

Sunday 25 March 2012

Cell Statistics (e.g. mean or standard deviation across rasters) ( requires Spatial Analyst extension)

“Cell Statistics” is a function from the Spatial Analyst that allows you to calculate several statistical operations as derived from multiple rasters, i.e: minimum, maximum, mean, range, sum, standard deviation or median values of each grid from a group of rasters. The output is a new raster containing the statistic result for each cell corresponding to the calculation which has been derived from the specified cells beneath it. E.g. This is often used when trying to create a standard deviation map from e.g. 10 build models in order to provide spatially relevant values of variance (i.e. a map of error margins).

  1. Go to "Cell Statistics" in the drop down menu from the Spatial Analyst toolbar
  2. Add the relevant raster layers you would like the calculation to include to the right-hand pane
  3. Select the statistic you wish to calculate and press ok.
  4. (if the output is only temporary you must also make this permanent. See merging rasters step 10 for how to do this)

Merging Rasters (requires Spatial Analyst extension)

  1. Go to the options of the Spatial Analyst (from the Spatial Analyst toolbar drop down menu)
  2. Set the Extent to "Union of Inputs"
  3. Choose the cell size (can be same as another raster or typed in manually) then exit the options.
  4. Go to the Raster Calculator (also from the Spatial Analyst toolbar drop down menu).
  5. Type... MERGE (
  6. Double click on the rasters you want to merge separating the inserted text by commas then close the brackets
  7. IMPORTANT ensure that the cursor is then moved back a space so that it is flashing within the brackets! This operation usually does not complete if the cursor is outside the brackets.
  8. Click "Evaluate"
  9. A new temporary raster is generated and appears in the Layers pane.
  10. If you are happy with this new raster make the temporary raster permanent by right clicking on the raster in the Layers pane, selecting "data >" and then "Make permanent". Give your new raster a name and location and click save, then add it to your map if you wish to complete any further tasks with this raster.
NOTE: The order of priority when merging rasters is determined by the order in which the layers are selected in the raster calculator. The first raster you select whilst merging defines the settings which the output raster will default to (e.g. projection). All subsequent rasters when merged will conform to these settings.

Friday 23 March 2012

Clipping Rasters - Raster Calculator Method (requires Spatial Analyst extension)

  1. Go to the options of the Spatial Analyst (drop down menu on toolbar - you may have to activate this toolbar first)
  2. In the "General" tab set the "Analysis Mask" as the smallest raster. You'll cut the rasters with the shape of the "Analysis Mask".
  3. In the "Extent" tab set the extent as the same layer as the "Analysis Mask"
  4. Choose the cell size in the "Cell Size" tab and close the options menu.
  5. Go to the raster calculator (also in the drop down menu on the spatial analyst toolbar)
  6. Double click the raster you want to clip and press the "Evaluate"

NOTE you can only clip rasters one by one.